Example #1
0
        public async Task <IActionResult> ComputerAccessoriesBrand([FromForm] DocumentTypeViewModel model)
        {
            string attachPath = string.Empty;

            if (model.formFile != null)
            {
                string fileName;
                string message = FileSave.SaveImage(out fileName, "Upload/Attachment/DocumentCategory", model.formFile);

                if (message == "success")
                {
                    attachPath = fileName;
                }
            }
            ComputerAccessoriesBrand computerAccessoriesBrand = new ComputerAccessoriesBrand
            {
                Id          = (int)model.documentcategoryId,
                brandName   = model.documentCategoryName,
                brandNameBn = model.documentCategoryNameBn,
                imagePath   = attachPath
            };
            await lostAndFoundType.SaveComputerAccessoriesBrand(computerAccessoriesBrand);

            return(RedirectToAction(nameof(ComputerAccessoriesBrand)));
        }