Пример #1
0
 public ActionResult Edit(int id, CATEGORY category)
 {
     try
     {
         jsonResultMessage = categoryContainsError(category);
         if (ModelState.IsValid && !ErrorExist)
         {
             CategoryModel.EditCategory(category);
         }
         return(Json(jsonResultMessage, JsonRequestBehavior.AllowGet));
     }
     catch
     {
         return(Json("Error", JsonRequestBehavior.AllowGet));
     }
 }
Пример #2
0
        private void SaveChanges(Helps.EntityState entityState, CategoryModel categoryModel)
        {
            switch (entityState)
            {
            case EntityState.Add:
                categoryModel.InsertCategory();
                break;

            case EntityState.Edit:
                categoryModel.EditCategory();
                break;

            case EntityState.Delete:
                categoryModel.RemoveCategory();
                break;

            default:
                DialogConfirm.GetDialogResult("Debe Seleccionar la operación a realizar", "Exclamation");
                break;
            }
        }