示例#1
0
 public void FormView_InsertItem(Model.Customer customer)
 {
     var customerService = new CustomerService();
             customerService.InsertCustomer(customer);
             Session["saved"] = true;
             Response.Redirect("~/Pages/Customer/CustomerListing.aspx");
 }
示例#2
0
 //spara ny kund
 public void FormView_InsertItem(Model.Customer customer)
 {
     if (ModelState.IsValid)
     {
         try
         {
             var customerService = new CustomerService();
             customerService.InsertCustomer(customer);
             Session["saved"] = true;
             Response.RedirectToRoute("ListCustomer", null);
             Context.ApplicationInstance.CompleteRequest();
         }
         catch (Exception)
         {
             ModelState.AddModelError(String.Empty, "Ett fel inträffade när kunden skulle sparas");
         }
     }
 }