コード例 #1
0
 public void UpdateCustomer(CustomerModel customerModel)
 {
     foreach (CustomerModel custlst in _customerList)
     {
         if (custlst.Email == customerModel.Email)
         {
             _customerList.Remove(custlst);
             _customerList.Add(customerModel);
             break;
         }
     }
 }
コード例 #2
0
 public ActionResult Edit(CustomerModel cust)
 {
     try
     {
         // TODO: Add update logic here
         _customers.UpdateCustomer(cust);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
コード例 #3
0
 public ActionResult Create(CustomerModel custModel)
 {
     _customers.CreateCustomer(custModel);
     return RedirectToAction("Index");
 }
コード例 #4
0
 public void CreateCustomer(CustomerModel customerModel)
 {
     _customerList.Add(customerModel);
 }