コード例 #1
0
 // GET: Customer/Edit/5
 public ActionResult Edit(int id)
 {
     CustomerViewModel cvm = new CustomerViewModel();
     cvm.Customer = facade.GetCustomerGateway().Get(id);
     cvm.SelectedList = cvm.Customer.Address.Id.ToString();
     return View(cvm);
 }
コード例 #2
0
        public ActionResult Create(CustomerViewModel item)
        {
            try
            {
                item.Customer.Address = facade.GetAddressGateway().Get(int.Parse( item.SelectedList));
                facade.GetCustomerGateway().Add(item.Customer);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
コード例 #3
0
 // GET: Customer/Create
 public ActionResult Create()
 {
     CustomerViewModel mvc = new CustomerViewModel();
     return View(mvc);
 }