/// <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> /// <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('添加成功')")); } } }