示例#1
0
 public ActionResult New()
 {
     var model = new EditViewModel()
     {
         Client = new Structure.Models.Client()
     };
     return View("Edit", model);
 }
示例#2
0
        public ActionResult Edit(EditViewModel model)
        {
            var response = this.ModelService.SaveClient(model.Client);
            if (response.HasError){
                TempData["Error"] = "Could not save client.";
                return View(model);
            }

            TempData["Success"] = model.Client.Name + " was successfully saved.";
            return this.RedirectToAction("Index");
        }
示例#3
0
        public ActionResult Edit(int id)
        {
            var response = this.ModelService.GetClient(id);
            var client = response.Result;

            var model = new EditViewModel()
            {
                Client = client
            };
            return View(model);
        }