Exemplo n.º 1
0
        public ActionResult Update([ModelBinder(typeof(XpoModelBinder))] CUFE.Models.Lager item)
        {
            var model = _unitOfWork.Query <CUFE.Models.Lager>();

            if (item.IsChanged)
            {
                item.Save();
            }
            return(PartialView("GridViewPartial", model.ToList()));
        }
Exemplo n.º 2
0
        public ActionResult Add([ModelBinder(typeof(XpoModelBinder))] CUFE.Models.Lager item)
        {
            var model = _unitOfWork.Query <CUFE.Models.Lager>();

            if (ModelState.IsValid)
            {
                new Lager(_unitOfWork)
                {
                    Address  = item.Address,
                    Capacity = item.Capacity,
                    Width    = item.Width,
                    Height   = item.Height,
                    Length   = item.Length,
                    Active   = item.Active
                };
                _unitOfWork.CommitChanges();
            }
            else
            {
                ViewData["EditError"] = "Please, correct all errors.";
            }
            return(PartialView("GridViewPartial", model.ToList()));
        }