public async Task <IActionResult> Edit(productSizeUpsertViewModel model) { if (ModelState.IsValid) { var storeobj = _unitofWork.productSize.Get(model.id); if (storeobj == null) { TempData["error"] = "Record Not Found"; return(NotFound()); } storeobj.id = model.id; storeobj.size = model.size; _unitofWork.productSize.Update(storeobj); bool res = _unitofWork.Save(); TempData["success"] = "Record Update successfully"; return(RedirectToAction(nameof(Index))); } else { return(View(model)); } }
public async Task <IActionResult> Create(productSizeUpsertViewModel model) { if (ModelState.IsValid) { var obj = new productSize { id = model.id , size = model.size , isdeleted = false , isactive = false }; _unitofWork.productSize.Add(obj); bool res = _unitofWork.Save(); TempData["success"] = "Record Save successfully"; return(RedirectToAction(nameof(Index))); } else { return(View(model)); } }
public IActionResult Edit(int id) { var objcategory = _unitofWork.productSize.Get(id); if (objcategory == null) { return(NotFound()); } var model = new productSizeUpsertViewModel() { id = objcategory.id, size = objcategory.size, }; return(View(model)); }
public IActionResult Create() { var model = new productSizeUpsertViewModel(); return(View(model)); }