Last post Sep 18, 2012 05:45 PM by ignatandrei
Sep 17, 2012 02:04 AM|vahidarr|LINK
i have problem with what should retruning busssines logic on insert, update , delete , select. for example if i insert a data maybe it want to retrun identitty or maybe a uniqe constraint exception happen and i should retrun appropiate message or maybe i
just want return a successful message.
what should i return.please help me by example that works correctly on all situation?
Sep 17, 2012 02:34 AM|Mikesdotnetting|LINK
You shouldn't return exceptions. People usually return integers. The value will represent the ID of the new object, or the number of rows affected depending on the type of operation. They might also return -1 to indicate that an exception was raised.
Sep 17, 2012 02:41 AM|umairajmal|LINK
It is quit simple. You should need to return an integer value. Just like 0 and 1.
Set a flag in your bussines logic and set its value to 1 if query successfully executed and recrod inserted, Deleted or updated.
And set flag's value to 0 if unsuccessfull. And return that flag value.
Sep 17, 2012 02:42 AM|vahidarr|LINK
where should i face to exception because i want to give exact message about problem(exception)?for example the same student is exist in DB.maybe i want to return my key that is not integer it is string.what should i do in this situation?
Sep 17, 2012 04:23 AM|DMW|LINK
Sep 17, 2012 11:27 AM|vahidarr|LINK
ok.is it true?how can i intercat with exception in three layer????.plz help i get confused
bussines logic layer
public bool CustomerColorInsert(CustomerColors CustomerColor)
Sep 18, 2012 05:45 PM|ignatandrei|LINK
intercept in latest(GUI)