Пример #1
0
 public async Task <IActionResult> CategoryEditUpdate(CategoryMasterViewModel categoryMasterViewModel)
 {
     if (ModelState.IsValid)
     {
         await MasterService.UpdateCategory(categoryMasterViewModel);
     }
     return(RedirectToAction("CategoryList", "SupplierRequest"));
 }
Пример #2
0
        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());
        }
Пример #3
0
 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());
 }
Пример #4
0
 public async Task <IActionResult> CreateCategory(CategoryMasterViewModel categoryMasterViewModel)
 {
     if (ModelState.IsValid)
     {
         if (await MasterService.AddCategory(categoryMasterViewModel) > 0)
         {
             return(RedirectToAction("CategoryList", "SupplierRequest"));
         }
     }
     return(View());
 }
Пример #5
0
        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));
        }
Пример #6
0
 Task <long> ICategoryMasterService.Add(CategoryMasterViewModel categoryMasterView)
 {
     throw new NotImplementedException();
 }
Пример #7
0
 public Task <long> Add(CategoryMasterViewModel categoryMasterView)
 {
     throw new NotImplementedException();
 }
Пример #8
0
        public IActionResult CategoryCreate()
        {
            CategoryMasterViewModel categoryMasterViewModel = new CategoryMasterViewModel();

            return(View("CategoryCreate", categoryMasterViewModel));
        }