public ActionResult Create(FormCollection collection) { try { if (Authenticate().Equals("admin")) { PLCustomer PL_Customer = new PLCustomer(); PL_Customer.customer_name = collection["customer_name"]; PL_Customer.customer_pw = collection["customer_pw"]; PL_Customer.customer_type = collection["customer_type"]; PL_Customer.first_name = collection["first_name"]; ViewBag.message = PL_Customer.customer_type; PL_Customer.middle_name = collection["middle_name"]; PL_Customer.last_name = collection["last_name"]; CustomerClientService.CreateCustomer(PL_Customer); return RedirectToAction("Index"); } else return CantGoHere(); } catch { return View("Create"); } }
// // GET: /AdminLogin/Create public ActionResult Create() { if (Authenticate().Equals("admin")) { PLCustomer PL_Customer = new PLCustomer(); //PL_Customer.customer_types = new string[3] { "undergrad", "grad", "faculty" }; return View("Create", PL_Customer); } else return CantGoHere(); }
private static SLCustomers.Customer DTO_to_SL(PLCustomer PL_Customer) { SLCustomers.Customer SL_Customer = new SLCustomers.Customer(); SL_Customer.customer_id = PL_Customer.customer_id; SL_Customer.customer_name = PL_Customer.customer_name; SL_Customer.customer_type = PL_Customer.customer_type; SL_Customer.customer_pw = PL_Customer.customer_pw; SL_Customer.first_name = PL_Customer.first_name; SL_Customer.middle_name = PL_Customer.middle_name; SL_Customer.last_name = PL_Customer.last_name; return SL_Customer; }
public static void UpdateCustomer(PLCustomer PL_Customer) { string[] errors = new string[0]; SLCustomers.ISLCustomers SLCustomers = new SLCustomers.SLCustomersClient(); SLCustomers.UpdateCustomer(DTO_to_SL(PL_Customer), ref errors); }