public async Task <IActionResult> CategoryEditUpdate(CategoryMasterViewModel categoryMasterViewModel) { if (ModelState.IsValid) { await MasterService.UpdateCategory(categoryMasterViewModel); } return(RedirectToAction("CategoryList", "SupplierRequest")); }
public async Task <int> UpdateCategory(CategoryMasterViewModel categoryMasterViewModel) { var response = await this._context.CategoryMasterRepository.GetCategoryById(categoryMasterViewModel.CategoryMasterId); response.Category = categoryMasterViewModel.Category; response.Description = categoryMasterViewModel.Description; this._context.CategoryMasterRepository.Update(response); return(await this._context.CompleteAsync()); }
public async Task <int> AddCategory(CategoryMasterViewModel categoryMasterViewModel) { this._context.CategoryMasterRepository.Add(new Database.CategoryMaster() { Category = categoryMasterViewModel.Category, Description = categoryMasterViewModel.Description }); return(await this._context.CompleteAsync()); }
public async Task <IActionResult> CreateCategory(CategoryMasterViewModel categoryMasterViewModel) { if (ModelState.IsValid) { if (await MasterService.AddCategory(categoryMasterViewModel) > 0) { return(RedirectToAction("CategoryList", "SupplierRequest")); } } return(View()); }
public async Task <IActionResult> CategoryEdit(int categoryId) { var response = await MasterService.GetCategoryById(categoryId); CategoryMasterViewModel categoryMasterViewModel = new CategoryMasterViewModel() { Category = response.Category, CategoryMasterId = response.CategoryMasterId, Description = response.Description }; return(View("CategoryEdit", categoryMasterViewModel)); }
Task <long> ICategoryMasterService.Add(CategoryMasterViewModel categoryMasterView) { throw new NotImplementedException(); }
public Task <long> Add(CategoryMasterViewModel categoryMasterView) { throw new NotImplementedException(); }
public IActionResult CategoryCreate() { CategoryMasterViewModel categoryMasterViewModel = new CategoryMasterViewModel(); return(View("CategoryCreate", categoryMasterViewModel)); }