private void InitTDataValue(bool falg) { NormalPolicy normal = PolicyManageService.GetNormalPolicy(Guid.Parse(Request.QueryString["id"].ToString())); if (normal != null) { lblCreator.Text = "<a href='javascript:GoTo(\"" + normal.Owner + "\")' title='查看该供应商的公司基础信息'>" + normal.AbbreviateName + "</a>"; lblVoyage.Text = normal.VoyageType.GetDescription(); lblAirline.Text = normal.Airline; lblDepartureDate.Text = normal.DepartureDateStart.ToString("yyyy-MM-dd") + "至" + normal.DepartureDateEnd.ToString("yyyy-MM-dd"); lblDeparture.Text = normal.Departure; lblArrival.Text = normal.Arrival; lblDepartureFilght.Text = normal.DepartureFlightsFilterType == Common.Enums.LimitType.None ? "不限" : normal.DepartureFlightsFilterType == Common.Enums.LimitType.Include ? "适用:" + normal.DepartureFlightsFilter : normal.DepartureFlightsFilterType == Common.Enums.LimitType.Exclude ? "不适用:" + normal.DepartureFlightsFilter : ""; lblExceptAirlines.Text = normal.ExceptAirways; txtStartTime.Text = normal.DepartureDateStart.ToString("yyyy-MM-dd"); txtEndTime.Text = normal.DepartureDateEnd.ToString("yyyy-MM-dd"); hidTime.Value = normal.DepartureDateEnd.ToString("yyyy-MM-dd"); lblCommission.Text = (normal.ProfessionCommission * 100).TrimInvaidZero(); chkBunksList.DataSource = normal.Berths.Split(',').ToList(); chkBunksList.DataBind(); } grvTiedian.DataSource = from item in PolicySetService.QueryNormalPolicySetting(Guid.Parse(Request.QueryString["id"].ToString()), falg, null) orderby item.OperationTime descending select new { item.Berths, Commission = (item.Commission * 100).TrimInvaidZero() + "%", item.Creator, item.Enable, EndTime = item.EndTime.ToString("yyyy-MM-dd"), item.FlightsFilter, item.Id, item.OperationTime, item.PolicyId, item.Remark, StartTime = item.StartTime.ToString("yyyy-MM-dd"), item.Type }; grvTiedian.DataBind(); if (falg) { hidKoudianOrTiedian.Value = "2"; } else { hidKoudianOrTiedian.Value = "1"; } }
private void InitlblData() { NormalPolicy normal = PolicyManageService.GetNormalPolicy(Guid.Parse(Request.QueryString["id"].ToString())); if (normal != null) { if (normal.VoyageType == VoyageType.OneWay) { returnFilght.Style.Add(HtmlTextWriterStyle.Display, "none"); lblDepartureShowOrHide.Style.Add(HtmlTextWriterStyle.Display, "none"); } lblAirline.Text = normal.Airline; lblArrival.Text = normal.Arrival; lblVoyage.Text = normal.VoyageType.GetDescription(); lblOffice.Text = normal.OfficeCode; lblCutomerCode.Text = normal.CustomCode; lblExceptAirlines.Text = normal.ExceptAirways; lblExceptDay.Text = normal.DepartureDateFilter; lblDepartureWeekFilter.Text = PublicClass.StringOperation.TransferToChinese(normal.DepartureWeekFilter); lblTicket.Text = normal.TicketType.GetDescription(); lblDeparture.Text = normal.Departure; lblDepartureDate.Text = (normal.DepartureDateStart.ToString("yyyy-MM-dd")) + "至" + (normal.DepartureDateEnd.ToString("yyyy-MM-dd")); lblCreateTime.Text = normal.StartPrintDate.ToString("yyyy-MM-dd"); lblBunks.Text = normal.Berths; lblDepartureFilght.Text = normal.DepartureFlightsFilterType == LimitType.None ? "不限" : (normal.DepartureFlightsFilterType == LimitType.Include ? "适用:" + normal.DepartureFlightsFilter : "不适用:" + normal.DepartureFlightsFilter); lblXiaJi.Text = (normal.SubordinateCommission * 100).TrimInvaidZero() == "-1" ? "" : (normal.SubordinateCommission * 100).TrimInvaidZero() + "%"; if (normal.IsInternal) { lblNeiBu.Text = (normal.InternalCommission * 100).TrimInvaidZero() + "%"; } else { this.internalTitle.Visible = false; this.internalValue.Visible = false; } if (normal.IsPeer) { lblTongHang.Text = ((normal.ProfessionCommission) * 100).TrimInvaidZero() + "%"; } else { this.proffessionTitle.Visible = false; this.proffessionValue.Visible = false; } lblLock.Text = normal.Freezed ? "锁定" : "未锁定"; lblRemaek.Text = normal.Remark; lblChang.Text = normal.ChangePNR ? "需要" : "不需要"; lblPrintBeforeTwoHours.Text = normal.PrintBeforeTwoHours ? "可以" : "不可以"; lblDrawerCondition.Text = normal.DrawerCondition; if (normal.VoyageType == VoyageType.OneWayOrRound || normal.VoyageType == VoyageType.RoundTrip || normal.VoyageType == VoyageType.TransitWay) { this.lblRetnrnFilght.Text = normal.ReturnFlightsFilterType == LimitType.None ? "所有" : (normal.ReturnFlightsFilterType == LimitType.Include ? "适用以下航班:" + normal.ReturnFlightsFilter : "不适用以下航班:" + normal.ReturnFlightsFilter); lblSuitReduce.Text = normal.SuitReduce ? "适用" : "不适用"; } else { suitBerthTitle.Visible = false; suitBerthValue.Visible = false; } if (normal.VoyageType == VoyageType.TransitWay) { this.lblVoyageType.Text = "联程"; this.lblDepartureShowOrHide.Text = "第一程"; this.lblArrivalShowOrHide.Text = "第二程"; this.transit.Visible = true; this.lblTransit.Text = normal.Transit; lblMultiSuitReduce.Text = normal.MultiSuitReduce ? "适用" : "不适用"; } else { duoduanTitle.Visible = false; duoduanValue.Visible = false; } } else { ShowMessage("该政策已不存在"); } }
private bool GetNormalValue(string type) { VoyageType voyage = VoyageType.OneWay; if (titlePolicy.InnerText == "单程") { voyage = VoyageType.OneWay; } else if (titlePolicy.InnerText == "往返") { voyage = VoyageType.RoundTrip; } else if (titlePolicy.InnerText == "单程·往返") { voyage = VoyageType.OneWayOrRound; } else if (titlePolicy.InnerText == "中转联程") { voyage = VoyageType.TransitWay; } LimitType derpartrueFilghtType = LimitType.None; if (radYiXia.Checked) { derpartrueFilghtType = LimitType.Include; } if (radBuXian.Checked) { derpartrueFilghtType = LimitType.None; } if (radBuYiXia.Checked) { derpartrueFilghtType = LimitType.Exclude; } LimitType returnFilghtType = LimitType.None; if (radReturnYiXia.Checked) { returnFilghtType = LimitType.Include; } if (radReturnBuXian.Checked) { returnFilghtType = LimitType.None; } if (radReturnBuYiXia.Checked) { returnFilghtType = LimitType.Exclude; } string weekStr = ""; if (mon.Checked) { weekStr += "1,"; } if (tue.Checked) { weekStr += "2,"; } if (wed.Checked) { weekStr += "3,"; } if (thur.Checked) { weekStr += "4,"; } if (fri.Checked) { weekStr += "5,"; } if (sat.Checked) { weekStr += "6,"; } if (sun.Checked) { weekStr += "7,"; } if (weekStr != "") { weekStr = weekStr.Substring(0, weekStr.Length - 1); } var normals = PolicyManageService.GetNormalPolicy(Guid.Parse(Request.QueryString["Id"])); try { if (type == "Update") { var normal = new NormalPolicy { CustomCode = ddlCustomCode.Visible ? ddlCustomCode.SelectedValue.Trim() : lblCustomerCode.Text, Airline = lblAirline.Text, OfficeCode = hidOfficeNo.Value, Arrival = txtArrivalAirports.AirportsCode.ToList().Join("/"), AutoAudit = chkAuto.Checked, ChangePNR = chkChangePNR.Checked, IsInternal = neibuTh.Visible, IsPeer = tonghang.Visible, Departure = txtDepartureAirports.AirportsCode.ToList().Join("/"), Transit = "", DepartureDateEnd = DateTime.Parse(txtDepartrueEnd.Text), //DepartureDatesFilter = "", DepartureDateStart = DateTime.Parse(txtDepartrueStart.Text), //DepartureDatesFilterType = DateMode.Date, DepartureFlightsFilter = derpartrueFilghtType == LimitType.None ? "" : txtDepartrueFilght.Text, DepartureFlightsFilterType = derpartrueFilghtType, //ReturnDateStart = normals.ReturnDateStart, //ReturnDateEnd = normals.ReturnDateEnd, Remark = txtRemark.Text.Replace("\r", "").Replace("\n", ""), DrawerCondition = txtDrawerCondition.Text.Replace("\r", "").Replace("\n", ""), //ReturnDatesFilter = "", ReturnFlightsFilter = returnFilghtType == LimitType.None ? "" : txtReturnFilght.Text, ReturnFlightsFilterType = returnFilghtType, SuitReduce = chkRound.Checked, StartPrintDate = DateTime.Parse(txtProvideDate.Text), DepartureDateFilter = txtPaiChu.Text, DepartureWeekFilter = weekStr, SubordinateCommission = decimal.Parse(txtSubordinateCommission.Text) / 100, ProfessionCommission = decimal.Parse(txtProfessionCommission.Text) / 100, InternalCommission = decimal.Parse(txtInternalCommission.Text) / 100, MultiSuitReduce = chkddlc.Checked, //Vip = 0, ExceptAirways = txtExceptAirways.Text, //TravelDays = 0, TicketType = chkTicket.Text == "B2B" ? TicketType.B2B : TicketType.BSP, Berths = hidBunks.Value, VoyageType = voyage, //ReturnDatesFilterType = DateMode.Date, ImpowerOffice = Convert.ToBoolean(dropOffice.SelectedValue), Audited = normals.Audited, AuditTime = normals.AuditTime, AutoPrint = normals.AutoPrint, CreateTime = normals.CreateTime, Creator = normals.Creator, Freezed = normals.Freezed, Owner = normals.Owner, Suspended = normals.Suspended, PrintBeforeTwoHours = chkPrintBeforeTwoHours.Checked, Id = Guid.Parse(Request.QueryString["Id"]) }; if (zhongzhuanTh.Visible) { normal.Transit = txtArrivalAirports.AirportsCode.Join("/"); normal.Arrival = txtZhongzhuanAirports.AirportsCode.Join("/"); } if (normal.Departure.Trim() == "") { RegisterScript("alert('出发地不能为空,请选择至少一个城市作为出发地!');"); return(false); } if (normal.VoyageType == VoyageType.TransitWay && normal.Transit.Trim() == "") { RegisterScript("alert('中转地不能为空,请选择至少一个城市作为出发地!');"); return(false); } if (normal.Arrival.Trim() == "") { RegisterScript("alert('到达地不能为空,请选择至少一个城市作为出发地!');"); return(false); } PolicyManageService.UpdateNormalPolicy(normal, this.CurrentUser.UserName); } if (type == "Copy") { var normalInfo = new NormalPolicyReleaseInfo { BasicInfo = new NormalPolicyBasicInfo { CustomCode = ddlCustomCode.Visible ? ddlCustomCode.SelectedValue.Trim() : lblCustomerCode.Text, IsInternal = neibuTh.Visible, IsPeer = tonghang.Visible, Airline = ddlAirline.SelectedValue, Arrival = txtArrivalAirports.AirportsCode.ToList().Join("/"), Transit = "", Departure = txtDepartureAirports.AirportsCode.ToList().Join("/"), //DepartureDatesFilter = "", //DepartureDatesFilterType = DateMode.Date, DepartureFlightsFilter = derpartrueFilghtType == LimitType.None ? "" : txtDepartrueFilght.Text, DepartureFlightsFilterType = derpartrueFilghtType, Remark = txtRemark.Text.Replace("\r", "").Replace("\n", ""), DrawerCondition = txtDrawerCondition.Text.Replace("\r", "").Replace("\n", ""), //ReturnDatesFilter = "", ReturnFlightsFilter = returnFilghtType == LimitType.None ? "" : txtReturnFilght.Text, ReturnFlightsFilterType = returnFilghtType, ExceptAirways = txtExceptAirways.Text, //TravelDays = 0, VoyageType = voyage, //ReturnDatesFilterType = DateMode.Date, OfficeCode = hidOfficeNo.Value, ImpowerOffice = Convert.ToBoolean(dropOffice.SelectedValue), Owner = this.CurrentUser.Owner } }; if (zhongzhuanTh.Visible) { normalInfo.BasicInfo.Transit = txtArrivalAirports.AirportsCode.Join("/"); normalInfo.BasicInfo.Arrival = txtZhongzhuanAirports.AirportsCode.Join("/"); } var list = new List <NormalPolicyRebateInfo> { new NormalPolicyRebateInfo { DepartureDateFilter = txtPaiChu.Text, DepartureWeekFilter = weekStr, AutoAudit = chkAuto.Checked, ChangePNR = chkChangePNR.Checked, DepartureDateEnd = DateTime.Parse(txtDepartrueEnd.Text), DepartureDateStart = DateTime.Parse(txtDepartrueStart.Text), //ReturnDateStart = normals.ReturnDateStart, //ReturnDateEnd = normals.ReturnDateEnd, SuitReduce = chkRound.Checked, StartPrintDate = DateTime.Parse(txtProvideDate.Text), SubordinateCommission = decimal.Parse(txtSubordinateCommission.Text), ProfessionCommission = decimal.Parse(txtProfessionCommission.Text), InternalCommission = decimal.Parse(txtInternalCommission.Text), MultiSuitReduce = chkddlc.Checked, //Vip = 0, TicketType = chkTicket.Text == "B2B" ? TicketType.B2B : TicketType.BSP, Berths = hidBunks.Value, PrintBeforeTwoHours = chkPrintBeforeTwoHours.Checked } }; normalInfo.Rebates = list; if (normalInfo.BasicInfo.Departure.Trim() == "") { RegisterScript("alert('出发地不能为空,请选择至少一个城市作为出发地!');"); return(false); } if (normalInfo.BasicInfo.VoyageType == VoyageType.TransitWay && normalInfo.BasicInfo.Transit.Trim() == "") { RegisterScript("alert('中转地不能为空,请选择至少一个城市作为出发地!');"); return(false); } if (normalInfo.BasicInfo.Arrival.Trim() == "") { RegisterScript("alert('到达地不能为空,请选择至少一个城市作为出发地!');"); return(false); } PolicyManageService.ReleaseNormalPolicies(normalInfo, this.CurrentUser.UserName); } if (Request.QueryString["Check"] == "view") { RegisterScript( type == "Update" ? "alert('修改成功');window.location.href='./base_policy_view.aspx'" : "alert('复制成功');window.location.href='./base_policy_view.aspx'", true); } else { RegisterScript( type == "Update" ? "alert('修改成功');window.location.href='./base_policy_manage.aspx'" : "alert('复制成功');window.location.href='./base_policy_manage.aspx'", true); } } catch (Exception ex) { ShowExceptionMessage(ex, type == "Update" ? "修改普通政策" : "复制普通政策"); } return(true); }
protected void Page_Load(object sender, EventArgs e) { RegisterOEMSkins("form.css"); RegisterOEMSkins("page.css"); if (!IsPostBack) { SettingPolicy setting = CompanyService.GetPolicySetting(this.CurrentCompany.CompanyId); var company = CompanyService.GetCompanySettingsInfo(CurrentCompany.CompanyId); if (company != null && company.Parameter.CanHaveSubordinate) { neibuTh.Visible = true; neibufanyong.Visible = true; } else { neibuTh.Visible = false; neibufanyong.Visible = false; } cutomeTh.Visible = company != null && company.WorkingSetting != null && company.WorkingSetting.IsImpower; ddlCustomCode.Visible = company != null && company.WorkingSetting != null && company.WorkingSetting.IsImpower; if (setting == null) { RegisterScript("alert('还未有任何政策设置信息,不能访问本页面!');window.location.href='/Index.aspx';", true); return; } if (setting.Airlines == "") { RegisterScript("alert('还没有设置航空公司,请先设置航空公司!');window.location.href='/Index.aspx';", true); return; } //this.txtDepartureAirports.InitData(true, ChinaPay.B3B.Service.FoundationService.Airports.Where(item => setting.Departure.Split('/').Contains(item.Code.Value))); // this.txtArrivalAirports.InitData(true, FoundationService.Airports.Where(item => setting.Departure.Split('/').Contains(item.Code.Value))); bool allowBrotherPurchases = false; if (company != null) { allowBrotherPurchases = company.Parameter.AllowBrotherPurchase; } tonghangTh.Visible = allowBrotherPurchases; tonghang.Visible = allowBrotherPurchases; dropOffice.DataSource = CompanyService.QueryOfficeNumbers(this.CurrentCompany.CompanyId); dropOffice.DataTextField = "Number"; dropOffice.DataValueField = "Impower"; dropOffice.DataBind(); ddlCustomCode.DataSource = CompanyService.GetCustomNumberByEmployee(CurrentUser.Id); ddlCustomCode.DataTextField = "Number"; ddlCustomCode.DataValueField = "Number"; ddlCustomCode.DataBind(); if (Request.QueryString["Id"] != null && Request.QueryString["Type"] != null) { if (Request.QueryString["Type"].Trim() == "Update") { tip.InnerText = "修改普通政策"; chkAuto.Visible = false; btnCopy.Visible = false; btnModify.Visible = true; lblAirline.Visible = true; ddlAirline.Visible = false; } if (Request.QueryString["Type"].Trim() == "Copy") { tip.InnerText = "复制普通政策"; chkAuto.Visible = true; btnCopy.Visible = true; btnModify.Visible = false; lblAirline.Visible = false; ddlAirline.Visible = true; string[] strIds = setting.Airlines.Split('/'); ddlAirline.DataSource = from item in ChinaPay.B3B.Service.FoundationService.Airlines where item.Valid && strIds.Contains(item.Code.Value) select new { Code = item.Code, Name = item.Code + "-" + item.ShortName }; ddlAirline.DataTextField = "Name"; ddlAirline.DataValueField = "Code"; ddlAirline.DataBind(); } NormalPolicy normal = PolicyManageService.GetNormalPolicy(Guid.Parse(Request.QueryString["Id"])); InitDataValues(normal); } } }