protected void btnSave_Click(object sender, EventArgs e) { if (fileImg.PostedFile.ContentLength > 51200) { ShowMessage("上传图片过大,请选择小图片。"); return; } string path = ""; try { path = fileImg.HasFile ? Service.FileService.Upload(fileImg, "OEMLogo", "(jpg)|(gif)|(png)|(jpeg)", 51200) : OldImgUrl.Text.Replace(FileWeb, ""); } catch (Exception ex) { ShowExceptionMessage(ex, "上传图片"); return; } DistributionOEM oem = new DistributionOEM() { SiteName = txtName.Text, DomainName = txtDomain.Text, ManageEmail = txtEmail.Text, ICPRecord = txtICP.Text, LogoPath = path, EmbedCode = txtEmbedCode.Text, Enabled = radEnabled.Checked, AllowSelfRegex = radAllowSelfRegex.Checked }; var oemold = OEMService.QueryOEM(Guid.Parse(Request.QueryString["id"])); oem.AirlineConfig = oemold.AirlineConfig; oem.AuthCashDeposit = oemold.AuthCashDeposit; oem.CompanyId = oemold.CompanyId; oem.Contract = oemold.Contract; oem.EffectTime = oemold.EffectTime; oem.RegisterTime = oemold.RegisterTime; oem.Setting = oemold.Setting; oem.UseB3BConfig = oemold.UseB3BConfig; oem.OperatorAccount = oemold.OperatorAccount; oem.Id = oemold.Id; oem.LoginUrl = oemold.LoginUrl; try { DistributionOEMService.UpdateDistributionOEM(oem); } catch (Exception ex) { ShowExceptionMessage(ex, "修改站点信息"); return; } //刷新缓存 FlushRequester.TriggerOEMFlusher(oem.Id); RegisterScript("alert('修改站点信息成功!');window.location.href='DistributionOemAuthorizationList.aspx';", true); }
/// <summary> /// 保存OME风格 /// </summary> /// <param name="style"></param> /// <param name="oemId"> </param> public void SaveOEMStyle(OEMStyle style) { style.StylePath = style.StylePath.Where(p => !string.IsNullOrWhiteSpace(p)).ToList(); if (style.Id == Guid.Empty) { style.Id = Guid.NewGuid(); OEMStyleService.InsertOEMStyle(style, CurrentUser.UserName); } else { OEMStyleService.UpdateOEMStyle(style, CurrentUser.UserName); FlushRequester.TriggerOEMStyleFlusher(style.Id); } }
protected void btnSave_Click(object sender, EventArgs e) { try { var oem = OEMService.QueryOEM(CurrentCompany.CompanyId); Guid styleId = Guid.Parse(hidValue.Value); DistributionOEMService.ChooiceStyle(oem.Id, styleId, CurrentUser.UserName); //刷新缓存 FlushRequester.TriggerOEMFlusher(oem.Id); oem = OEMService.QueryOEM(oem.DomainName); LoadStyle(oem); } catch (Exception ex) { ShowExceptionMessage(ex, "选择风格"); } ShowMessage("选择风格成功,刷新页面后生效!"); }
/// <summary> /// 修改页头信息 /// </summary> /// <param name="setting"></param> /// <returns></returns> public string UpdateHeaderifno(OemSetting setting, string oemid) { try { //var set = DistributionOEMService.QueryDistributionOEMSetting(setting.Id); //setting.FooterLinks = set.FooterLinks; //setting.BGColor = set.BGColor; //setting.copyrightInfo = set.copyrightInfo; DistributionOEMService.UpdateDistributionOEMSetting(setting, Guid.Parse(oemid), CurrentUser.UserName); //刷新缓存 FlushRequester.TriggerOEMFlusher(Guid.Parse(oemid)); } catch (Exception ex) { return(ex.Message); } return("1"); }
protected void btnSubmit_Click(object sender, EventArgs e) { try { var contract = createOEMContract(); OEMService.SvaeContract(contract, CurrentUser.UserName); FlushRequester.TriggerOEMFlusher(contract.Id); if (IsPlateform) { Response.Redirect("/OrganizationModule/TerraceModule/DistributionOemAuthorizationList.aspx?Search=Back", true); } else { ShowMessage("保存成功"); } } catch (Exception ex) { ShowExceptionMessage(ex, "保存"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { if (valiate()) { DistributionOEM distributionOEM = save(); if (lblOperator.Text == "修改") { DistributionOEMService.UpdateOemInfo(distributionOEM, CurrentUser.UserName); FlushRequester.TriggerOEMFlusher(distributionOEM.Id); } else { CompanyDetailInfo companyDetailInfo = CompanyService.GetCompanyDetail(txtB3bAccountNo.Text.Trim()); if (companyDetailInfo == null) { ShowMessage("该B3B账号不存在"); } else if (companyDetailInfo.CompanyType == CompanyType.Platform) { ShowMessage("平台帐号不能开通OEM"); } else { distributionOEM.CompanyId = companyDetailInfo.CompanyId; DistributionOEMService.RegisterDistributionOEM(distributionOEM, companyDetailInfo.IsOem, companyDetailInfo.AbbreviateName); } } FlushRequester.TriggerOEMAdder(); RegisterScript("alert('添加/修改成功');window.location.href='DistributionOemAuthorizationList.aspx'", false); } } catch (Exception ex) { ShowExceptionMessage(ex, "添加/修改"); } }
protected void btnSave_Click(object sender, EventArgs e) { IncomeGroupDeductSetting set = new IncomeGroupDeductSetting(); set.IncomeGroupId = Guid.Parse(Request.QueryString["id"]); set.Price = int.Parse(txtPrice.Text == "" ? "0" : txtPrice.Text); set.Remark = txtRemark.Text; set.Type = radQujian.Checked ? PeriodType.Interval : PeriodType.Unite; string str = ""; foreach (ListItem item in chkAirlist.Items) { if (item.Selected) { if (str == "") { str += item.Value; } else { str += "/" + item.Value; } } } set.Airlines = str; set.Departure = txtDepartureAirports.AirportsCode.ToList().Join("/"); set.Id = string.IsNullOrEmpty(hidSettingId.Value)?Guid.NewGuid():Guid.Parse(hidSettingId.Value); if (radQujian.Checked) { var rangeList = this.hidRanges.Value.Split(','); var ranges = new List <IncomeGroupPeriod>(); foreach (var item in rangeList) { string[] range = item.Split('|'); IncomeGroupPeriod period = new IncomeGroupPeriod(); if (!string.IsNullOrWhiteSpace(range[0])) { period.StartPeriod = decimal.Parse(range[0]) / 100; } if (!string.IsNullOrWhiteSpace(range[1])) { period.EndPeriod = decimal.Parse(range[1]) / 100; } if (!string.IsNullOrWhiteSpace(range[2])) { period.Period = decimal.Parse(range[2]) / 100; } period.DeductId = set.Id; ranges.Add(period); } set.Period = ranges; } else { var ranges = new List <IncomeGroupPeriod>(); IncomeGroupPeriod period = new IncomeGroupPeriod(); period.StartPeriod = 0; period.EndPeriod = 1; period.Period = txtTongyi.Text == "" ? 0 : decimal.Parse(txtTongyi.Text) / 100; period.DeductId = set.Id; ranges.Add(period); set.Period = ranges; } var oem = OEMService.QueryOEM(CurrentCompany.CompanyId); try { IncomeGroupService.InsertIncomeGroupDeductSetting(set, CurrentUser.UserName); //刷新缓存 FlushRequester.TriggerOEMFlusher(oem.Id); } catch (Exception ex) { ShowExceptionMessage(ex, "设置扣点信息"); return; } RegisterScript("alert('设置扣点信息成功!');window.location.href='IncomeGroupList.aspx';", true); }