public ActionResult Insert(SubCategory item, HttpPostedFileBase resim) { ViewBag.CategoryID = new SelectList(cs.GetActive(), "ID", "CategoryName", item.CategoryID); if (ModelState.IsValid) { bool result; string fileResult = FxFunction.ImageUpload(resim, ImageFile.SubCategories, out result); if (result) { item.ImagePath = fileResult; } else { ViewBag.Message = fileResult; } bool sonuc = ss.Add(item); if (sonuc) { ViewBag.Message = "Ekleme İşlemi Başarılı"; return(RedirectToAction("Index", new { id = item.CategoryID })); } else { ViewBag.Message = "Ekleme İşlemi Başarısız"; } } return(View()); }
public ActionResult Add(SubCategory data) { data.ID = Guid.NewGuid(); sub.Add(data); return(RedirectToAction("Index")); }
public ResultViewModel <SubCategory> Post(SubCategoryEditViewModel SubCategory) { ResultViewModel <SubCategory> result = new ResultViewModel <SubCategory>(); try { if (!ModelState.IsValid) { result.Message = "In Valid Model State"; } else { SubCategory selectedSubCategory = subCategoryService.Add(SubCategory); result.Successed = true; result.Data = selectedSubCategory; } } catch (Exception ex) { result.Successed = false; result.Message = "Semething Went Wrong"; } return(result); }
public ActionResult Create(SubCategory subCategory) { try { subCategoryService.Add(subCategory); return(RedirectToAction("Index")); } catch { return(View()); } }
public void Add(SubCategory subCategory) { subCategoryService.Add(subCategory); //return RedirectToAction("Index"); }
public ActionResult Add(SubCategory subCategory) { subCategory.ID = Guid.NewGuid(); SubCategoryService.Add(subCategory); return(RedirectToAction("List")); }
public ActionResult Add(SubCategory model) { _subcategoryService.Add(model); return(View(_categoryService.GetActive())); }
public ActionResult Add(SubCategory data) { _subCategoryService.Add(data); return(Redirect("/Admin/SubCategory/List")); }
public ActionResult AddSubCategory(SubCategory subCategory, int categoryId) { subCategory.CategoryId = categoryId; subCategoryService.Add(subCategory); return(RedirectToAction("Index")); }