Пример #1
0
        public ActionResult Index(Vendor vnd)
        {
            var user = DisplayCurUser();
               // if (!user.UserCanEdit()) return RedirectToAction("AccessDenied", "Error");

            try
            {
                ResponseMessage responseMessage;
                bool complete = vnd.Save(out responseMessage);
                if (!complete) throw new Exception(responseMessage.ErrorMessage);
                TempData["ServerSuccess"] = "Вендор успешно добавлен";
                return RedirectToAction("Index");
            }
            catch (Exception ex)
            {
                TempData["ServerError"] = ex.Message;
                return View("Index", vnd);
            }
        }
Пример #2
0
 private void FillSelf(Vendor model)
 {
     Id = model.Id;
     Name = model.Name;
 }