public static Customer GetCustomer(string customerId) { try { CustomerDAO customerDAO = new CustomerDAO(); return customerDAO.GetCustomer(customerId); } catch (ApplicationException) { throw; } catch (Exception ex) { // log this exception log4net.Util.LogLog.Error(ex.Message, ex); // wrap it and rethrow throw new ApplicationException(SR.BusinessGetCustomerException, ex); } }
public static void UpdateCustomer(Customer customer) { try { CustomerDAO customerDAO = new CustomerDAO(); customerDAO.UpdateCustomer(customer); } catch (ApplicationException) { throw; } catch (Exception ex) { // log this exception log4net.Util.LogLog.Error(ex.Message, ex); // wrap it and rethrow throw new ApplicationException(SR.BusinessUpdateCustomerException, ex); } }
public static CustomerCollection GetCustomerList(CustomerColumns orderBy, string orderDirection) { try { CustomerDAO customerDAO = new CustomerDAO(); return customerDAO.GetCustomerList(orderBy, orderDirection); } catch (ApplicationException) { throw; } catch (Exception ex) { // log this exception log4net.Util.LogLog.Error(ex.Message, ex); // wrap it and rethrow throw new ApplicationException(SR.BusinessGetCustomerListException, ex); } }
public static CustomerCollection GetCustomerListByBirthDay() { try { CustomerDAO customerDAO = new CustomerDAO(); return customerDAO.GetCustomerList(CustomerColumns.CustomerId, "ASC", DateTime.Now); } catch (ApplicationException) { throw; } catch (Exception ex) { // log this exception log4net.Util.LogLog.Error(ex.Message, ex); // wrap it and rethrow throw new ApplicationException(SR.BusinessGetCustomerListException, ex); } }
public static CustomerCollection GetCustomerListSearch(int TypeId, string CustomerId, string CustomerName, string CustomerNameViet, string Email,string mobile, CustomerColumns orderBy, string orderDirection, int page, int pageSize, out int totalRecords) { try { CustomerDAO customerDAO = new CustomerDAO(); return customerDAO.GetCustomerListSearch(TypeId, CustomerId, CustomerName, CustomerNameViet, Email,mobile, orderBy, orderDirection, page, pageSize, out totalRecords); } catch (ApplicationException) { throw; } catch (Exception ex) { // log this exception log4net.Util.LogLog.Error(ex.Message, ex); // wrap it and rethrow throw new ApplicationException(SR.BusinessGetCustomerListException, ex); } }