/// <summary> /// 获取游客实体集合 /// </summary> /// <returns></returns> private IList <EyouSoft.Model.TourStructure.TourOrderCustomer> TourOrderCustomer() { IList <EyouSoft.Model.TourStructure.TourOrderCustomer> lists = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>(); EyouSoft.Model.TourStructure.TourOrderCustomer model = null; int len = Utils.GetFormValues("VisitorName").Length; for (int i = 0; i < len; i++) { model = new EyouSoft.Model.TourStructure.TourOrderCustomer(); model.VisitorName = Utils.GetFormValues("VisitorName")[i]; int cType = (int)Utils.GetInt(Utils.GetFormValues("CradType")[i]); switch (cType) { case 0: model.CradType = EyouSoft.Model.TourStructure.CradType.请选择证件; break; case 1: model.CradType = EyouSoft.Model.TourStructure.CradType.身份证; break; case 2: model.CradType = EyouSoft.Model.TourStructure.CradType.户口本; break; case 3: model.CradType = EyouSoft.Model.TourStructure.CradType.军官证; break; case 4: model.CradType = EyouSoft.Model.TourStructure.CradType.护照; break; case 5: model.CradType = EyouSoft.Model.TourStructure.CradType.边境通行证; break; case 6: model.CradType = EyouSoft.Model.TourStructure.CradType.其他; break; } SeatList += Utils.GetFormValues("SeatNumber")[i] + ","; model.SiteNo = Utils.GetFormValues("SeatNumber")[i]; model.CradNumber = Utils.GetFormValues("CradNumber")[i]; model.ContactTel = Utils.GetFormValues("ContactTel")[i]; model.Sex = Utils.GetFormValues("Sex")[i] == "0" ? false : true; model.VisitorType = Utils.GetFormValues("VisitorType")[i] == "0" ? false : true; model.Remark = Utils.GetFormValues("Remark")[i]; lists.Add(model); model = null; } return(lists); }
/// <summary> /// 执行查询命令返回订单客户信息实体集合 /// </summary> /// <param name="dc">查询命令</param> /// <returns>订单客户信息实体集合</returns> private IList <EyouSoft.Model.TourStructure.TourOrderCustomer> GetQueryList(DbCommand dc) { IList <EyouSoft.Model.TourStructure.TourOrderCustomer> list = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>(); using (IDataReader dr = base.TourStore.ExecuteReader(dc)) { EyouSoft.Model.TourStructure.TourOrderCustomer model = null; while (dr.Read()) { model = new EyouSoft.Model.TourStructure.TourOrderCustomer(); model.ID = dr[0].ToString(); model.CompanyID = dr[1].ToString(); model.OrderID = dr[2].ToString(); model.VisitorName = dr[3].ToString(); if (!dr.IsDBNull(4)) { model.CradType = (Model.TourStructure.CradType)dr.GetByte(4); } model.CradNumber = dr[5].ToString(); if (!dr.IsDBNull(6)) { if (dr[6].ToString() == "0") { model.Sex = false; } else if (dr[6].ToString() == "1") { model.Sex = true; } } if (dr.IsDBNull(7) || dr[7].ToString() == "0") { model.VisitorType = false; } else { model.VisitorType = true; } model.ContactTel = dr[8].ToString(); model.Remark = dr[9].ToString(); if (!dr.IsDBNull(10)) { model.IssueTime = dr.GetDateTime(10); } model.SiteNo = dr[11].ToString(); list.Add(model); } model = null; } return(list); }
protected void LinkButton1_Click(object sender, EventArgs e) { LinkButton btn = sender as LinkButton; EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo); model = (EyouSoft.Model.TourStructure.TourInfo)bll.GetTourInfo(Request.QueryString["tourId"]); if (model != null) { if (!Utils.PlanIsUpdateOrDelete(model.Status.ToString())) { Response.Write("<script>alert('该团已提交财务,不能对它操作!');location.href=location.href;</script>"); return; } } //结算标准 string jsbj = Request.Form["radio"]; int cr_num = Utils.GetInt(txt_crNum.Value); int et_num = Utils.GetInt(txt_rtNum.Value); decimal sum_money = Utils.GetDecimal(txt_sumMoney.Value); string special = txt_Special.Value; //散拼信息 //EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(); //model = (EyouSoft.Model.TourStructure.TourInfo)bll.GetTourInfo(Request.QueryString["tourId"]); //model.PriceStandards EyouSoft.BLL.TourStructure.TourOrder orderbll = new EyouSoft.BLL.TourStructure.TourOrder(); EyouSoft.Model.TourStructure.TourOrder ordermodel = new EyouSoft.Model.TourStructure.TourOrder(); int crNum = Utils.GetInt(txt_crNum.Value); if (crNum == 0) { EyouSoft.Common.Function.MessageBox.Show(this.Page, "请填写成人数!"); BindXlInfo(); BindPireList(); return; } ordermodel.AdultNumber = crNum; ordermodel.AreaId = model.AreaId; int teamId = Utils.GetInt(Utils.GetFormValue("hd_teamId")); if (teamId == 0) { EyouSoft.Common.Function.MessageBox.Show(this.Page, "请选择组团社!"); BindXlInfo(); BindPireList(); return; //Response.Write("<script>alert('请选择组团社');location.href=location.href;</script>"); } ordermodel.BuyCompanyID = teamId; ordermodel.BuyCompanyName = Utils.GetFormValue("txt_teamName"); ordermodel.ChildNumber = Utils.GetInt(txt_rtNum.Value); ordermodel.ChildPrice = Utils.GetDecimal(Utils.GetFormValue("hd_rt_price")); int cusLevel = Utils.GetInt(Utils.GetFormValue("hd_cuslevel")); if (cusLevel == 0) { EyouSoft.Common.Function.MessageBox.Show(this.Page, "请选择客户等级!"); BindXlInfo(); BindPireList(); return; } ordermodel.CustomerLevId = cusLevel; IList <EyouSoft.Model.TourStructure.TourOrderCustomer> cus_list = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>(); string[] cus_arr = Utils.GetFormValues("txtVisitorName"); string[] uri = Utils.GetFormValues("tefu"); string[] cradType = Utils.GetFormValues("ddlCardType"); decimal orderprice = 0; for (int k = 0; k < cus_arr.Length; k++) { if (cus_arr[k] == "") { break; } EyouSoft.Model.TourStructure.TourOrderCustomer item = new EyouSoft.Model.TourStructure.TourOrderCustomer(); item.VisitorName = cus_arr[k]; item.VisitorType = Utils.GetFormValues("ddlVisitorType")[k] == "1" ? EyouSoft.Model.EnumType.TourStructure.VisitorType.成人 : EyouSoft.Model.EnumType.TourStructure.VisitorType.儿童; //switch (Utils.GetFormValues("ddlCardType")[k]) //{ // case "1": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.身份证; // } break; // case "2": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.护照; // } break; // case "3": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.军官证; // } break; // case "4": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.台胞证; // } break; // case "5": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.港澳通行证; // } break; // default: // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.未知; // } break; //} item.CradType = (EyouSoft.Model.EnumType.TourStructure.CradType)Utils.GetInt(cradType[k]); item.CradNumber = Utils.GetFormValues("txtCardNo")[k]; switch (Utils.GetFormValues("ddlSex")[k]) { case "2": { item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.男; } break; case "1": { item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.女; } break; default: { item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.未知; } break; } item.ContactTel = Utils.GetFormValues("txtContactTel")[k]; EyouSoft.Model.TourStructure.CustomerSpecialService css = new EyouSoft.Model.TourStructure.CustomerSpecialService(); css.Fee = Utils.GetDecimal(Utils.GetFromQueryStringByKey(uri[k], "txtCost")); css.IsAdd = Utils.GetFromQueryStringByKey(uri[k], "ddlOperate") == "0" ? true : false; css.IssueTime = DateTime.Now; css.ProjectName = Utils.GetFromQueryStringByKey(uri[k], "txtItem"); css.ServiceDetail = Utils.GetFromQueryStringByKey(uri[k], "txtServiceContent"); item.SpecialServiceInfo = css; item.IssueTime = DateTime.Now; item.CompanyID = CurrentUserCompanyID; cus_list.Add(item); orderprice += Utils.GetDecimal(Utils.GetFromQueryStringByKey(uri[k], "txtCost")); } ordermodel.IssueTime = DateTime.Now; ordermodel.OperatorContent = Utils.GetFormValue("txt_actMsg"); ordermodel.SpecialContent = Utils.GetFormValue("txt_Special"); ordermodel.CustomerList = cus_list; ordermodel.LastDate = DateTime.Now; ordermodel.LeaveDate = model.LDate; ordermodel.PriceStandId = Utils.GetInt(Utils.GetFormValue("hd_level")); ordermodel.PersonalPrice = Utils.GetDecimal(Utils.GetFormValue("hd_cr_price")); ordermodel.ChildPrice = Utils.GetDecimal(Utils.GetFormValue("hd_rt_price")); ordermodel.ID = Guid.NewGuid().ToString(); ordermodel.CustomerList = cus_list; ordermodel.TourId = model.TourId; ordermodel.OrderType = EyouSoft.Model.EnumType.TourStructure.OrderType.代客预定; ordermodel.SellCompanyId = CurrentUserCompanyID; ordermodel.SellCompanyName = SiteUserInfo.CompanyName; ordermodel.ViewOperatorId = SiteUserInfo.ID; ordermodel.TourNo = model.TourCode; ordermodel.Tourdays = model.TourDays; ordermodel.TourClassId = EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划; ordermodel.OperatorID = SiteUserInfo.ID; ordermodel.OperatorName = SiteUserInfo.ContactInfo.ContactName; ordermodel.OrderState = EyouSoft.Model.EnumType.TourStructure.OrderState.未处理; ordermodel.OtherPrice = orderprice; ordermodel.RouteId = model.RouteId; ordermodel.RouteName = model.RouteName; ordermodel.SumPrice = Utils.GetDecimal(Utils.GetFormValue(txt_sumMoney.UniqueID)) + orderprice; ordermodel.PeopleNumber = Utils.GetInt(Utils.GetFormValue("txt_crNum")) + Utils.GetInt(Utils.GetFormValue("txt_rtNum")); ordermodel.ContactTel = lt_phone.Text; ordermodel.ContactName = lb_username.Text; ordermodel.ContactMobile = lt_tel.Text; ordermodel.LeaveTraffic = lt_startBus.Text; ordermodel.ReturnTraffic = lt_backBus.Text; ordermodel.ContactFax = lt_fax.Text; EyouSoft.BLL.CompanyStructure.Customer csbll = new EyouSoft.BLL.CompanyStructure.Customer(); EyouSoft.Model.CompanyStructure.CustomerInfo cusmodel = csbll.GetCustomerModel(Utils.GetInt(Utils.GetFormValue("hd_teamId"))); // EyouSoft.Model.TourStructure.TourOrderAmountPlusInfo am = new EyouSoft.Model.TourStructure.TourOrderAmountPlusInfo(); am.AddAmount = Utils.GetDecimal(Utils.GetFormValue("txt_addmoney")); //增加费用 am.ReduceAmount = Utils.GetDecimal(Utils.GetFormValue("txt_minusmoney")); //减少费用 am.Remark = Utils.GetFormValue("txt_remark"); //备注 ordermodel.AmountPlus = am; if (cusmodel != null) { ordermodel.SalerId = cusmodel.SaleId; ordermodel.SalerName = cusmodel.Saler; } #region 返佣和对方操作员 ordermodel.BuyerContactId = Utils.GetInt(Utils.GetFormValue("otherOprator")); ordermodel.BuyerContactName = Utils.InputText(Utils.GetFormValue("hd_orderOprator")); ordermodel.CommissionType = (EyouSoft.Model.EnumType.CompanyStructure.CommissionType)Utils.GetInt(Utils.GetFormValue("hd_rebateType")); ordermodel.CommissionPrice = Utils.GetDecimal(Utils.GetFormValue("txt_Rebate")); #endregion switch (btn.CommandName) { ///提交 case "submit": { ordermodel.SaveSeatDate = DateTime.Now; ordermodel.OrderState = EyouSoft.Model.EnumType.TourStructure.OrderState.未处理; } break; case "Reservations": { ordermodel.OrderState = EyouSoft.Model.EnumType.TourStructure.OrderState.已留位; ordermodel.SaveSeatDate = Utils.GetDateTime(txtEndTime.Text, DateTime.Now); } break; //留位 } string fileAtt = ""; string oldfileAtt = ""; if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files[0], "VisitorInfoFile", out fileAtt, out oldfileAtt)) { ordermodel.CustomerFilePath = fileAtt; } else { EyouSoft.Common.Function.MessageBox.Show(this.Page, "上传附件失败!"); return; } ordermodel.BuyerTourCode = Utils.GetFormValue(txtBuyerTourCode.ClientID); ordermodel.OrderTrafficId = Utils.GetInt(Utils.GetFormValue("selectTraffic")); /// 0:失败; /// 1:成功; /// 2:该团队的订单总人数+当前订单人数大于团队计划人数总和; /// 3:该客户所欠金额大于最高欠款金额; int i = orderbll.AddOrder(ordermodel); switch (i) { case 1: { Response.Write("<script>alert('提交成功');parent.Boxy.getIframeDialog('" + Request.QueryString["iframeid"] + "').hide();parent.location.href=parent.location.href;</script>"); } break; case 2: { Response.Write("<script>alert('该团队的订单总人数+当前订单人数大于团队计划人数总和');location.href=location.href;</script>"); } break; case 3: { Response.Write("<script>alert('该客户所欠金额大于最高欠款金额');location.href=location.href;</script>"); } break; case 4: { Response.Write("<script>alert('订单人数加上交通出团日期当天已使用票数大于交通出团日期当天人数,添加失败!');location.href=location.href;</script>"); break; } default: { Response.Write("<script>alert('添加失败!');location.href=location.href;</script>"); } break; } }
protected void SaveOrder() { //团队所属公司ID string TourCompanyId = ""; //获得订单信息 tourModel = tourBll.GetTourInfo(tourId); string priceId = Utils.GetFormValue("ro_rdiPriceStandId");//获取选择的报价等级编号 EyouSoft.Model.TourStructure.TourOrder orderModel = new EyouSoft.Model.TourStructure.TourOrder(); orderModel.AdultNumber = Utils.GetInt(Utils.GetFormValue("ro_txtManCount"), 0); //获取成人数 orderModel.BuyCompanyID = SiteUserInfo.CompanyID; //预定单位 orderModel.BuyCompanyName = SiteUserInfo.CompanyName; //预定单位名 orderModel.ChildNumber = Utils.GetInt(Utils.GetFormValue("ro_txtChildCount"), 0); //儿童数 EyouSoft.Model.TourStructure.TourPriceDetail price = tourModel.TourPriceDetail.Where(i => i.PriceStandId == priceId).First(); //根据获取的报价等级编号获取相应报价等级 orderModel.ChildPrice = price.PriceDetail.Where(i => i.CustomerLevelType == EyouSoft.Model.CompanyStructure.CustomerLevelType.行).First().ChildrenPrice;//儿童价 TourCompanyId = tourModel.CompanyID; orderModel.CompanyID = TourCompanyId; orderModel.ContactFax = SiteUserInfo.ContactInfo.Fax; orderModel.ContactMQ = SiteUserInfo.ContactInfo.MQ; orderModel.ContactName = SiteUserInfo.ContactInfo.ContactName; orderModel.ContactQQ = SiteUserInfo.ContactInfo.QQ; orderModel.ContactTel = SiteUserInfo.ContactInfo.Tel; orderModel.LastOperatorID = SiteUserInfo.ID; //最后操作人 orderModel.MarketNumber = int.Parse(Utils.GetFormValue("ro_txtOneRoomCount")); //单房差数 orderModel.MarketPrice = price.PriceDetail.Where(i => i.CustomerLevelType == EyouSoft.Model.CompanyStructure.CustomerLevelType.单房差).First().AdultPrice; //单房差价 orderModel.OperatorContent = Utils.GetFormValue("ro_txtOperatorContent"); //操作留言 orderModel.OperatorID = SiteUserInfo.ID; //操作人ID orderModel.OperatorName = SiteUserInfo.ContactInfo.ContactName; //操作人名 orderModel.OrderType = 0; //预定类型 orderModel.OtherPrice = decimal.Parse(Utils.GetFormValue("ro_txtOtherPrice")); //其他费用 orderModel.PeopleNumber = orderModel.ChildNumber + orderModel.AdultNumber; //总人数 if (orderModel.PeopleNumber == 0) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "<script>;alert('请填写游客!');</script>"); } orderModel.AreaType = tourModel.AreaType; orderModel.AreaId = tourModel.AreaId; orderModel.PersonalPrice = price.PriceDetail.Where(i => i.CustomerLevelType == EyouSoft.Model.CompanyStructure.CustomerLevelType.行).First().AdultPrice; //成人价 orderModel.PriceStandId = priceId; //报价等级 orderModel.RouteName = tourModel.RouteName; orderModel.LeaveDate = tourModel.LeaveDate; //出发时间 orderModel.SpecialContent = Utils.GetFormValue("ro_txtSpecialContent"); //特别要求 orderModel.SumPrice = orderModel.AdultNumber * orderModel.PersonalPrice + orderModel.ChildNumber * orderModel.ChildPrice + orderModel.MarketNumber * orderModel.MarketPrice + orderModel.OtherPrice; //总金额 orderModel.TourCompanyId = tourModel.CompanyID; //专线编号 orderModel.TourCompanyName = tourModel.CompanyName; //专线公司名 orderModel.TourDays = tourModel.TourDays; //天数 orderModel.SaveSeatDate = DateTime.Now; //留位时间 orderModel.TourId = tourModel.ID; //团队编号 orderModel.TourNo = tourModel.TourNo; //团号 orderModel.TourType = EyouSoft.Model.TourStructure.TourType.组团团队; orderModel.IssueTime = DateTime.Now; //添加时间 orderModel.OrderSource = EyouSoft.Model.TourStructure.TourOrderOperateType.组团社下单; //订单来源 //获得游客信息 List <EyouSoft.Model.TourStructure.TourOrderCustomer> customerList = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>(); List <string> custNoList = Request.Form.AllKeys.Where(i => i.Contains("CustomerName")).Select(i => i.Substring(12, i.Length - 12)).ToList(); foreach (string customerNo in custNoList) { EyouSoft.Model.TourStructure.TourOrderCustomer customerModel = new EyouSoft.Model.TourStructure.TourOrderCustomer(); customerModel.CompanyID = SiteUserInfo.CompanyID; //所属公司 customerModel.CompanyName = SiteUserInfo.CompanyName; //所属公司名 customerModel.ContactTel = Utils.GetFormValue("CustomerTelphone" + customerNo); customerModel.CradNumber = Utils.GetFormValue("CertificateNo" + customerNo); //证件编号 customerModel.CradType = (EyouSoft.Model.TourStructure.CradType) int.Parse(Utils.GetFormValue("CertificateName" + customerNo)); //证件类型 customerModel.Remark = Utils.GetFormValue("CustomerRemark" + customerNo); //备注信息 customerModel.Sex = Utils.GetFormValue("CustomerSex" + customerNo) == "1"?true:false; //性别 customerModel.SiteNo = Utils.GetFormValue("CustomerSiteNo" + customerNo); //座位号 orderModel.SeatList += customerModel.SiteNo + ","; //座位号集 customerModel.VisitorName = Utils.GetFormValue("CustomerName" + customerNo); //姓名 customerModel.VisitorType = Utils.GetFormValue("CustomerType" + customerNo) == "1"?true:false; //类型(成人,儿童) customerModel.IssueTime = DateTime.Now; customerModel.RouteName = routeName; customerModel.TourId = tourId; //团队ID customerModel.TourNo = tourModel.TourNo; //团号 customerList.Add(customerModel); } orderModel.SeatList = orderModel.SeatList.TrimEnd(','); //获得座位号 orderModel.TourOrderCustomer = customerList; //保存游客信息 EyouSoft.IBLL.TourStructure.ITourOrder tourOrderBll = EyouSoft.BLL.TourStructure.TourOrder.CreateInstance(); //开始下订单 if (tourOrderBll.AddTourOrder(orderModel) > 0) { EyouSoft.Model.CompanyStructure.CompanyDetailInfo _companyInfo = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetModel(TourCompanyId); bool isSend = Utils.SendSMSForReminderOrder( TourCompanyId, SiteUserInfo.CompanyName, SiteUserInfo.ContactInfo.ContactName, _companyInfo != null ? _companyInfo.CityId : 0); if (isSend) { EyouSoft.Model.CompanyStructure.CompanyDetailInfo model = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetModel(TourCompanyId); //发送短信记录 EyouSoft.Model.ToolStructure.MsgTipRecord tipModel = new EyouSoft.Model.ToolStructure.MsgTipRecord(); tipModel.Email = string.Empty; tipModel.FromMQID = SiteUserInfo.ContactInfo.MQ; tipModel.ToMQID = model.ContactInfo.MQ; //接收方MQ tipModel.Mobile = model.ContactInfo.Mobile; //接收方手机 tipModel.MsgType = EyouSoft.Model.ToolStructure.MsgType.NewOrder; tipModel.SendWay = EyouSoft.Model.ToolStructure.MsgSendWay.SMS; EyouSoft.BLL.ToolStructure.MsgTipRecord msgTipBll = new EyouSoft.BLL.ToolStructure.MsgTipRecord(); msgTipBll.Add(tipModel); } Utils.SendEmailForReminderOrder(TourCompanyId, SiteUserInfo.CompanyName, SiteUserInfo.UserName); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "<script>;alert('预定成功!');if(window.parent.Boxy){window.parent.Boxy.getIframeDialog('" + Request.QueryString["iframeId"] + "').hide();if(window.parent.RouteStock){window.parent.RouteStock.refresh();};}else{window.close();}</script>"); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "<script>;alert('预定失败!');</script>"); } }
protected EyouSoft.Model.TourStructure.LineInquireQuoteInfo SaveInfo(int id) { EyouSoft.Model.TourStructure.LineInquireQuoteInfo lineInfo = new EyouSoft.Model.TourStructure.LineInquireQuoteInfo(); //预计出团日期 lineInfo.LeaveDate = Utils.GetDateTime(Utils.GetFormValue(this.txt_BegTime.UniqueID)); //总人数 lineInfo.PeopleNum = Utils.GetInt(Utils.GetFormValue(this.txt_peopleCount.UniqueID), 0); //状态 lineInfo.QuoteState = EyouSoft.Model.EnumType.TourStructure.QuoteState.已处理; //备注 lineInfo.Remark = Utils.GetFormValue(this.txt_remark.UniqueID); //客人要求集合 lineInfo.Requirements = ConProjectControl1.GetDataList(); //线路编号 lineInfo.RouteId = Utils.GetInt(xianluWindow1.Id); //线路名称 lineInfo.RouteName = xianluWindow1.Name; //价格组成集合 lineInfo.Services = PriceControl1.GetList; //总价 lineInfo.TotalAmount = PriceControl1.TotalAmount; //行程 lineInfo.XingCheng = new EyouSoft.Model.TourStructure.XingChengMust(); lineInfo.XingCheng.QuotePlan = Request.Form[this.txtRoutingNeed.UniqueID]; lineInfo.XingCheng.QuoteId = id; //行程_附件 string filepath = string.Empty; string oldfilename = string.Empty; bool file_result = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["routingFile"], "TourQuotePriceFile", out filepath, out oldfilename); if (filepath != "") { lineInfo.XingCheng.PlanAccessory = filepath; lineInfo.XingCheng.PlanAccessoryName = oldfilename; } else { if (hid_img_path.Value != "null") { lineInfo.XingCheng.PlanAccessory = hid_img_path.Value; lineInfo.XingCheng.PlanAccessoryName = hid_img_name.Value; } else { lineInfo.XingCheng.PlanAccessoryName = ""; lineInfo.XingCheng.PlanAccessory = ""; } } //机票折扣 lineInfo.TicketAgio = Utils.GetDecimal(Utils.GetFormValue(this.txt_agio.UniqueID)); //特殊要求 lineInfo.SpecialClaim = Utils.GetFormValue(this.txt_need.UniqueID); //编号 lineInfo.Id = id; //公司ID lineInfo.CompanyId = SiteUserInfo.CompanyID; //联系人姓名 lineInfo.ContactTel = Utils.GetFormValue(this.txt_contactTel.UniqueID); //联系人电话 lineInfo.ContactName = Utils.GetFormValue(this.txt_contactName.UniqueID); //询价单位编号 lineInfo.CustomerId = Utils.GetInt(this.hid_QuoteCompanyId.Value, 0); //询价单位名称 lineInfo.CustomerName = Utils.GetFormValue(this.txt_quoteCompany.UniqueID); ///////////////////////////////////////游客信息 int cusLength = Utils.GetFormValues("cusName").Length; lineInfo.Traveller = new EyouSoft.Model.TourStructure.TourEverydayApplyTravellerInfo(); lineInfo.Traveller.Travellers = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>(); for (int i = 0; i < cusLength; i++) { //游客id string cusID = Utils.GetFormValues("cusID")[i]; EyouSoft.Model.TourStructure.TourOrderCustomer toc = new EyouSoft.Model.TourStructure.TourOrderCustomer(); toc.VisitorName = Utils.GetFormValues("cusName")[i]; toc.VisitorType = (EyouSoft.Model.EnumType.TourStructure.VisitorType)(Utils.GetInt(Utils.GetFormValues("cusType")[i])); toc.CradType = (EyouSoft.Model.EnumType.TourStructure.CradType)(Utils.GetInt(Utils.GetFormValues("cusCardType")[i])); toc.CradNumber = Utils.GetFormValues("cusCardNo")[i]; //游客性别 int cusSex = Utils.GetInt(Utils.GetFormValues("cusSex")[i]); #region 性别 if (cusSex == 1) { toc.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.男; } else if (cusSex == 2) { toc.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.女; } else { toc.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.未知; } #endregion toc.ContactTel = Utils.GetFormValues("cusPhone")[i]; toc.IssueTime = DateTime.Now; EyouSoft.Model.TourStructure.CustomerSpecialService specModel = new EyouSoft.Model.TourStructure.CustomerSpecialService(); if (string.IsNullOrEmpty(cusID)) { toc.ID = System.Guid.NewGuid().ToString(); } else { toc.ID = cusID; } if (Utils.GetFormValues("cusState")[i] == "DEL") { toc.IsDelete = true; } else { toc.IsDelete = false; } //特服 string specive = Utils.GetFormValues("specive")[i]; if (!string.IsNullOrEmpty(specive)) { if (specive.LastIndexOf(',') + 1 == specive.Length) { specive = specive.Substring(0, specive.Length - 1); } specModel.CustormerId = toc.ID; specModel.ProjectName = Server.UrlDecode(Utils.GetFromQueryStringByKey(specive, "txtItem")); specModel.ServiceDetail = Server.UrlDecode(Utils.GetFromQueryStringByKey(specive, "txtServiceContent")); specModel.IsAdd = Utils.GetFromQueryStringByKey(specive, "ddlOperate") == "0" ? true : false; specModel.Fee = Utils.GetDecimal(Utils.GetFromQueryStringByKey(specive, "txtCost")); specModel.IssueTime = DateTime.Now; //特服项目名不能为空,否则不添加该条特服信息 if (!string.IsNullOrEmpty(specModel.ProjectName)) { toc.SpecialServiceInfo = specModel; } } lineInfo.Traveller.Travellers.Add(toc); } /// return(lineInfo); }
protected void LinkButton1_Click(object sender, EventArgs e) { //散客天天发申请 EyouSoft.Model.TourStructure.TourEverydayApplyInfo TourEverydayApplyInfo = new EyouSoft.Model.TourStructure.TourEverydayApplyInfo(); EyouSoft.BLL.TourStructure.TourEveryday tourbll = new EyouSoft.BLL.TourStructure.TourEveryday(); //散拼天天发业务逻辑和实体类 string TourId = Utils.GetQueryStringValue("tourId"); toureveryday = blltour.GetTourEverydayInfo(TourId); if (TourId != null && TourId != "") { if (toureveryday != null) { TourEverydayApplyInfo.CompanyId = toureveryday.CompanyId; } } TourEverydayApplyInfo.TourId = Utils.GetQueryStringValue("tourId"); TourEverydayApplyInfo.OperatorId = SiteUserInfo.ID; TourEverydayApplyInfo.AdultNumber = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue("TxtAdultPrice")); TourEverydayApplyInfo.ApplyCompanyId = SiteUserInfo.TourCompany.TourCompanyId; TourEverydayApplyInfo.ApplyId = SiteUserInfo.ID.ToString(); TourEverydayApplyInfo.ApplyTime = System.DateTime.Now; TourEverydayApplyInfo.ChildrenNumber = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue("TxtChildrenPrice")); TourEverydayApplyInfo.HandleStatus = EyouSoft.Model.EnumType.TourStructure.TourEverydayHandleStatus.未处理; TourEverydayApplyInfo.LDate = EyouSoft.Common.Utils.GetDateTime(EyouSoft.Common.Utils.GetFormValue("TxtSartTime")); TourEverydayApplyInfo.LevelId = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hd_LevelID.UniqueID)); TourEverydayApplyInfo.StandardId = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hd_PriceStandId.UniqueID)); TourEverydayApplyInfo.SpecialRequirement = EyouSoft.Common.Utils.GetFormValue("txt_Special"); #region TourEverydayApplyInfo.Traveller = new EyouSoft.Model.TourStructure.TourEverydayApplyTravellerInfo(); TourEverydayApplyInfo.Traveller.TravellerDisplayType = EyouSoft.Model.EnumType.TourStructure.CustomerDisplayType.附件方式; #region 游客附件信息 EyouSoft.Model.TourStructure.TourAttachInfo Attachinfo = new EyouSoft.Model.TourStructure.TourAttachInfo(); string fileAtt = string.Empty; string oldfileAtt = string.Empty; string VisitorInfoFile = "/uploadFiles/zutuanFile/"; if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["fuiLoadAttachment"], VisitorInfoFile, out fileAtt, out oldfileAtt)) { if (fileAtt.Trim() != "" && oldfileAtt.Trim() != "") { TourEverydayApplyInfo.Traveller.TravellerFilePath = fileAtt; } } else { EyouSoft.Common.Function.MessageBox.Show(this.Page, "上传附件失败!"); return; } #endregion TourEverydayApplyInfo.Traveller.Travellers = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>(); //获取所有的游客姓名 string[] cus_arr = Utils.GetFormValues("txtVisitorName"); //获取特服信息 string[] uri = Utils.GetFormValues("tefu"); string[] cardType = Utils.GetFormValues("ddlCardType"); decimal orderprice = 0; for (int k = 0; k < cus_arr.Length; k++) { if (Utils.GetFormValues("txtVisitorName")[k] == "") { break; } //订单游客信息实体 EyouSoft.Model.TourStructure.TourOrderCustomer item = new EyouSoft.Model.TourStructure.TourOrderCustomer(); item.VisitorName = Utils.GetFormValues("txtVisitorName")[k]; //游客类型 item.VisitorType = Utils.GetFormValues("ddlVisitorType")[k] == "1" ? EyouSoft.Model.EnumType.TourStructure.VisitorType.成人 : EyouSoft.Model.EnumType.TourStructure.VisitorType.儿童; #region 游客证件类型 //switch (Utils.GetFormValues("ddlCardType")[k]) //{ // case "1": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.身份证; // } break; // case "2": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.护照; // } break; // case "3": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.军官证; // } break; // case "4": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.台胞证; // } break; // case "5": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.港澳通行证; // } break; // default: // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.未知; // } break; //} #endregion item.CradType = (EyouSoft.Model.EnumType.TourStructure.CradType)Utils.GetInt(cardType[k]); //游客证件号码 item.CradNumber = Utils.GetFormValues("txtCardNo")[k]; #region 游客性别 switch (Utils.GetFormValues("ddlSex")[k]) { case "2": { item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.男; } break; case "1": { item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.女; } break; default: { item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.未知; } break; } #endregion //游客联系电话 item.ContactTel = Utils.GetFormValues("txtContactTel")[k]; //游客特服信息实体类 EyouSoft.Model.TourStructure.CustomerSpecialService css = new EyouSoft.Model.TourStructure.CustomerSpecialService(); //特服费用 css.Fee = Utils.GetDecimal(Utils.GetFromQueryStringByKey(uri[k], "txtCost")); //增加费用还是减少费用 css.IsAdd = Utils.GetFromQueryStringByKey(uri[k], "ddlOperate") == "0" ? true : false; css.IssueTime = DateTime.Now; //项目 css.ProjectName = Utils.GetFromQueryStringByKey(uri[k], "txtItem"); //服务内容 css.ServiceDetail = Utils.GetFromQueryStringByKey(uri[k], "txtServiceContent"); //游客特服信息 item.SpecialServiceInfo = css; item.IssueTime = DateTime.Now; item.CompanyID = SiteUserInfo.CompanyID; //游客所有的信息添加到订单 TourEverydayApplyInfo.Traveller.Travellers.Add(item); orderprice += Utils.GetDecimal(Utils.GetFromQueryStringByKey(uri[k], "txtCost")); } #endregion int result = tourbll.ApplyTourEveryday(TourEverydayApplyInfo); if (result > 0) { Response.Write("<script>alert('提交成功');parent.Boxy.getIframeDialog('" + Request.QueryString["iframeid"] + "').hide()</script>"); } else { Response.Write("<script>alert('提交失败!');location.href=location.href;</script>"); } }
/// <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()); } } } }
//确认提交 protected void lbtnSubmit_Click(object sender, EventArgs e) { string msg = ""; EyouSoft.BLL.TourStructure.TourOrder TourOrderBll = new EyouSoft.BLL.TourStructure.TourOrder(); EyouSoft.Model.TourStructure.TourOrder TourOrderModel = new EyouSoft.Model.TourStructure.TourOrder(); System.Collections.Generic.IList <EyouSoft.Model.TourStructure.TourOrderCustomer> curList = new System.Collections.Generic.List <EyouSoft.Model.TourStructure.TourOrderCustomer>(); if (checkData(ref msg)) { int cusLength = Utils.GetFormValues("cusName").Length; for (int i = 0; i < cusLength; i++) { //游客id string cusID = Utils.GetFormValues("cusID")[i]; //游客姓名 string cusName = Utils.GetFormValues("cusName")[i]; if (cusName == "") { continue; } //游客证件名称 int cusCardType = Utils.GetInt(Utils.GetFormValues("cusCardType")[i]); //游客证件号码 string cusCardNo = Utils.GetFormValues("cusCardNo")[i]; //游客性别 int cusSex = Utils.GetInt(Utils.GetFormValues("cusSex")[i]); //游客联系电话 string cusPhone = Utils.GetFormValues("cusPhone")[i]; //游客类型 int cusType = Utils.GetInt(Utils.GetFormValues("cusType")[i]); EyouSoft.Model.TourStructure.TourOrderCustomer cusModel = new EyouSoft.Model.TourStructure.TourOrderCustomer(); EyouSoft.Model.TourStructure.CustomerSpecialService specModel = new EyouSoft.Model.TourStructure.CustomerSpecialService(); if (string.IsNullOrEmpty(cusID)) { cusModel.ID = System.Guid.NewGuid().ToString(); } else { cusModel.ID = cusID; } cusModel.OrderId = OrderID; cusModel.CompanyID = this.SiteUserInfo.CompanyID; //特服 string specive = Utils.GetFormValues("specive")[i]; if (!string.IsNullOrEmpty(specive)) { if (specive.LastIndexOf(',') + 1 == specive.Length) { specive = specive.Substring(0, specive.Length - 1); } specModel.CustormerId = cusModel.ID; specModel.ProjectName = Utils.GetFromQueryStringByKey(specive, "txtItem"); specModel.ServiceDetail = Utils.GetFromQueryStringByKey(specive, "txtServiceContent"); specModel.IsAdd = Utils.GetFromQueryStringByKey(specive, "ddlOperate") == "1" ? true : false; specModel.Fee = Utils.GetDecimal(Utils.GetFromQueryStringByKey(specive, "txtCost")); //特服项目名不能为空,否则不添加该条特服信息 if (!string.IsNullOrEmpty(specModel.ProjectName)) { cusModel.SpecialServiceInfo = specModel; } } //添加到游客列表 cusModel.VisitorName = cusName; if (Utils.GetFormValues("cusState")[i] == "DEL") { cusModel.IsDelete = true; } else { cusModel.IsDelete = false; } #region 游客证件类型 cusModel.CradType = (EyouSoft.Model.EnumType.TourStructure.CradType)cusCardType; #endregion cusModel.CradNumber = cusCardNo; cusModel.ContactTel = cusPhone; #region 游客类型 if (cusType == 1) { cusModel.VisitorType = EyouSoft.Model.EnumType.TourStructure.VisitorType.成人; //doultCount++; } //儿童 else if (cusType == 2) { cusModel.VisitorType = EyouSoft.Model.EnumType.TourStructure.VisitorType.儿童; //childCount++; } //其它 else { //cusModel.VisitorType = EyouSoft.Model.EnumType.TourStructure.VisitorType.未知; printFaiMsg("请选择游客类型"); Response.End(); } #endregion #region 性别 if (cusSex == 1) { cusModel.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.男; } else if (cusSex == 2) { cusModel.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.女; } else { cusModel.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.未知; } #endregion //添加到游客列表中 curList.Add(cusModel); } //特殊要求说明 string specialRe = this.txtSpecialRe.Text; //操作留言 string operMes = this.txtOperMes.Text; //总金额 decimal totalMoney = Utils.GetDecimal(this.txtTotalMoney.Text); //报价标准编号 PriceStandId = Utils.GetFormValue("hd_PriceStandId"); //客户等级编号 CustomerLevId = Utils.GetFormValue("hd_LevelID"); //成人价 decimal adultP = Utils.GetDecimal(Utils.GetFormValue("hd_cr_price")); //儿童价 decimal childP = Utils.GetDecimal(Utils.GetFormValue("hd_rt_price")); TourOrderModel.ID = OrderID; TourOrderModel.TourId = this.TourID.Value; TourOrderModel.SellCompanyId = this.SiteUserInfo.CompanyID; TourOrderModel.ContactName = this.txtContactName.Text; TourOrderModel.ContactTel = this.txtContactPhone.Text; TourOrderModel.ContactMobile = this.txtContactMobile.Text; TourOrderModel.ContactFax = this.txtContactFax.Text; TourOrderModel.SaveSeatDate = DateTime.Now; TourOrderModel.LastDate = DateTime.Now; TourOrderModel.SpecialContent = specialRe; TourOrderModel.OperatorContent = operMes; TourOrderModel.SumPrice = totalMoney; TourOrderModel.ChildNumber = Utils.GetInt(this.txtChildCount.Text); TourOrderModel.AdultNumber = Utils.GetInt(this.txtDdultCount.Text); TourOrderModel.PeopleNumber = TourOrderModel.ChildNumber + TourOrderModel.AdultNumber; TourOrderModel.PersonalPrice = adultP; TourOrderModel.ChildPrice = childP; TourOrderModel.BuyCompanyID = Utils.GetInt(this.hd_BuyCompanyId.Value); TourOrderModel.PriceStandId = Utils.GetInt(PriceStandId); TourOrderModel.CustomerLevId = Utils.GetInt(CustomerLevId); TourOrderModel.OrderState = EyouSoft.Model.EnumType.TourStructure.OrderState.未处理; TourOrderModel.RouteId = Utils.GetInt(this.hd_lineID.Value); TourOrderModel.CustomerFilePath = uploadFile(); //是否组团端报名 TourOrderModel.IsTourOrderEdit = true; TourOrderModel.CustomerDisplayType = String.IsNullOrEmpty(TourOrderModel.CustomerFilePath) ? EyouSoft.Model.EnumType.TourStructure.CustomerDisplayType.输入方式 : EyouSoft.Model.EnumType.TourStructure.CustomerDisplayType.附件方式; TourOrderModel.CustomerList = curList; TourOrderModel.BuyCompanyName = SiteUserInfo.TourCompany.CompanyName; switch (TourOrderBll.Update(TourOrderModel)) { case 0: { TourOrderModel = null; curList = null; printFaiMsg("修改失败"); break; } case 1: { TourOrderModel = null; curList = null; printSuccMsg("修改成功"); break; } case 2: { TourOrderModel = null; curList = null; printFaiMsg("该团队的订单总人数+当前订单人数大于团队计划人数总和"); break; } case 3: { TourOrderModel = null; curList = null; printFaiMsg("该客户所欠金额大于最高欠款金额"); break; } } } else { printFaiMsg(msg); } TourOrderModel = null; curList = null; onInit(); }
/// <summary> /// 获取游客信息 /// </summary> /// <param name="PageSize">每页条数</param> /// <param name="PageIndex">当前页数</param> /// <param name="RecordCount">总记录数</param> /// <param name="OrderIndex">排序索引</param> /// <param name="BuyCompanyID">零售商公司ID(买家)(为null不作条件)</param> /// <param name="SellCompanyName">专线商公司名称(卖家)(为null不作条件)</param> /// <param name="CustomerName">游客姓名(为null不作条件)</param> /// <param name="Sex">游客性别(为null不作条件)</param> /// <param name="StartTime">下单开始时间(订单的IssueTime)(为null不作条件)</param> /// <param name="EndTime">下单结束时间(订单的IssueTime)(为null不作条件)</param> /// <param name="OrderStates">订单状态</param> /// <returns>返回实体集合</returns> public virtual IList <EyouSoft.Model.TourStructure.TourOrderCustomer> GetCustomerList(int PageSize, int PageIndex, ref int RecordCount , int OrderIndex, string BuyCompanyID, string SellCompanyName, string CustomerName, bool?Sex, DateTime?StartTime , DateTime?EndTime, params EyouSoft.Model.TourStructure.OrderState[] OrderStates) { Dictionary <string, string> RouteAndTour = new Dictionary <string, string>(); IList <EyouSoft.Model.TourStructure.TourOrderCustomer> list = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>(); #region Sql拼接 string strWhere = " 1 = 1 "; string strFiles = " ID,CompanyID,OrderID,VisitorName,CradType,CradNumber,Sex,VisitorType,ContactTel,Remark,IssueTime,SiteNo"; strFiles += ",(select TourId,RouteName,TourNo,TourCompanyName from tbl_TourOrder where tbl_TourOrder.ID = tbl_TourOrderCustomer.OrderID for xml auto,root('root')) as RouteAndTour "; //子查询拼接 StringBuilder strSubWhere = new StringBuilder(" IsDelete = '0' "); if (!string.IsNullOrEmpty(BuyCompanyID)) { strSubWhere.AppendFormat(" and tbl_TourOrder.BuyCompanyID = '{0}' ", BuyCompanyID); } if (!string.IsNullOrEmpty(SellCompanyName)) { strSubWhere.AppendFormat(" and tbl_TourOrder.TourCompanyName like '%{0}%' ", SellCompanyName); } if (StartTime != null) { strSubWhere.AppendFormat(" and datediff(dd,'{0}',tbl_TourOrder.IssueTime) >= 0 ", StartTime); } if (EndTime != null) { strSubWhere.AppendFormat(" and datediff(dd,'{0}',tbl_TourOrder.IssueTime) <= 0 ", EndTime); } if (OrderStates != null && OrderStates.Length > 0) { if (OrderStates.Length == 1) { strSubWhere.AppendFormat(" and tbl_TourOrder.OrderState = {0} ", (int)OrderStates[0]); } else { string strTmp = " and tbl_TourOrder.OrderState in ("; foreach (EyouSoft.Model.TourStructure.OrderState tmp in OrderStates) { strTmp += string.Format("{0},", (int)tmp); } strTmp = strTmp.TrimEnd(); strSubWhere.Append(strTmp); } } //追缴子查询条件 if (!string.IsNullOrEmpty(strSubWhere.ToString())) { strWhere += string.Format(" and OrderID in (select ID from tbl_TourOrder where {0} ) ", strSubWhere.ToString()); } if (!string.IsNullOrEmpty(CustomerName)) { strWhere += string.Format(" and VisitorName like '%{0}%' ", CustomerName); } if (Sex != null) { strWhere += string.Format(" and Sex = '{0}' ", (bool)Sex ? 1 : 0); } string strOrder = string.Empty; switch (OrderIndex) { case 0: strOrder = " [IssueTime] asc "; break; case 1: strOrder = " [IssueTime] desc "; break; default: strOrder = " [IssueTime] desc "; break; } #endregion #region 实体赋值 using (IDataReader dr = DbHelper.ExecuteReader(base.TourStore, PageSize, PageIndex, ref RecordCount, "tbl_TourOrderCustomer", "ID", strFiles, strWhere, strOrder)) { EyouSoft.Model.TourStructure.TourOrderCustomer model = null; while (dr.Read()) { model = new EyouSoft.Model.TourStructure.TourOrderCustomer(); model.ID = dr[0].ToString(); model.CompanyID = dr[1].ToString(); model.OrderID = dr[2].ToString(); model.VisitorName = dr[3].ToString(); if (!dr.IsDBNull(4)) { model.CradType = (Model.TourStructure.CradType)dr.GetByte(4); } model.CradNumber = dr[5].ToString(); if (!dr.IsDBNull(6)) { if (dr[6].ToString() == "0") { model.Sex = false; } else if (dr[6].ToString() == "1") { model.Sex = true; } } if (dr.IsDBNull(7) || dr[7].ToString() == "0") { model.VisitorType = false; } else { model.VisitorType = true; } model.ContactTel = dr[8].ToString(); model.Remark = dr[9].ToString(); if (!dr.IsDBNull(10)) { model.IssueTime = dr.GetDateTime(10); } model.SiteNo = dr[11].ToString(); list.Add(model); RouteAndTour.Add(model.ID, dr[12].ToString()); } model = null; } if (list == null || list.Count <= 0 || RouteAndTour == null || RouteAndTour.Count <= 0) { return(null); } System.Xml.XmlAttributeCollection attList = null; System.Xml.XmlDocument xml = null; System.Xml.XmlNodeList xmlNodeList = null; foreach (EyouSoft.Model.TourStructure.TourOrderCustomer model in list) { if (model == null || string.IsNullOrEmpty(RouteAndTour[model.ID])) { continue; } xml = new System.Xml.XmlDocument(); xml.LoadXml(RouteAndTour[model.ID]); xmlNodeList = xml.GetElementsByTagName("tbl_TourOrder"); if (xmlNodeList != null) { foreach (System.Xml.XmlNode node in xmlNodeList) { attList = node.Attributes; if (attList != null && attList.Count > 0) { model.TourId = attList["TourId"].Value; model.TourNo = attList["TourNo"].Value; model.RouteName = attList["RouteName"].Value; model.CompanyName = attList["TourCompanyName"].Value; break; } } } } if (attList != null) { attList.RemoveAll(); } if (RouteAndTour != null) { RouteAndTour.Clear(); } attList = null; xmlNodeList = null; xml = null; #endregion return(list); }
/// <summary> /// 获取某公司的所有的游客信息(分页) /// </summary> /// <param name="PageSize">每页条数</param> /// <param name="PageIndex">当前页数</param> /// <param name="RecordCount">总记录数(返回参数)</param> /// <param name="OrderIndex">排序方式:0 时间升序;1 时间降序</param> /// <param name="CompanyId">游客所属公司ID</param> /// <returns>返回游客信息实体集合</returns> public virtual IList <EyouSoft.Model.TourStructure.TourOrderCustomer> GetCustomerListByCompanyId(int PageSize, int PageIndex, ref int RecordCount, int OrderIndex, string CompanyId) { IList <EyouSoft.Model.TourStructure.TourOrderCustomer> list = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>(); string strWhere = string.Empty; string strFiles = " [ID],[CompanyID],[OrderID],[VisitorName],[CradType],[CradNumber],[Sex],[VisitorType],[ContactTel],[Remark],[IssueTime],[SiteNo] "; string strOrder = string.Empty; if (!string.IsNullOrEmpty(CompanyId)) { strWhere = " [CompanyID] = " + CompanyId; } switch (OrderIndex) { case 0: strOrder = " [IssueTime] asc "; break; case 1: strOrder = " [IssueTime] desc "; break; default: strOrder = " [IssueTime] desc "; break; } using (IDataReader dr = DbHelper.ExecuteReader(base.TourStore, PageSize, PageIndex, ref RecordCount, "tbl_TourOrderCustomer", "[ID]", strFiles, strWhere, strOrder)) { EyouSoft.Model.TourStructure.TourOrderCustomer model = null; while (dr.Read()) { model = new EyouSoft.Model.TourStructure.TourOrderCustomer(); model.ID = dr[0].ToString(); model.CompanyID = dr[1].ToString(); model.OrderID = dr[2].ToString(); model.VisitorName = dr[3].ToString(); if (!string.IsNullOrEmpty(dr[4].ToString())) { model.CradType = (Model.TourStructure.CradType) int.Parse(dr[4].ToString()); } model.CradNumber = dr[5].ToString(); if (!string.IsNullOrEmpty(dr[6].ToString())) { if (dr[6].ToString() == "0") { model.Sex = false; } else if (dr[6].ToString() == "1") { model.Sex = true; } } if (string.IsNullOrEmpty(dr[7].ToString()) || dr[7].ToString() == "0") { model.VisitorType = false; } else { model.VisitorType = true; } model.ContactTel = dr[8].ToString(); model.Remark = dr[9].ToString(); if (!string.IsNullOrEmpty(dr[10].ToString())) { model.IssueTime = DateTime.Parse(dr[10].ToString()); } model.SiteNo = dr[11].ToString(); list.Add(model); } model = null; } return(list); }
/// <summary> /// <summary> /// 获取询价报价实体 /// </summary> /// <param name="Id">主键编号</param> /// <param name="CompanyId">专线公司编号</param> /// <param name="CustomerId">组团公司编号</param> /// <param name="isZhuTuan">是否组团端,1是,0不是</param> /// <returns></returns> public EyouSoft.Model.TourStructure.LineInquireQuoteInfo GetQuoteModel(int Id, int CompanyId, int CustomerId, int isZhuTuan) { EyouSoft.Model.TourStructure.LineInquireQuoteInfo model = null; DbCommand dc = this.DB.GetStoredProcCommand("proc_Tour_GetInquireQuote"); this.DB.AddInParameter(dc, "CompanyId", DbType.Int32, CompanyId); this.DB.AddInParameter(dc, "CustomerId", DbType.Int32, CustomerId); this.DB.AddInParameter(dc, "isZhuTuan", DbType.Int32, isZhuTuan); this.DB.AddInParameter(dc, "Id", DbType.Int32, Id); using (IDataReader dr = DbHelper.RunReaderProcedure(dc, this.DB)) { if (dr.Read()) { #region 询价报价基本信息 model = new EyouSoft.Model.TourStructure.LineInquireQuoteInfo(); model.Id = dr.GetInt32(dr.GetOrdinal("Id")); model.CompanyId = dr.IsDBNull(dr.GetOrdinal("CompanyId")) ? 0 : dr.GetInt32(dr.GetOrdinal("CompanyId")); model.RouteId = dr.IsDBNull(dr.GetOrdinal("RouteId")) ? 0 : dr.GetInt32(dr.GetOrdinal("RouteId")); model.RouteName = dr["RouteName"].ToString(); model.CustomerId = dr.IsDBNull(dr.GetOrdinal("CustomerId")) ? 0 : dr.GetInt32(dr.GetOrdinal("CustomerId")); model.CustomerName = dr["CustomerName"].ToString(); model.ContactName = dr["ContactName"].ToString(); model.ContactTel = dr["ContactTel"].ToString(); model.LeaveDate = dr.IsDBNull(dr.GetOrdinal("LeaveDate")) ? System.DateTime.Now : dr.GetDateTime(dr.GetOrdinal("LeaveDate")); model.AdultNumber = dr.IsDBNull(dr.GetOrdinal("AdultNumber")) ? 0 : dr.GetInt32(dr.GetOrdinal("AdultNumber")); model.ChildNumber = dr.IsDBNull(dr.GetOrdinal("ChildNumber")) ? 0 : dr.GetInt32(dr.GetOrdinal("ChildNumber")); model.PeopleNum = model.AdultNumber + model.ChildNumber; model.SpecialClaim = dr["SpecialClaim"].ToString(); model.TicketAgio = dr.IsDBNull(dr.GetOrdinal("TicketAgio")) ? 0 : dr.GetDecimal(dr.GetOrdinal("TicketAgio")); model.IssueTime = dr.IsDBNull(dr.GetOrdinal("IssueTime")) ? System.DateTime.Now : dr.GetDateTime(dr.GetOrdinal("IssueTime")); model.QuoteState = (EyouSoft.Model.EnumType.TourStructure.QuoteState)dr.GetByte(dr.GetOrdinal("QuoteState")); model.Remark = dr["Remark"].ToString(); model.BuildTourId = dr["BuildTourId"].ToString(); model.TotalAmount = dr.GetDecimal(dr.GetOrdinal("TotalAmount")); model.Traveller = new EyouSoft.Model.TourStructure.TourEverydayApplyTravellerInfo(); model.Traveller.TravellerDisplayType = (EyouSoft.Model.EnumType.TourStructure.CustomerDisplayType)dr.GetByte(dr.GetOrdinal("TravellerDisplayType")); model.Traveller.TravellerFilePath = dr["TravellerFilePath"].ToString(); model.Traveller.Travellers = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>(); #endregion #region 行程要求 EyouSoft.Model.TourStructure.XingChengMust XingChengMust = null; dr.NextResult(); if (dr.Read()) { XingChengMust = new EyouSoft.Model.TourStructure.XingChengMust() { QuoteId = dr.IsDBNull(dr.GetOrdinal("QuoteId")) ? 0 : dr.GetInt32(dr.GetOrdinal("QuoteId")), QuotePlan = dr["QuotePlan"].ToString(), PlanAccessory = dr["PlanAccessory"].ToString(), PlanAccessoryName = dr["PlanAccessoryName"].ToString() }; } model.XingCheng = XingChengMust; #endregion #region 客人要求信息集合 IList <EyouSoft.Model.TourStructure.TourServiceInfo> TourServiceInfoList = new List <EyouSoft.Model.TourStructure.TourServiceInfo>(); EyouSoft.Model.TourStructure.TourServiceInfo TourServiceInfo = null; dr.NextResult(); while (dr.Read()) { TourServiceInfo = new EyouSoft.Model.TourStructure.TourServiceInfo() { Service = dr["ConcreteAsk"].ToString(), ServiceType = (EyouSoft.Model.EnumType.TourStructure.ServiceType)dr.GetInt32(dr.GetOrdinal("ItemType")) }; TourServiceInfoList.Add(TourServiceInfo); } model.Requirements = TourServiceInfoList; #endregion #region 价格组成信息集合 IList <EyouSoft.Model.TourStructure.TourTeamServiceInfo> TourTeamServiceInfoList = new List <EyouSoft.Model.TourStructure.TourTeamServiceInfo>(); EyouSoft.Model.TourStructure.TourTeamServiceInfo TourTeamServiceInfo = null; dr.NextResult(); while (dr.Read()) { TourTeamServiceInfo = new EyouSoft.Model.TourStructure.TourTeamServiceInfo() { Service = dr["Reception"].ToString(), LocalPrice = dr.IsDBNull(dr.GetOrdinal("LocalQuote")) ? 0 : dr.GetDecimal(dr.GetOrdinal("LocalQuote")), SelfPrice = dr.IsDBNull(dr.GetOrdinal("MyQuote")) ? 0 : dr.GetDecimal(dr.GetOrdinal("MyQuote")), ServiceType = (EyouSoft.Model.EnumType.TourStructure.ServiceType)dr.GetInt32(dr.GetOrdinal("ItemId")), LocalPeopleNumber = dr.GetInt32(dr.GetOrdinal("LocalPeopleNumber")), LocalUnitPrice = dr.GetDecimal(dr.GetOrdinal("LocalUnitPrice")), SelfPeopleNumber = dr.GetInt32(dr.GetOrdinal("SelfPeopleNumber")), SelfUnitPrice = dr.GetDecimal(dr.GetOrdinal("SelfUnitPrice")) }; TourTeamServiceInfoList.Add(TourTeamServiceInfo); } model.Services = TourTeamServiceInfoList; #endregion #region 游客信息 if (dr.NextResult() && model != null) { while (dr.Read()) { EyouSoft.Model.TourStructure.TourOrderCustomer traveller = new EyouSoft.Model.TourStructure.TourOrderCustomer() { ID = dr.GetString(dr.GetOrdinal("TravellerId")), VisitorName = dr["TravellerName"].ToString(), CradType = (EyouSoft.Model.EnumType.TourStructure.CradType)dr.GetByte(dr.GetOrdinal("CertificateType")), CradNumber = dr["CertificateCode"].ToString(), Sex = (EyouSoft.Model.EnumType.CompanyStructure.Sex)dr.GetByte(dr.GetOrdinal("Gender")), VisitorType = (EyouSoft.Model.EnumType.TourStructure.VisitorType)dr.GetByte(dr.GetOrdinal("TravellerType")), ContactTel = dr["Telephone"].ToString(), }; traveller.SpecialServiceInfo = new EyouSoft.Model.TourStructure.CustomerSpecialService() { CustormerId = traveller.ID, Fee = !dr.IsDBNull(dr.GetOrdinal("Fee")) ? dr.GetDecimal(dr.GetOrdinal("Fee")) : 0, IsAdd = !dr.IsDBNull(dr.GetOrdinal("IsAdd")) ? dr.GetByte(dr.GetOrdinal("IsAdd")) == 1 ? true : false : false, ProjectName = dr["ServiceName"].ToString(), ServiceDetail = dr["ServiceDetail"].ToString() }; model.Traveller.Travellers.Add(traveller); } } #endregion } } return(model); }
/// <summary> /// 提交 /// </summary> /// <param name="orderState">true=非同意留位操作</param> /// <param name="saveSeatDate">留位时间</param> private void Save(bool state, DateTime saveSeatDate) { EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo); string TourId = Utils.GetQueryStringValue("tourId"); model = (EyouSoft.Model.TourStructure.TourInfo)bll.GetTourInfo(TourId); #region 提交财务后不允许操作 by txb 6.17 if (model != null) { if (!Utils.PlanIsUpdateOrDelete(model.Status.ToString())) { Response.Write("<script>alert('该团已提交财务,不能对它操作!');location.href=location.href;</script>"); return; } } #endregion //订单信息业务逻辑层 EyouSoft.BLL.TourStructure.TourOrder orderbll = new EyouSoft.BLL.TourStructure.TourOrder(); //订单信息实体类 EyouSoft.Model.TourStructure.TourOrder ordermodel = new EyouSoft.Model.TourStructure.TourOrder(); //线路区域编号 ordermodel.AreaId = model.AreaId; //儿童数 ordermodel.ChildNumber = Utils.GetInt(Utils.GetFormValue(txtChildCount.UniqueID)); //儿童价 ordermodel.ChildPrice = Utils.GetDecimal(Utils.GetFormValue("hd_rt_price")); //成人数 ordermodel.AdultNumber = Utils.GetInt(Utils.GetFormValue(txtDdultCount.UniqueID)); //成人价 ordermodel.PersonalPrice = Utils.GetDecimal(Utils.GetFormValue("hd_cr_price")); //预定人姓名 ordermodel.ContactName = this.txtContactName.Text; //预订人电话 ordermodel.ContactTel = this.txtContactPhone.Text; //手机 ordermodel.ContactMobile = this.txtContactMobile.Text; //传真 ordermodel.ContactFax = this.txtContactFax.Text; //客户等级编号 ordermodel.CustomerLevId = SiteUserInfo.TourCompany.CustomerLevel; //报价等级编号 ordermodel.PriceStandId = Utils.GetInt(Utils.GetFormValue(hd_PriceStandId.UniqueID)); //下单时间 ordermodel.IssueTime = DateTime.Now; //游客特别要求 ordermodel.SpecialContent = Utils.GetFormValue("txt_Special"); //组团社编号 ordermodel.BuyCompanyID = SiteUserInfo.TourCompany.TourCompanyId; //是否组团端报名 ordermodel.IsTourOrderEdit = true; //组团社单位名称 EyouSoft.Model.CompanyStructure.CustomerInfo customInfo = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomerModel(SiteUserInfo.TourCompany.TourCompanyId); if (customInfo != null) { ordermodel.BuyCompanyName = customInfo.Name; //销售员 ordermodel.SalerId = customInfo.SaleId; ordermodel.SalerName = customInfo.Saler; } //下单人联系手机 //ordermodel.ContactMobile = SiteUserInfo.ContactInfo.ContactMobile; //下单人传真 //ordermodel.ContactFax = SiteUserInfo.ContactInfo.ContactFax; //计调员 ordermodel.OperatorList = new List <EyouSoft.Model.TourStructure.TourOperator>(); EyouSoft.Model.TourStructure.TourOperator TourOperator = new EyouSoft.Model.TourStructure.TourOperator(); TourOperator.ContactName = model.Coordinator.Name.ToString(); TourOperator.OperatorId = model.Coordinator.CoordinatorId; ordermodel.OperatorList.Add(TourOperator); #region 根据团队计划获取线路编号 EyouSoft.BLL.TourStructure.Tour bllTour = new EyouSoft.BLL.TourStructure.Tour(); //计划团队信息实体类 string TourID = Utils.GetQueryStringValue("tourId"); if (TourID != null && TourID != "") { model = (EyouSoft.Model.TourStructure.TourInfo)bllTour.GetTourInfo(TourID); if (model != null) { ordermodel.RouteId = model.RouteId; ordermodel.ViewOperatorId = model.OperatorId; } } #endregion //获取团队类型编号 ordermodel.TourClassId = EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划; //订单游客信息业务逻辑 IList <EyouSoft.Model.TourStructure.TourOrderCustomer> cus_list = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>(); //获取所有的游客姓名 string[] cus_arr = Utils.GetFormValues("txtVisitorName"); //获取特服信息 string[] uri = Utils.GetFormValues("tefu"); string[] cardType = Utils.GetFormValues("ddlCardType"); decimal orderprice = 0; for (int k = 0; k < cus_arr.Length; k++) { if (Utils.GetFormValues("txtVisitorName")[k] == "") { break; } //订单游客信息实体 EyouSoft.Model.TourStructure.TourOrderCustomer item = new EyouSoft.Model.TourStructure.TourOrderCustomer(); item.VisitorName = Utils.GetFormValues("txtVisitorName")[k]; //游客类型 item.VisitorType = Utils.GetFormValues("ddlVisitorType")[k] == "1" ? EyouSoft.Model.EnumType.TourStructure.VisitorType.成人 : EyouSoft.Model.EnumType.TourStructure.VisitorType.儿童; item.CradType = (EyouSoft.Model.EnumType.TourStructure.CradType)Utils.GetInt(cardType[k]); //游客证件号码 item.CradNumber = Utils.GetFormValues("txtCardNo")[k]; #region 游客性别 switch (Utils.GetFormValues("ddlSex")[k]) { case "2": { item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.男; } break; case "1": { item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.女; } break; default: { item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.未知; } break; } #endregion //游客联系电话 item.ContactTel = Utils.GetFormValues("txtContactTel")[k]; //游客特服信息实体类 EyouSoft.Model.TourStructure.CustomerSpecialService css = new EyouSoft.Model.TourStructure.CustomerSpecialService(); //特服费用 css.Fee = Utils.GetDecimal(Utils.GetFromQueryStringByKey(uri[k], "txtCost")); //增加费用还是减少费用 css.IsAdd = Utils.GetFromQueryStringByKey(uri[k], "ddlOperate") == "0" ? true : false; css.IssueTime = DateTime.Now; //项目 css.ProjectName = Utils.GetFromQueryStringByKey(uri[k], "txtItem"); //服务内容 css.ServiceDetail = Utils.GetFromQueryStringByKey(uri[k], "txtServiceContent"); //游客特服信息 item.SpecialServiceInfo = css; item.IssueTime = DateTime.Now; item.CompanyID = SiteUserInfo.CompanyID; //游客所有的信息添加到订单 cus_list.Add(item); orderprice += Utils.GetDecimal(Utils.GetFromQueryStringByKey(uri[k], "txtCost")); } //游客信息集合 ordermodel.CustomerList = cus_list; //返佣金额 ordermodel.CommissionPrice = Utils.GetDecimal(this.hideBackMoney.Value); //返佣类型 ordermodel.CommissionType = (EyouSoft.Model.EnumType.CompanyStructure.CommissionType)Utils.GetInt(this.hideBackType.Value); ordermodel.BuyerContactId = new EyouSoft.BLL.CompanyStructure.Customer().GetContactId (SiteUserInfo.ID); ordermodel.BuyerContactName = SiteUserInfo.ContactInfo.ContactName; ordermodel.LastDate = DateTime.Now; ordermodel.LeaveDate = model.LDate; ordermodel.SaveSeatDate = saveSeatDate; ordermodel.PersonalPrice = Utils.GetDecimal(Utils.GetFormValue("hd_cr_price")); ordermodel.ChildPrice = Utils.GetDecimal(Utils.GetFormValue("hd_rt_price")); ordermodel.ID = Guid.NewGuid().ToString(); ordermodel.TourId = model.TourId; ordermodel.OrderType = EyouSoft.Model.EnumType.TourStructure.OrderType.组团下单; ordermodel.SellCompanyId = SiteUserInfo.CompanyID; ordermodel.SellCompanyName = this.SiteUserInfo.CompanyName; ordermodel.TourNo = model.TourCode; ordermodel.Tourdays = model.TourDays; ordermodel.TourClassId = EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划; ordermodel.OperatorID = SiteUserInfo.ID; ordermodel.OperatorName = SiteUserInfo.ContactInfo.ContactName; ordermodel.OrderState = state ? EyouSoft.Model.EnumType.TourStructure.OrderState.未处理 : EyouSoft.Model.EnumType.TourStructure.OrderState.已留位; ordermodel.OtherPrice = orderprice; ordermodel.RouteId = model.RouteId; ordermodel.RouteName = model.RouteName; ordermodel.OtherPrice = orderprice; ordermodel.SumPrice = Utils.GetDecimal(Utils.GetFormValue("txtTotalMoney").ToString()); ordermodel.PeopleNumber = Utils.GetInt(Utils.GetFormValue(txtDdultCount.UniqueID)) + Utils.GetInt(Utils.GetFormValue(txtChildCount.UniqueID)); #region 游客附件信息 string fileAtt = ""; string oldfileAtt = ""; string VisitorInfoFile = "/uploadFiles/zutuanFile/"; if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files[0], VisitorInfoFile, out fileAtt, out oldfileAtt)) { ordermodel.CustomerFilePath = fileAtt; } else { EyouSoft.Common.Function.MessageBox.Show(this.Page, "上传附件失败!"); return; } #endregion //提交订单 /// 0:失败; /// 1:成功; /// 2:该团队的订单总人数+当前订单人数大于团队计划人数总和; /// 3:该客户所欠金额大于最高欠款金额; int i = orderbll.AddOrder(ordermodel); switch (i) { case 1: { Utils.ShowMsgAndCloseBoxy("提交成功", Request.QueryString["iframeid"], true); } break; case 2: { Response.Write("<script>alert('该团队的订单总人数+当前订单人数大于团队计划人数总和');location.href=location.href;</script>"); } break; case 3: { Response.Write("<script>alert('该客户所欠金额大于最高欠款金额');location.href=location.href;</script>"); } break; default: { Response.Write("<script>alert('添加失败!');location.href=location.href;</script>"); } break; } orderbll = null; ordermodel = null; cus_list = null; }