public JsonResult SaveMerchant(LoginUser loginUser, Merchant merchant) { merchant.TenantID = loginUser.TenantID; var imgStringIdx = merchant.SignBoard.IndexOf(','); if (imgStringIdx > 0) { merchant.SignBoard = General.Base64StringToImg(merchant.SignBoard.Substring(imgStringIdx + 1), merchant.TenantID + "/" + merchant.ID); } imgStringIdx = merchant.Licence.IndexOf(','); if (imgStringIdx > 0) { merchant.Licence = General.Base64StringToImg(merchant.Licence.Substring(imgStringIdx + 1), merchant.TenantID + "/" + merchant.ID); } var result = _merchant.UpdateMerchant(merchant); return(Json(result, JsonRequestBehavior.AllowGet)); }
public JsonResult SaveMerchantService(LoginUser loginUser, MerchantService merchantService) { var result = false; merchantService.TenantID = loginUser.TenantID; var imgStringIdx = merchantService.PicUrl.IndexOf(','); if (imgStringIdx > 0) { merchantService.PicUrl = General.Base64StringToImg(merchantService.PicUrl.Substring(imgStringIdx + 1), merchantService.TenantID + "/" + merchantService.MerchantID); } if (string.IsNullOrEmpty(merchantService.ID)) { merchantService.ID = General.GenerateUniqueID(); result = _merchant.AddMerchantService(merchantService); } else { result = _merchant.UpdateMerchantService(merchantService); } return(Json(result, JsonRequestBehavior.AllowGet)); }