protected void PageInit() { IList <EnumObj> list = EnumObj.GetList(typeof(EyouSoft.Model.EnumType.TourStructure.RefundType)); if (list != null && list.Count > 0) { this.ddl_PayType.DataSource = list; this.ddl_PayType.DataTextField = "Text"; this.ddl_PayType.DataValueField = "Value"; this.ddl_PayType.DataBind(); } orderId = Utils.GetQueryStringValue("id"); if (!string.IsNullOrEmpty(orderId)) { EyouSoft.BLL.TourStructure.TourOrder TourOrderBll = new EyouSoft.BLL.TourStructure.TourOrder(); EyouSoft.Model.TourStructure.TourOrder TourOrderModel = TourOrderBll.GetOrderModel(CurrentUserCompanyID, orderId); if (TourOrderModel != null) { pepoleNum = TourOrderModel.AdultNumber.ToString(); pepoleNum2 = TourOrderModel.ChildNumber.ToString(); hidRouteName.Value = TourOrderModel.RouteName; hidOrderId.Value = TourOrderModel.ID; } EyouSoft.BLL.PlanStruture.PlaneTicket BLL = new EyouSoft.BLL.PlanStruture.PlaneTicket(); EyouSoft.Model.PlanStructure.TicketOutListInfo model = BLL.GetTicketOutInfoByOrderId(orderId); hidIsExtsisTicket.Value = model != null ? "1" : "0"; if (model != null) { piaomianjia = Utils.FilterEndOfTheZeroDecimal(model.TicketKindInfoList.FirstOrDefault().Price); shui = Utils.FilterEndOfTheZeroDecimal(model.TicketKindInfoList.FirstOrDefault().OilFee); pepoleNum = model.TicketKindInfoList.FirstOrDefault().PeopleCount.ToString(); DaiLiFei = Utils.FilterEndOfTheZeroDecimal(model.TicketKindInfoList.FirstOrDefault().AgencyPrice); Percent = Utils.FilterEndOfTheZeroDecimal(model.TicketKindInfoList.FirstOrDefault().Discount); OtherMoney = Utils.FilterEndOfTheZeroDecimal(model.TicketKindInfoList.FirstOrDefault().OtherPrice); piaokuan = Utils.FilterEndOfTheZeroDecimal(model.TicketKindInfoList.FirstOrDefault().TotalMoney); if (model.TicketKindInfoList.Count > 1) { piaomianjia2 = Utils.FilterEndOfTheZeroDecimal(model.TicketKindInfoList[1].Price); shui2 = Utils.FilterEndOfTheZeroDecimal(model.TicketKindInfoList[1].OilFee); pepoleNum2 = model.TicketKindInfoList[1].PeopleCount.ToString(); DaiLiFei2 = Utils.FilterEndOfTheZeroDecimal(model.TicketKindInfoList[1].AgencyPrice); Percent2 = Utils.FilterEndOfTheZeroDecimal(model.TicketKindInfoList[1].Discount); OtherMoney2 = Utils.FilterEndOfTheZeroDecimal(model.TicketKindInfoList[1].OtherPrice); piaokuan2 = Utils.FilterEndOfTheZeroDecimal(model.TicketKindInfoList[1].TotalMoney); } Total = Utils.FilterEndOfTheZeroDecimal(model.Total); PNR = model.PNR; ddl_PayType.SelectedIndex = (int)model.PayType; Remark = model.Remark; Notice = model.Notice; this.hideId.Value = model.TicketOutId; if ((int)model.State >= 2) { lbtn_submit.Visible = false; } } } }
protected void lbtnSave_Click1(object sender, EventArgs e) { #region 判断是否提交财务 EyouSoft.Model.TourStructure.TourBaseInfo m = new EyouSoft.BLL.TourStructure.Tour().GetTourInfo(Utils.GetQueryStringValue("tourid")); if (m != null) { if (!Utils.PlanIsUpdateOrDelete(m.Status.ToString())) { Response.Write("<script>alert('该团已提交财务,不能对它操作!');location.href=location.href;</script>"); return; } } #endregion string msg = ""; string id = Utils.GetQueryStringValue("id"); if (checkData(ref msg)) { EyouSoft.BLL.PlanStruture.PlaneTicket bll = new EyouSoft.BLL.PlanStruture.PlaneTicket(); EyouSoft.Model.PlanStructure.TicketOutListInfo model = new EyouSoft.Model.PlanStructure.TicketOutListInfo(); #region 航班,名单,票款 #region 航班 //航班列表长度 int ariLength = Utils.GetFormValues("txtAirTime").Length; //客户列表长度 int cusLength = Utils.GetFormValues("txtCusName").Length; System.Collections.Generic.IList <EyouSoft.Model.PlanStructure.TicketFlight> TicketFlightList = new System.Collections.Generic.List <EyouSoft.Model.PlanStructure.TicketFlight>(); for (int i = 0; i < ariLength; i++) { EyouSoft.Model.PlanStructure.TicketFlight cusModel = new EyouSoft.Model.PlanStructure.TicketFlight(); //航班日期 string txtAirTime = Utils.GetFormValues("txtAirTime")[i]; //航班线路 string selAirLine = Utils.GetFormValues("selAirLine")[i]; //航空公司 string selAirCompany = Utils.GetFormValues("SelAirCompany")[i]; //折扣 string txtZheKo = Utils.GetFormValues("txtZheKo")[i]; //航班日期 cusModel.DepartureTime = Utils.GetDateTime(txtAirTime); //航班线路 cusModel.FligthSegment = selAirLine; //航空公司 cusModel.AireLine = (EyouSoft.Model.EnumType.PlanStructure.FlightCompany)(Utils.GetInt(selAirCompany)); //折扣 cusModel.Discount = Utils.GetDecimal(txtZheKo); cusModel.TicketTime = Utils.GetFormValues("txt_hbh_date")[i]; //添加到航班列表 TicketFlightList.Add(cusModel); cusModel = null; } //航班列表 model.TicketFlightList = TicketFlightList; #endregion #region 单 System.Collections.Generic.IList <EyouSoft.Model.PlanStructure.TicketOutCustomerInfo> TicketOutCustomerInfoList = new System.Collections.Generic.List <EyouSoft.Model.PlanStructure.TicketOutCustomerInfo>(); for (int i = 0; i < cusLength; i++) { EyouSoft.Model.PlanStructure.TicketOutCustomerInfo cusModel = new EyouSoft.Model.PlanStructure.TicketOutCustomerInfo(); //是否勾选 string cusID = ""; try { cusID = Utils.GetFormValues("chkOper")[i]; } catch { continue; } //客户姓名 string txtCusName = Utils.GetFormValues("txtCusName")[i]; //客户证件类型 string selCardType = Utils.GetFormValues("SelCardType")[i]; //证件号码 string txtCardNumber = Utils.GetFormValues("txtCardNumber")[i]; cusModel.TicketOutId = id; cusModel.UserId = cusID; //添加至客户列表 TicketOutCustomerInfoList.Add(cusModel); cusModel = null; } //客户列表对应关系 model.TicketOutCustomerInfoList = TicketOutCustomerInfoList; #endregion #region 票款 System.Collections.Generic.IList <EyouSoft.Model.PlanStructure.TicketKindInfo> TicketKindInfoList = new System.Collections.Generic.List <EyouSoft.Model.PlanStructure.TicketKindInfo>(); EyouSoft.Model.PlanStructure.TicketKindInfo TicketKindInfoModel = new EyouSoft.Model.PlanStructure.TicketKindInfo(); //成人票面价 TicketKindInfoModel.Price = Utils.GetDecimal(this.txtAdultPrice.Value); //成人税/机建 TicketKindInfoModel.OilFee = Utils.GetDecimal(this.txtAdultShui.Value); //成人人数 TicketKindInfoModel.PeopleCount = Utils.GetInt(this.txtAdultCount.Value); //成人代理费 TicketKindInfoModel.AgencyPrice = Utils.GetDecimal(this.txtAdultProxyPrice.Value); //成人票款 TicketKindInfoModel.TotalMoney = Utils.GetDecimal(this.txtAdultSum.Value); //其它费用 TicketKindInfoModel.OtherPrice = Utils.GetDecimal(this.txt_OtherMoney.Value); //百分比 TicketKindInfoModel.Discount = Utils.GetDecimal(this.txt_Percent.Value, 100) / 100; //票款类型 TicketKindInfoModel.TicketType = EyouSoft.Model.EnumType.PlanStructure.KindType.成人; TicketKindInfoModel.TicketId = id; TicketKindInfoList.Add(TicketKindInfoModel); EyouSoft.Model.PlanStructure.TicketKindInfo TicketKindInfoModel1 = new EyouSoft.Model.PlanStructure.TicketKindInfo(); //儿童票面价 TicketKindInfoModel1.Price = Utils.GetDecimal(this.txtChildPrice.Value); //儿童税/机建 TicketKindInfoModel1.OilFee = Utils.GetDecimal(this.txtChildShui.Value); //儿童人数 TicketKindInfoModel1.PeopleCount = Utils.GetInt(this.txtChildCount.Value); //儿童代理费 TicketKindInfoModel1.AgencyPrice = Utils.GetDecimal(this.txtChildProxyPrice.Value); //儿童票款 TicketKindInfoModel1.TotalMoney = Utils.GetDecimal(this.txtChildSum.Value); //其它费用 TicketKindInfoModel1.OtherPrice = Utils.GetDecimal(this.txt_OtherMoneyChild.Value); //百分比 TicketKindInfoModel1.Discount = Utils.GetDecimal(this.txt_PercentChild.Value, 100) / 100; //票款类型 TicketKindInfoModel1.TicketType = EyouSoft.Model.EnumType.PlanStructure.KindType.儿童; TicketKindInfoModel1.TicketId = id; TicketKindInfoList.Add(TicketKindInfoModel1); TicketKindInfoModel1 = null; TicketKindInfoModel = null; model.TicketKindInfoList = TicketKindInfoList; #endregion #endregion #region 基本信息 //总费用 model.Total = EyouSoft.Common.Utils.GetDecimal(this.txtSumMoney.Value); //支付方式 model.PayType = (EyouSoft.Model.EnumType.TourStructure.RefundType)EyouSoft.Common.Utils.GetInt(Utils.GetFormValue("ddlPayType")); // model.OperateID = SiteUserInfo.ID; model.CompanyID = SiteUserInfo.CompanyID; model.Operator = SiteUserInfo.ContactInfo.ContactName; model.RefundId = id; //出票表ID model.TicketOutId = id; //订单ID model.OrderId = this.hdOrderID.Value; //团号ID model.TourId = this.hdTourID.Value; //订票须知 model.Notice = this.txtOrderPiaoMust.Value; //PNR model.PNR = this.txtPNR.Value; //售票处 model.TicketOffice = this.txtSalePlace.Value; model.TicketOfficeId = Utils.GetInt(this.hd_PiaoWuSuppId.Value); //票号 model.TicketNum = this.txtPiaoHao.Value; //备注 model.Remark = this.txtMemo.Value; //线路名称 model.RouteName = this.hd_LineName.Value; #endregion if (this.IsOk.Checked) { model.State = EyouSoft.Model.EnumType.PlanStructure.TicketState.已出票; if (bll.ToTicketOut(model)) { TicketFlightList = null; TicketKindInfoList = null; TicketOutCustomerInfoList = null; printSuccMsg("保存成功!"); } else { TicketFlightList = null; TicketKindInfoList = null; TicketOutCustomerInfoList = null; printFaiMsg("保存失败"); } } else { model.State = EyouSoft.Model.EnumType.PlanStructure.TicketState.审核通过; if (bll.UpdateTicketOutListModel(model)) { TicketFlightList = null; TicketKindInfoList = null; TicketOutCustomerInfoList = null; printSuccMsg("修改成功!"); } else { TicketFlightList = null; TicketKindInfoList = null; TicketOutCustomerInfoList = null; printFaiMsg("修改失败!"); } } model = null; } else { onInit(); printFaiMsg(msg); } }
/// <summary> /// 该游客是否可以申请 /// </summary> /// <param name="id"></param> /// <returns></returns> public string isHave(string id, List <int> ApplyFlights, List <int> RefundFlights) { EyouSoft.BLL.PlanStruture.PlaneTicket bll = new EyouSoft.BLL.PlanStruture.PlaneTicket(); string strvalue = ""; #region 原来的判断 if (CustomerList == null) { CustomerList = bll.CustomerList(Utils.GetQueryStringValue("tourId")); } if (CustomerList != null) { if (CustomerList.Contains(id)) { string iD = Utils.GetString(Request.QueryString["id"], ""); if (id != "" && modelinfo == null) { modelinfo = bll.GetTicketOutListModel(iD); } if (modelinfo != null) { if (modelinfo.CustomerInfoList.Where(x => x.ID == id).Count() > 0) { strvalue = "checked='true'"; } else { ////////判断是否可选 //strvalue = "disabled=\"disabled\""; #region 配置判断 if (TicketTraveller == EyouSoft.Model.EnumType.CompanyStructure.TicketTravellerCheckedType.None) { strvalue = ""; } else { int istuipiao = 0, enumtuipiao = 0;//1有退票,2全部退票,0没有退票 if (ApplyFlights != null) { if (RefundFlights != null) { foreach (var v in ApplyFlights) { var l = RefundFlights.Where(x => x == v); if (l.Count() > 0) { istuipiao++; } } } if (istuipiao > 0) { enumtuipiao = 1; } if (istuipiao == ApplyFlights.Count) { enumtuipiao = 2; } if (TicketTraveller == EyouSoft.Model.EnumType.CompanyStructure.TicketTravellerCheckedType.LeastOne) { if (enumtuipiao == 0) { strvalue += " disabled=\"disabled\""; } } if (TicketTraveller == EyouSoft.Model.EnumType.CompanyStructure.TicketTravellerCheckedType.All) { if (enumtuipiao != 2) { strvalue += " disabled=\"disabled\""; } } } } #endregion } } else { //strvalue = "disabled=\"disabled\""; #region 配置判断 if (TicketTraveller == EyouSoft.Model.EnumType.CompanyStructure.TicketTravellerCheckedType.None) { strvalue = ""; } else { int istuipiao = 0, enumtuipiao = 0;//1有退票,2全部退票,0没有退票 if (ApplyFlights != null) { if (RefundFlights != null) { foreach (var v in ApplyFlights) { var l = RefundFlights.Where(x => x == v); if (l.Count() > 0) { istuipiao++; } } } if (istuipiao > 0) { enumtuipiao = 1; } if (istuipiao == ApplyFlights.Count) { enumtuipiao = 2; } if (TicketTraveller == EyouSoft.Model.EnumType.CompanyStructure.TicketTravellerCheckedType.LeastOne) { if (enumtuipiao == 0) { strvalue += " disabled=\"disabled\""; } } if (TicketTraveller == EyouSoft.Model.EnumType.CompanyStructure.TicketTravellerCheckedType.All) { if (enumtuipiao != 2) { strvalue += " disabled=\"disabled\""; } } } } #endregion } } else { strvalue = ""; } } else { strvalue = ""; } #endregion if (id == Utils.GetQueryStringValue("cid")) { strvalue += " checked=\"true\""; } return(strvalue); }
private void onInit() { BindPayType(); //证件类型绑定 CusCardTypeBind(); //航空公司绑定 AirCompanyTypeBind(); string id = Utils.GetQueryStringValue("id"); if (id != "") { EyouSoft.BLL.PlanStruture.PlaneTicket bll = new EyouSoft.BLL.PlanStruture.PlaneTicket(); EyouSoft.Model.PlanStructure.TicketOutListInfo model = bll.GetTicketOutListModel(id); if (model != null) { #region 航班 if (model.TicketFlightList != null && model.TicketFlightList.Count > 0) { RepAirList.DataSource = model.TicketFlightList; RepAirList.DataBind(); } #endregion #region 单 this.hideTourId.Value = model.TourId; EyouSoft.BLL.TourStructure.TourOrder orderbll = new EyouSoft.BLL.TourStructure.TourOrder(SiteUserInfo); System.Collections.Generic.IList <EyouSoft.Model.TourStructure.TourOrderCustomer> cusromerList = orderbll.GetTravellers(model.TourId); if (cusromerList != null && cusromerList.Count > 0) { this.RepCusList.DataSource = cusromerList; this.RepCusList.DataBind(); } #endregion #region 票款 if (model.TicketKindInfoList != null && model.TicketKindInfoList.Count > 0) { foreach (EyouSoft.Model.PlanStructure.TicketKindInfo TicketKindInfo in model.TicketKindInfoList) { #region 成人 if (TicketKindInfo.TicketType == EyouSoft.Model.EnumType.PlanStructure.KindType.成人) { //票面价 this.txtAdultPrice.Value = EyouSoft.Common.Utils.FilterEndOfTheZeroString(EyouSoft.Common.Utils.GetDecimal(TicketKindInfo.Price.ToString()).ToString("0.00")); //税/机建 this.txtAdultShui.Value = EyouSoft.Common.Utils.FilterEndOfTheZeroString(EyouSoft.Common.Utils.GetDecimal(TicketKindInfo.OilFee.ToString()).ToString("0.00")); //人数 this.txtAdultCount.Value = TicketKindInfo.PeopleCount.ToString(); //代理费 this.txtAdultProxyPrice.Value = EyouSoft.Common.Utils.FilterEndOfTheZeroString(EyouSoft.Common.Utils.GetDecimal(TicketKindInfo.AgencyPrice.ToString()).ToString("0.00")); //百分比 this.txt_Percent.Value = EyouSoft.Common.Utils.FilterEndOfTheZeroString((TicketKindInfo.Discount).ToString("0.00")); //其它费用 this.txt_OtherMoney.Value = EyouSoft.Common.Utils.FilterEndOfTheZeroString(EyouSoft.Common.Utils.GetDecimal(TicketKindInfo.OtherPrice.ToString()).ToString("0.00")); //票款 this.txtAdultSum.Value = EyouSoft.Common.Utils.FilterEndOfTheZeroString(EyouSoft.Common.Utils.GetDecimal(TicketKindInfo.TotalMoney.ToString()).ToString("0.00")); } #endregion #region 儿童 if (TicketKindInfo.TicketType == EyouSoft.Model.EnumType.PlanStructure.KindType.儿童) { //票面价 this.txtChildPrice.Value = EyouSoft.Common.Utils.FilterEndOfTheZeroString(EyouSoft.Common.Utils.GetDecimal(TicketKindInfo.Price.ToString()).ToString("0.00")); //税/机建 this.txtChildShui.Value = EyouSoft.Common.Utils.FilterEndOfTheZeroString(EyouSoft.Common.Utils.GetDecimal(TicketKindInfo.OilFee.ToString()).ToString("0.00")); //人数 this.txtChildCount.Value = TicketKindInfo.PeopleCount.ToString(); //代理费 this.txtChildProxyPrice.Value = EyouSoft.Common.Utils.FilterEndOfTheZeroString(EyouSoft.Common.Utils.GetDecimal(TicketKindInfo.AgencyPrice.ToString()).ToString("0.00")); //百分比 this.txt_PercentChild.Value = EyouSoft.Common.Utils.FilterEndOfTheZeroString((TicketKindInfo.Discount).ToString("0.00")); //其它费用 this.txt_OtherMoneyChild.Value = EyouSoft.Common.Utils.FilterEndOfTheZeroString(EyouSoft.Common.Utils.GetDecimal(TicketKindInfo.OtherPrice.ToString()).ToString("0.00")); //票款 this.txtChildSum.Value = EyouSoft.Common.Utils.FilterEndOfTheZeroString(EyouSoft.Common.Utils.GetDecimal(TicketKindInfo.TotalMoney.ToString()).ToString("0.00")); } #endregion } } #endregion #region 基本信息 //总费用 this.txtSumMoney.Value = EyouSoft.Common.Utils.FilterEndOfTheZeroString(EyouSoft.Common.Utils.GetDecimal(model.Total.ToString()).ToString("0.00")); //支付方式 this.ddlPayType.SelectedValue = model.PayType.ToString(); //订票须知 this.txtOrderPiaoMust.Value = model.Notice; //PNR this.txtPNR.Value = model.PNR; //售票处 this.txtSalePlace.Value = model.TicketOffice; //供应商编号 this.hd_PiaoWuSuppId.Value = model.TicketOfficeId.ToString(); //票号 this.txtPiaoHao.Value = model.TicketNum; //备注 this.txtMemo.Value = model.Remark; //支付方式 if (model.PayType.ToString() != "0" && model.PayType.ToString() != "") { this.ddlPayType.Items.FindByText(model.PayType.ToString()).Selected = true; } //订单ID this.hdOrderID.Value = model.OrderId; //团号ID this.hdTourID.Value = model.TourId; //线路名称 this.hd_LineName.Value = model.RouteName; #endregion } bll = null; model = null; } }
/// <summary> /// 提交事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtn_submit_Click(object sender, EventArgs e) { // DateTime date = DateTime.Parse(txt_date.Value); // string leg = txt_Leg.Value; // string gotime = txt_gotime.Value; // string backLeg = txt_backLeg.Value; // string backTime = txt_backTime.Value; // string company = ddl_Com.SelectedValue; // string PNG = txt_PNG.Value; // decimal PiaoKuang = decimal.Parse(txt_PiaoKuang.Value); // decimal dailifei = decimal.Parse( txt_DaiLiFei.Value); // int pepoleNum = int.Parse( txt_Pepole.Value ); // decimal sumPrice = decimal.Parse(txt_SumPrice.Value); // string Order = txt_Order.Value; // for (int i = 0; i < Utils.GetFormValues("txt_code").Length; i++) // { // //do something... // } EyouSoft.Model.TourStructure.TourBaseInfo mb = new EyouSoft.BLL.TourStructure.Tour().GetTourInfo(Utils.GetQueryStringValue("tourid")); if (mb != null) { if (!Utils.PlanIsUpdateOrDelete(mb.Status.ToString())) { Response.Write("<script>alert('该团已提交财务,不能对它操作!');location.href=location.href;</script>"); return; } } UserInfo userInfo = null; bool _IsLogin = EyouSoft.Security.Membership.UserProvider.IsUserLogin(out userInfo); EyouSoft.BLL.PlanStruture.PlaneTicket bll = new EyouSoft.BLL.PlanStruture.PlaneTicket(); EyouSoft.Model.PlanStructure.TicketOutListInfo model = new EyouSoft.Model.PlanStructure.TicketOutListInfo(); if (this.hideId.Value != "") { model = bll.GetTicketOutListModel(this.hideId.Value); } if (model != null) { model.CompanyID = cur_companyId; model.Notice = Utils.GetFormValue("txt_Order"); model.OperateID = userInfo.ID; model.Operator = userInfo.ContactInfo.ContactName; model.PayType = (EyouSoft.Model.EnumType.TourStructure.RefundType)Utils.GetInt(Utils.GetFormValue("sel_paytype")); model.PNR = Utils.GetFormValue("txt_Pnr"); model.Remark = Utils.GetFormValue("textRemark"); model.State = EyouSoft.Model.EnumType.PlanStructure.TicketState.机票申请; model.TourId = this.hideTourId.Value; IList <EyouSoft.Model.PlanStructure.TicketFlight> ltf = new List <EyouSoft.Model.PlanStructure.TicketFlight>(); IList <EyouSoft.Model.PlanStructure.TicketKindInfo> ltki = new List <EyouSoft.Model.PlanStructure.TicketKindInfo>(); for (int i = 0; i < Utils.GetFormValues("txt_date").Length; i++) { EyouSoft.Model.PlanStructure.TicketFlight tf = new EyouSoft.Model.PlanStructure.TicketFlight(); tf.TicketTime = Utils.GetFormValues("txt_time")[i]; tf.AireLine = (EyouSoft.Model.EnumType.PlanStructure.FlightCompany)(Utils.GetInt(Utils.GetFormValues("sel_com")[i])); tf.DepartureTime = Utils.GetDateTime(Utils.GetFormValues("txt_date")[i]); tf.Discount = Utils.GetDecimal(Utils.GetFormValues("txt_Discount")[i]); tf.FligthSegment = Utils.GetFormValues("sel_Flight")[i]; ltf.Add(tf); } ////成人票款 EyouSoft.Model.PlanStructure.TicketKindInfo tki = new EyouSoft.Model.PlanStructure.TicketKindInfo(); tki.OilFee = Utils.GetDecimal(Utils.GetFormValue("txt_shui")); tki.PeopleCount = Utils.GetInt(Utils.GetFormValue("txt_pepoleNum")); tki.Price = Utils.GetDecimal(Utils.GetFormValue("txt_piaomianjia")); tki.TotalMoney = Utils.GetDecimal(Utils.GetFormValue("txt_piaokuan")); tki.TicketType = EyouSoft.Model.EnumType.PlanStructure.KindType.成人; if (config_Agency.HasValue && EyouSoft.Model.EnumType.CompanyStructure.AgencyFeeType.公式三 == config_Agency.Value) { tki.OtherPrice = Utils.GetDecimal(Utils.GetFormValue("txt_DaiLiFei")); tki.Discount = Utils.GetDecimal(Utils.GetFormValue("txt_Percent"), 100) / 100; tki.AgencyPrice = 0; } else { tki.OtherPrice = 0; tki.Discount = 1; tki.AgencyPrice = Utils.GetDecimal(Utils.GetFormValue("txt_DaiLiFei")); } ltki.Add(tki); ///////儿童票款 EyouSoft.Model.PlanStructure.TicketKindInfo tkirt = new EyouSoft.Model.PlanStructure.TicketKindInfo(); tkirt.AgencyPrice = Utils.GetDecimal(Utils.GetFormValue("txt_DaiLiFei2")); tkirt.OilFee = Utils.GetDecimal(Utils.GetFormValue("txt_shui2")); tkirt.PeopleCount = Utils.GetInt(Utils.GetFormValue("txt_pepoleNum2")); tkirt.Price = Utils.GetDecimal(Utils.GetFormValue("txt_piaomianjia2")); tkirt.TotalMoney = Utils.GetDecimal(Utils.GetFormValue("txt_piaokuan2")); tkirt.TicketType = EyouSoft.Model.EnumType.PlanStructure.KindType.儿童; tkirt.OtherPrice = Utils.GetDecimal(Utils.GetFormValue("txt_DaiLiFei2")); tkirt.Discount = Utils.GetDecimal(Utils.GetFormValue("txt_Percent2"), 100) / 100; ltki.Add(tkirt); //// model.Total = Utils.GetDecimal(Utils.GetFormValue("txt_SumPrice")); model.TicketKindInfoList = ltki; model.TicketFlightList = ltf; EyouSoft.BLL.RouteStructure.Route routbll = new EyouSoft.BLL.RouteStructure.Route(userInfo); EyouSoft.BLL.TourStructure.Tour tourbll = new EyouSoft.BLL.TourStructure.Tour(userInfo); model.RouteName = tourbll.GetTourInfo(Utils.GetQueryStringValue("tourId")).RouteName; IList <EyouSoft.Model.PlanStructure.TicketOutCustomerInfo> listorder = new List <EyouSoft.Model.PlanStructure.TicketOutCustomerInfo>(); if (Utils.GetFormValues("chk_md").Length == 0) { Utils.Show("请选择游客!"); return; } IList <EyouSoft.Model.TourStructure.TourOrderCustomer> listcus = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>(); //for (int i = 0; i < Utils.GetFormValues("chk_md").Length; i++) //{ // EyouSoft.Model.PlanStructure.TicketOutCustomerInfo m = new EyouSoft.Model.PlanStructure.TicketOutCustomerInfo(); // EyouSoft.Model.TourStructure.TourOrderCustomer c = new EyouSoft.Model.TourStructure.TourOrderCustomer(); // c.ID = Utils.GetFormValues("chk_md")[i]; // c.VisitorName = Utils.GetFormValues("txt_name")[i]; // c.CradType = (EyouSoft.Model.EnumType.TourStructure.CradType)Utils.GetInt(Utils.GetFormValues("sel_cred")[i]); // c.CradNumber = Utils.GetFormValues("txt_code")[i]; // m.UserId = Utils.GetFormValues("chk_md")[i]; // listorder.Add(m); // listcus.Add(c); //} for (int i = 0; i < Utils.GetFormValues("chk_md").Length; i++) { EyouSoft.Model.PlanStructure.TicketOutCustomerInfo m = new EyouSoft.Model.PlanStructure.TicketOutCustomerInfo(); EyouSoft.Model.TourStructure.TourOrderCustomer c = new EyouSoft.Model.TourStructure.TourOrderCustomer(); c.ID = Utils.GetFormValues("chk_md")[i]; for (int j = 0; j < Utils.GetFormValues("txt_name").Length; j++) { if (c.ID == Utils.GetFormValues("hd_uid")[j]) { c.VisitorName = Utils.GetFormValues("txt_name")[j]; c.CradType = (EyouSoft.Model.EnumType.TourStructure.CradType)Utils.GetInt(Utils.GetFormValues("sel_cred")[j]); c.CradNumber = Utils.GetFormValues("txt_code")[j]; break; } } m.UserId = Utils.GetFormValues("chk_md")[i]; listorder.Add(m); listcus.Add(c); } model.CustomerInfoList = listcus; model.TicketOutCustomerInfoList = listorder; //if (Utils.GetInt(Utils.GetQueryStringValue("type")) == 1) //{ // ///散拼计划机票计调 // model.TicketType = EyouSoft.Model.EnumType.PlanStructure.TicketType.订单申请机票; //} //else //{ ///团队计划机票计调 model.TicketType = EyouSoft.Model.EnumType.PlanStructure.TicketType.团队申请机票; //} //model.TicketOutId = "0"; model.RegisterOperatorId = userInfo.ID; //售票处 model.TicketOffice = this.txtSalePlace.Value; model.TicketOfficeId = Utils.GetInt(this.hd_PiaoWuSuppId.Value); if (this.hideId.Value != "") { //修改 model.TicketOutId = this.hideId.Value; if (bll.UpdateTicketOutListModel(model)) { Utils.ShowAndRedirect("修改成功!", Request.Url.ToString()); } else { Utils.ShowAndRedirect("修改失败!", Request.Url.ToString()); } } else { //添加 if (bll.addTicketOutListModel(model)) { Utils.ShowAndRedirect("添加成功!", Request.Url.ToString()); } else { Utils.ShowAndRedirect("添加失败!", Request.Url.ToString()); } } } }
/// <summary> /// 绑定信息 /// </summary> void BindInfo() { //EyouSoft.Model.PlanStructure.TicketOutListInfo model = bll.GetTicketOutListModel(Request.QueryString["id"]); //; EyouSoft.BLL.PlanStruture.PlaneTicket bll = new EyouSoft.BLL.PlanStruture.PlaneTicket(); UserInfo userInfo = null; bool _IsLogin = EyouSoft.Security.Membership.UserProvider.IsUserLogin(out userInfo); EyouSoft.BLL.TourStructure.TourOrder orderbll = new EyouSoft.BLL.TourStructure.TourOrder(userInfo); //string orderId = orderbll.GetOrderIdByTourId(Request.QueryString["tourId"]); if (Utils.GetQueryStringValue("tourId") != "") { string tourId = Utils.GetQueryStringValue("tourId"); this.hideTourId.Value = tourId; CustomerList = bll.CustomerList(Utils.GetQueryStringValue("tourId")); cusList = orderbll.GetTravellers(tourId);//.Where(x => x.CustomerStatus == EyouSoft.Model.EnumType.TourStructure.CustomerStatus.正常).ToList(); for (int i = cusList.Count - 1; i >= 0; i--) { if (!CustomerList.Contains(cusList[i].ID)) { if (cusList[i].CustomerStatus == EyouSoft.Model.EnumType.TourStructure.CustomerStatus.已退团) { cusList.RemoveAt(i); } } } rpt_list.DataSource = cusList; count = 10; rpt_list.DataBind(); } if (Utils.GetString(Request.QueryString["id"], "") != "") { this.hideId.Value = Utils.GetString(Request.QueryString["id"], ""); modelinfo = bll.GetTicketOutListModel(Request.QueryString["id"]); if (modelinfo != null) { rpt_hangbang.DataSource = modelinfo.TicketFlightList; rpt_hangbang.DataBind(); if (modelinfo.TicketKindInfoList != null) { piaomianjia = Utils.FilterEndOfTheZeroDecimal(modelinfo.TicketKindInfoList.FirstOrDefault().Price); shui = Utils.FilterEndOfTheZeroDecimal(modelinfo.TicketKindInfoList.FirstOrDefault().OilFee); pepoleNum = modelinfo.TicketKindInfoList.FirstOrDefault().PeopleCount.ToString(); DaiLiFei = Utils.FilterEndOfTheZeroDecimal(modelinfo.TicketKindInfoList.FirstOrDefault().AgencyPrice); piaokuan = Utils.FilterEndOfTheZeroDecimal(modelinfo.TicketKindInfoList.FirstOrDefault().TotalMoney); OtherMoney = Utils.FilterEndOfTheZeroDecimal(modelinfo.TicketKindInfoList.FirstOrDefault().OtherPrice); Percent = Utils.FilterEndOfTheZeroDecimal(modelinfo.TicketKindInfoList.FirstOrDefault().Discount * 100); if (modelinfo.TicketKindInfoList.Count > 1) { piaomianjia2 = Utils.FilterEndOfTheZeroDecimal(modelinfo.TicketKindInfoList[1].Price); shui2 = Utils.FilterEndOfTheZeroDecimal(modelinfo.TicketKindInfoList[1].OilFee); pepoleNum2 = modelinfo.TicketKindInfoList[1].PeopleCount.ToString(); DaiLiFei2 = Utils.FilterEndOfTheZeroDecimal(modelinfo.TicketKindInfoList[1].AgencyPrice); piaokuan2 = Utils.FilterEndOfTheZeroDecimal(modelinfo.TicketKindInfoList[1].TotalMoney); OtherMoney2 = Utils.FilterEndOfTheZeroDecimal(modelinfo.TicketKindInfoList[1].OtherPrice); Percent2 = Utils.FilterEndOfTheZeroDecimal(modelinfo.TicketKindInfoList[1].Discount * 100); } } Png = modelinfo.PNR; Total = Utils.FilterEndOfTheZeroDecimal(modelinfo.Total); paytype = modelinfo.PayType.ToString(); Notice = modelinfo.Notice; Remark = modelinfo.Remark; //售票处 this.txtSalePlace.Value = modelinfo.TicketOffice; this.hd_PiaoWuSuppId.Value = modelinfo.TicketOfficeId.ToString(); } } }
/// <summary> /// 提交事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtn_submit_Click(object sender, EventArgs e) { EyouSoft.Model.PlanStructure.TicketOutListInfo model = new EyouSoft.Model.PlanStructure.TicketOutListInfo(); model.TourId = Utils.GetQueryStringValue("tourId"); model.CompanyID = this.SiteUserInfo.CompanyID; model.OperateID = SiteUserInfo.ID; if (SiteUserInfo.ContactInfo != null) { model.Operator = SiteUserInfo.ContactInfo.ContactName; } model.OrderId = orderId; #region 成人儿童票款 IList <EyouSoft.Model.PlanStructure.TicketKindInfo> ltki = new List <EyouSoft.Model.PlanStructure.TicketKindInfo>(); ////成人票款 EyouSoft.Model.PlanStructure.TicketKindInfo tki = new EyouSoft.Model.PlanStructure.TicketKindInfo(); tki.OilFee = Utils.GetDecimal(Utils.GetFormValue("txt_shui")); tki.PeopleCount = Utils.GetInt(Utils.GetFormValue("txt_pepoleNum")); tki.Price = Utils.GetDecimal(Utils.GetFormValue("txt_piaomianjia")); tki.TotalMoney = Utils.GetDecimal(Utils.GetFormValue("txt_piaokuan")); tki.TicketType = EyouSoft.Model.EnumType.PlanStructure.KindType.成人; if (config_Agency.HasValue && EyouSoft.Model.EnumType.CompanyStructure.AgencyFeeType.公式三 == config_Agency.Value) { tki.OtherPrice = Utils.GetDecimal(Utils.GetFormValue("txt_DaiLiFei")); tki.Discount = Utils.GetDecimal(Utils.GetFormValue("txt_Percent"), 100) / 100; tki.AgencyPrice = 0; } else { tki.OtherPrice = 0; tki.Discount = 1; tki.AgencyPrice = Utils.GetDecimal(Utils.GetFormValue("txt_DaiLiFei")); } ltki.Add(tki); ///////儿童票款 EyouSoft.Model.PlanStructure.TicketKindInfo tkirt = new EyouSoft.Model.PlanStructure.TicketKindInfo(); tkirt.AgencyPrice = Utils.GetDecimal(Utils.GetFormValue("txt_DaiLiFei2")); tkirt.OilFee = Utils.GetDecimal(Utils.GetFormValue("txt_shui2")); tkirt.PeopleCount = Utils.GetInt(Utils.GetFormValue("txt_pepoleNum2")); tkirt.Price = Utils.GetDecimal(Utils.GetFormValue("txt_piaomianjia2")); tkirt.TotalMoney = Utils.GetDecimal(Utils.GetFormValue("txt_piaokuan2")); tkirt.TicketType = EyouSoft.Model.EnumType.PlanStructure.KindType.儿童; tkirt.OtherPrice = Utils.GetDecimal(Utils.GetFormValue("txt_DaiLiFei2")); tkirt.Discount = Utils.GetDecimal(Utils.GetFormValue("txt_Percent2"), 100) / 100; ltki.Add(tkirt); #endregion model.TicketKindInfoList = ltki; model.PNR = Utils.GetFormValue("txt_PNR"); model.Total = Utils.GetDecimal(Utils.GetFormValue("txt_SumPrice")); model.PayType = (EyouSoft.Model.EnumType.TourStructure.RefundType)Utils.GetInt(Utils.GetFormValue(ddl_PayType.UniqueID)); model.Notice = Utils.GetFormValue("txt_Order"); model.Remark = Utils.GetFormValue("txt_Remark"); model.RouteName = Utils.GetFormValue("hidRouteName"); model.OrderId = Utils.GetFormValue("hidOrderId"); model.CustomerInfoList = null; model.State = EyouSoft.Model.EnumType.PlanStructure.TicketState.机票申请; model.TicketType = EyouSoft.Model.EnumType.PlanStructure.TicketType.团队申请机票; model.RegisterOperatorId = SiteUserInfo.ID; model.TicketOutTime = DateTime.Now; EyouSoft.BLL.PlanStruture.PlaneTicket bll = new EyouSoft.BLL.PlanStruture.PlaneTicket(); if (Utils.GetFormValue("hidIsExtsisTicket") == "1") { //修改 model.TicketOutId = this.hideId.Value; if (bll.UpdateTicketOutListModel(model)) { EyouSoft.Common.Function.MessageBox.ResponseScript(this.Page, string.Format("alert('修改成功');window.parent.Boxy.getIframeDialog('{0}').hide();window.parent.location.reload();", Utils.GetQueryStringValue("iframeId"))); } else { EyouSoft.Common.Function.MessageBox.ResponseScript(this.Page, string.Format("alert('修改失败');")); } } else { //添加 if (bll.addTicketOutListModel(model)) { EyouSoft.Common.Function.MessageBox.ResponseScript(this.Page, string.Format("alert('添加成功');window.parent.Boxy.getIframeDialog('{0}').hide();window.parent.location.reload();", Utils.GetQueryStringValue("iframeId"))); } else { EyouSoft.Common.Function.MessageBox.ResponseScript(this.Page, string.Format("alert('添加成功')")); } } }
private void onInit() { BindPayType(); //证件类型绑定 CusCardTypeBind(); //航空公司绑定 AirCompanyTypeBind(); string id = Utils.GetQueryStringValue("id"); if (id != "") { EyouSoft.BLL.PlanStruture.PlaneTicket bll = new EyouSoft.BLL.PlanStruture.PlaneTicket(); EyouSoft.Model.PlanStructure.TicketOutListInfo model = bll.GetTicketOutListModel(id); if (model != null) { #region 航班 if (model.TicketFlightList != null && model.TicketFlightList.Count > 0) { RepAirList.DataSource = model.TicketFlightList; RepAirList.DataBind(); } #endregion #region 单 if (model.CustomerInfoList != null && model.CustomerInfoList.Count > 0) { this.RepCusList.DataSource = model.CustomerInfoList; this.RepCusList.DataBind(); } #endregion #region 票款 if (model.TicketKindInfoList != null && model.TicketKindInfoList.Count > 0) { foreach (EyouSoft.Model.PlanStructure.TicketKindInfo TicketKindInfo in model.TicketKindInfoList) { #region 成人 if (TicketKindInfo.TicketType == EyouSoft.Model.EnumType.PlanStructure.KindType.成人) { //票面价 this.txtAdultPrice.Value = FilterEndOfTheZeroDecimal(TicketKindInfo.Price); //税/机建 this.txtAdultShui.Value = FilterEndOfTheZeroDecimal(TicketKindInfo.OilFee); //人数 this.txtAdultCount.Value = TicketKindInfo.PeopleCount.ToString(); //代理费 this.txtAdultProxyPrice.Value = FilterEndOfTheZeroDecimal(TicketKindInfo.AgencyPrice); //票款 this.txtAdultSum.Value = FilterEndOfTheZeroDecimal(TicketKindInfo.TotalMoney); //百分比 txt_Percent.Value = FilterEndOfTheZeroDecimal(TicketKindInfo.Discount); txt_DaiLiFei.Value = FilterEndOfTheZeroDecimal(TicketKindInfo.OtherPrice); } #endregion #region 儿童 if (TicketKindInfo.TicketType == EyouSoft.Model.EnumType.PlanStructure.KindType.儿童) { //票面价 this.txtChildPrice.Value = FilterEndOfTheZeroDecimal(TicketKindInfo.Price); //税/机建 this.txtChildShui.Value = FilterEndOfTheZeroDecimal(TicketKindInfo.OilFee); //人数 this.txtChildCount.Value = TicketKindInfo.PeopleCount.ToString(); //代理费 this.txtChildProxyPrice.Value = FilterEndOfTheZeroDecimal(TicketKindInfo.AgencyPrice); //票款 this.txtChildSum.Value = FilterEndOfTheZeroDecimal(TicketKindInfo.TotalMoney); txt_Percent2.Value = FilterEndOfTheZeroDecimal(TicketKindInfo.Discount); txt_DaiLiFei2.Value = FilterEndOfTheZeroDecimal(TicketKindInfo.OtherPrice); } #endregion } } #endregion #region 基本信息 //总费用 this.txtSumMoney.Value = EyouSoft.Common.Utils.FilterEndOfTheZeroString(EyouSoft.Common.Utils.GetDecimal(model.TotalAmount.ToString()).ToString("0.00")); //支付方式 this.ddlPayType.SelectedValue = model.PayType.ToString(); //订票须知 this.txtOrderPiaoMust.Value = model.Notice; //PNR this.txtPNR.Value = model.PNR; //售票处 this.txtSalePlace.Value = model.TicketOffice; //票号 this.txtPiaoHao.Value = model.TicketNum; //备注 this.txtMemo.Value = model.Remark; if (model.PayType.ToString() != "0" && model.PayType.ToString() != "") { this.ddlPayType.Items.FindByText(model.PayType.ToString()).Selected = true; } //订单ID this.hdOrderID.Value = model.OrderId; //团号ID this.hdTourID.Value = model.TourId; #endregion } bll = null; model = null; } }