public ActionResult Add(CustomerAddViewModel viewModel) { if (TryUpdateModel(viewModel)) { CustomerAddViewModel model = new CustomerAddViewModel(); CustomerService cService = new CustomerService(); cService.Add(viewModel.NewCustomer); model.Message = "Customer was added"; return View(model); } return View(new CustomerAddViewModel()); }
public ActionResult Add() { CustomerAddViewModel viewModel = new CustomerAddViewModel(); return View(viewModel); }