Ejemplo n.º 1
0
        public ActionResult AddEditSubCategory(SubCategoryViewModel model, HttpPostedFileBase file)
        {
            var res = AutoMapper.Mapper.Map <SubCategoryViewModel, SubCategoryMaster>(model);

            if (file != null)
            {
                res.ImageURL = UploadFileOnServer(SubCategoryImagePath, file);
            }
            var isSuccess = _subCategoryService.AddOrUpdateSubCategory(res);

            return(Json(isSuccess, JsonRequestBehavior.AllowGet));
        }