Esempio n. 1
0
        public ActionResult Update(int id)
        {
            UpCategory model =
                _uow
                .GetRepo <UpCategory>()
                .Where(x => x.Id == id)
                .FirstOrDefault();

            return(View(model));
        }
Esempio n. 2
0
        public ActionResult Add(UpCategory model)
        {
            if (ModelValidate(model).IsValid)
            {
                _uow.GetRepo <UpCategory>().Add(model);
                if (_uow.Commit() > 0)
                {
                    TempData["Msg"] = "İşlem başarıyla gerçekleşmiştir.";
                }
                ModelState.Clear();
            }
            else
            {
                _collect.CollectError <UpCategoryValidator, UpCategory>(model);
            }

            return(View());
        }
Esempio n. 3
0
        public ActionResult Update(UpCategory model)
        {
            if (ModelValidate(model).IsValid)
            {
                _uow
                .GetRepo <UpCategory>()
                .Update(model);
                if (_uow.Commit() > 0)
                {
                    TempData["Msg"] = "Başarıyla güncellenmiştir.";
                }
            }
            else
            {
                _collect.CollectError <UpCategoryValidator, UpCategory>(model);
            }

            return(View());
        }
Esempio n. 4
0
 private ValidationResult ModelValidate(UpCategory model)
 {
     return(_f.Create <UpCategoryValidator, UpCategory>(model));
 }