public ActionResult CustomerSignUp(Customers customer) { if (!ModelState.IsValid) { return(RedirectToAction("SignUpAsCustomerView")); } string ViewName = "CustomerMainPageView"; try { customer.CustomerPassword = Encryption(customer.CustomerPassword); if (InsertCustomer(customer)) { FormsAuthentication.SetAuthCookie(customer.CustomerEmail, true); return(RedirectToAction(ViewName)); } else { return(View()); } } catch (Exception ex) { LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true); throw new Exception("CustomerController::CustomerSignUp::Error occured.", ex); } }
private bool InsertCustomer(Customers customers) { try { using (var customerBusiness = new CustomerBusiness()) { return(customerBusiness.Insert(customers)); } } catch (Exception ex) { LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true); throw new Exception("CustomerController::InsertCustomer::Error occured.", ex); } }