public JsonResult UpdateWhiteLabel(int whiteLabelId, WhiteLabelProvider whiteLabel) { ms_oLog.Debug("Update broker white label request for white label {0}...", whiteLabelId); var whiteLabelRepo = ObjectFactory.GetInstance <WhiteLabelProviderRepository>(); var wl = whiteLabelRepo.Get(whiteLabelId); if (wl == null) { return(Json(new { error = "white label not found" })); } wl.Logo = whiteLabel.Logo ?? wl.Logo; wl.LogoImageType = whiteLabel.LogoImageType ?? wl.LogoImageType; wl.Name = whiteLabel.Name ?? wl.Name; wl.Phone = whiteLabel.Phone ?? wl.Phone; wl.LeadingColor = whiteLabel.LeadingColor ?? wl.LeadingColor; wl.SecondoryColor = whiteLabel.SecondoryColor ?? wl.SecondoryColor; wl.Email = whiteLabel.Email ?? wl.Email; wl.FinishWizardText = whiteLabel.FinishWizardText ?? wl.FinishWizardText; wl.FooterText = whiteLabel.FooterText ?? wl.FooterText; wl.ConnectorsToEnable = whiteLabel.ConnectorsToEnable ?? wl.ConnectorsToEnable; whiteLabelRepo.Update(wl); return(Json(new { success = true })); } // UpdateWhiteLabel
public JsonResult SaveWhiteLabel(int brokerId, WhiteLabelProvider whiteLabel) { ms_oLog.Debug("Save broker white label request for broker {0}...", brokerId); var whiteLabelRepo = ObjectFactory.GetInstance <WhiteLabelProviderRepository>(); if (whiteLabelRepo.GetByName(whiteLabel.Name) != null) { return(Json(new { error = "white label with such name already exists" })); } var brokerRepo = ObjectFactory.GetInstance <BrokerRepository>(); var broker = brokerRepo.Get(brokerId); if (broker != null) { whiteLabel.LogoWidthPx = 128; whiteLabel.LogoHeightPx = 34; broker.WhiteLabel = whiteLabel; return(Json(new { broker.WhiteLabel }, JsonRequestBehavior.AllowGet)); } // if return(Json(new { error = "broker not found" })); } // SaveWhiteLabel