public async Task <IActionResult> EditBrand(ViewModels.PM.Brand.EditBrandViewModel editBrand) { ImageErrorModel imageErrorModel = new ImageErrorModel(); string ImagePath = null; if (editBrand.DefaultImage == null) { ImagePath = editBrand.OldImage; } else { ImagePath = UploadImage(editBrand.DefaultImage, ref imageErrorModel); } if (ModelState.IsValid) { Brand objbrand = await this.BrandBLL.Find(editBrand.ID); objbrand.Description = editBrand.Description; objbrand.Name = editBrand.Name; objbrand.DefaultImage = ImagePath; await BrandBLL.Update(objbrand); return(RedirectToAction("Index")); } return(View(editBrand)); }
public async Task <IActionResult> EditBrand(string id) { Brand objbrand = await this.BrandBLL.Find(id); ViewModels.PM.Brand.EditBrandViewModel editViewBrandModel = new ViewModels.PM.Brand.EditBrandViewModel { ID = objbrand.ID, Name = objbrand.Name, Description = objbrand.Description, OldImage = objbrand.DefaultImage }; return(View(editViewBrandModel)); }