示例#1
0
        //
        // GET: CreateEdit
        public ActionResult CreateEdit(string iid)
        {
            UItemCategory itemCategory = new UItemCategory();

            Guid itemCatId;

            if (Guid.TryParse(iid, out itemCatId))
            {
                ViewBag.Action             = Resources.Global_String_Edit;
                itemCategory._ItemCategory = itemCategoryService.GetItemCategory(itemCatId);
            }
            return(View(itemCategory));
        }
示例#2
0
 public ActionResult CreateEdit(UItemCategory itemCategory, string Action)
 {
     if (ModelState.IsValid)
     {
         if (Action.Equals("Edit"))
         {
             if (itemCategoryService.EditItemCategory(itemCategory._ItemCategory))
             {
                 itemCategory = new UItemCategory();
                 ModelState.Clear();
             }
         }
         else
         {
             if (itemCategoryService.AddItemCategory(itemCategory._ItemCategory))
             {
                 itemCategory = new UItemCategory();
                 ModelState.Clear();
             }
         }
     }
     return(View(itemCategory));
 }