Пример #1
0
 // the following code connects with the selectbyID function the the DataAccess logic through the BusinessLogic
 private OwnersEntity SelectOwnerById(int id)
 {
     try
     {
         using (var owners = new OwnersBusiness())
         {
             return(owners.SelectOwnerById(id));
         }
     }
     catch (Exception ex)
     {
         //Log exception error
         _loggingHandler.LogEntry(ExceptionHandler.GetExceptionMessageFormatted(ex), true);
     }
     return(null);
 }
Пример #2
0
        private OwnersEntity SelectOne(int id)
        {
            try
            {
                using (var owners = new OwnersBusiness())
                {
                    return(owners.SelectOwnerById(id));
                }
            }
            catch (Exception ex)
            {
                //Log exception error
                _loggingHandler.LogEntry(ExceptionHandler.GetExceptionMessageFormatted(ex), true);

                MessageBox.Show("UserInterface:OwnersForm::SelectOne::Error occured." +
                                Environment.NewLine + ex.Message, "Error", MessageBoxButtons.OK);
            }
            return(null);
        }