public DbResponse StoreUpdateByAdmin(VendorInfoUpdateByAdminModel model) { try { if (_db.Vendor.IsNull(model.VendorId)) { return(new DbResponse(false, "Vendor ID Not Found")); } if (_db.Vendor.IsExistStore(model.StoreName, model.VendorId)) { return(new DbResponse(false, $"{model.StoreName} already Exist")); } if (_db.Vendor.IsExistSlugUrl(model.StoreSlugUrl, model.VendorId)) { return(new DbResponse(false, $"{model.StoreSlugUrl} Url already Exist")); } _db.Vendor.VendorInfoUpdateByAdmin(model); _db.SaveChanges(); return(new DbResponse(true, "Success")); } catch (Exception e) { return(new DbResponse(false, e.Message)); } }
public IActionResult ProfileUpdate(VendorInfoUpdateByAdminModel model) { var response = _vendor.StoreUpdateByAdmin(model); return(Json(response)); }