private string FormSave() { //声明操作BLL EyouSoft.IBLL.NewTourStructure.IPowderList tourBll = EyouSoft.BLL.NewTourStructure.BPowderList.CreateInstance(); //创建新的订单 EyouSoft.Model.NewTourStructure.MTourOrder orderModel = new EyouSoft.Model.NewTourStructure.MTourOrder(); string tourID = Utils.GetQueryStringValue("tourID"); //成人数 int adultCount = Utils.GetInt(Utils.GetFormValue(this.txtAdultCount.UniqueID)); if (adultCount == 0) { return("请输入成人数!"); } //儿童数 int childCount = Utils.GetInt(Utils.GetFormValue(this.txtChildCount.UniqueID)); //单房差 int otherCount = Utils.GetInt(Utils.GetFormValue(this.txtOtherCount.UniqueID)); //游客联系人 string contact = Utils.GetFormValue(this.txtContact.UniqueID); //游客联系电话 string conTactTel = Utils.GetFormValue(this.txtConTactTel.UniqueID); //负责人 string fzr = Utils.GetFormValue(this.txtFzr.UniqueID); if (fzr == "") { fzr = SiteUserInfo.ContactInfo.ContactName; } //负责人电话 string fzrTel = Utils.GetFormValue(this.txtFzrTel.UniqueID); if (fzrTel == "") { fzrTel = SiteUserInfo.ContactInfo.Tel; } //增减价格 decimal addPrice = 0; decimal.TryParse(Utils.GetFormValue(this.txtAddPrice.UniqueID), out addPrice); //增减结算价 decimal reductPrice = 0; decimal.TryParse(Utils.GetFormValue(this.txtReductPrice.UniqueID), out reductPrice); //游客备注 string cusRemark = Utils.GetFormValue(this.txtCusRemark.UniqueID); //组团备注 string remark = Utils.GetFormValue(this.txtRemark.UniqueID); #region 处理旅客 string[] txtName = Utils.GetFormValues("txtName"); string[] txtTel = Utils.GetFormValues("txtTel"); string[] txtCard = Utils.GetFormValues("txtCard"); string[] txtCardS = Utils.GetFormValues("txtCardS"); string[] txtCardT = Utils.GetFormValues("txtCardT"); string[] sltSex = Utils.GetFormValues("sltSex"); string[] sltChild = Utils.GetFormValues("sltChild"); string[] txtNumber = Utils.GetFormValues("txtNumber"); string[] txtRemarks = Utils.GetFormValues("txtRemarks"); string[] cbxVisitor = Utils.GetFormValues("cbxVisitor"); IList <EyouSoft.Model.NewTourStructure.MTourOrderCustomer> customerList = new List <EyouSoft.Model.NewTourStructure.MTourOrderCustomer>(); if (txtName.Length > 0) { for (int i = 0; i < txtName.Length; i++) { EyouSoft.Model.NewTourStructure.MTourOrderCustomer model = new EyouSoft.Model.NewTourStructure.MTourOrderCustomer(); model.CertificatesType = EyouSoft.Model.TicketStructure.TicketCardType.身份证; model.CompanyId = SiteUserInfo.CompanyID; if (cbxVisitor.Contains((i + 1).ToString())) { model.IsSaveToTicketVistorInfo = true; } model.Mobile = txtTel[i]; model.CradType = sltChild[i] == "0" ? EyouSoft.Model.TicketStructure.TicketVistorType.成人 : EyouSoft.Model.TicketStructure.TicketVistorType.儿童; model.IdentityCard = txtCard[i]; model.IssueTime = DateTime.Now; model.Notes = txtRemarks[i]; model.OtherCard = txtCardT[i]; model.Passport = txtCardS[i]; model.Sex = sltSex[i] == "0" ? EyouSoft.Model.CompanyStructure.Sex.男 : EyouSoft.Model.CompanyStructure.Sex.女; model.SiteNo = txtNumber[i]; model.VisitorName = txtName[i]; customerList.Add(model); } } #endregion #region 订单实体赋值 orderModel.Add = addPrice; orderModel.AdultNum = adultCount; orderModel.Reduction = reductPrice; #region 获得计划中价格信息 decimal reAdultPrice = 0; decimal reChilePrice = 0; decimal reOtherPrice = 0; decimal seAdultPrice = 0; decimal seChildPrice = 0; EyouSoft.Model.NewTourStructure.MPowderList tourModel = tourBll.GetModel(tourID); if (tourModel != null) { reAdultPrice = tourModel.RetailAdultPrice; reChilePrice = tourModel.RetailChildrenPrice; reOtherPrice = tourModel.MarketPrice; seAdultPrice = tourModel.SettlementAudltPrice; seChildPrice = tourModel.SettlementChildrenPrice; //订单实体赋值 orderModel.BusinessNotes = ""; orderModel.DayNum = tourModel.Day; orderModel.LateNum = tourModel.Late; orderModel.LeaveDate = tourModel.LeaveDate; orderModel.RouteId = tourModel.RouteId; orderModel.RouteName = tourModel.RouteName; orderModel.ScheduleNum = tourModel.OrderPeopleNum; orderModel.TourId = tourModel.TourId; orderModel.TourNo = tourModel.TourNo; } else { Response.Clear(); Response.Write("error"); Response.End(); } #endregion orderModel.ChildPrice = reChilePrice; orderModel.ChildrenNum = childCount; orderModel.Customers = customerList; orderModel.IssueTime = DateTime.Now; orderModel.MarketPrice = reOtherPrice; orderModel.OperationMsg = ""; orderModel.OperatorId = SiteUserInfo.ID; orderModel.OperatorName = SiteUserInfo.ContactInfo.ContactName; orderModel.OrderStatus = EyouSoft.Model.NewTourStructure.PowderOrderStatus.组团社待处理; orderModel.PaymentStatus = EyouSoft.Model.NewTourStructure.PaymentStatus.游客未支付; orderModel.PersonalPrice = reAdultPrice; orderModel.SaveDate = null; orderModel.SettlementAudltPrice = seAdultPrice; orderModel.SettlementChildrenPrice = seChildPrice; orderModel.SingleRoomNum = otherCount; orderModel.VisitorNotes = cusRemark; orderModel.Travel = SiteUserInfo.CompanyID; orderModel.TravelContact = fzr; orderModel.TravelName = SiteUserInfo.CompanyName; orderModel.TravelNotes = remark; orderModel.TravelTel = fzrTel; orderModel.VisitorContact = contact; orderModel.VisitorNotes = cusRemark; orderModel.VisitorTel = conTactTel; //计划销售总价 orderModel.TotalSalePrice = adultCount * reAdultPrice + childCount * reChilePrice + otherCount * reOtherPrice + addPrice; //计算结算总价 orderModel.TotalSettlementPrice = adultCount * seAdultPrice + childCount * seChildPrice + reductPrice; if (EyouSoft.BLL.NewTourStructure.BTourOrder.CreateInstance().AddOrUpdTourOrder(orderModel)) { #region 发送短信模块 EyouSoft.Model.SystemStructure.MSysSettingInfo SettingInfoModel = EyouSoft.BLL.SystemStructure.SystemInfo.CreateInstance().GetSysSetting(); //获得组团公司实体 EyouSoft.Model.CompanyStructure.CompanyDetailInfo travelComModel = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetModel(SiteUserInfo.CompanyID); ////获得专线或地接公司实体 EyouSoft.Model.CompanyStructure.CompanyDetailInfo tourComModel = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetModel(tourModel.Publishers); if (SettingInfoModel != null && travelComModel != null && tourComModel != null) { if (SettingInfoModel.OrderSmsCompanyTypes.Contains(travelComModel.CompanyLev)) { string sendMsg = SettingInfoModel.OrderSmsTemplate; sendMsg = sendMsg.Replace("[预订公司]", SiteUserInfo.CompanyName); sendMsg = sendMsg.Replace("[预订联系电话]", SiteUserInfo.ContactInfo.Mobile); sendMsg = sendMsg.Replace("[预订出发时间]", tourModel.LeaveDate.ToString("yyyy-MM-dd")); sendMsg = sendMsg.Replace("[预订产品]", tourModel.RouteName); sendMsg = sendMsg.Replace("[预订数量]", orderModel.AdultNum.ToString() + "成," + orderModel.ChildrenNum.ToString() + "儿"); #region 发送操作 EyouSoft.Model.SMSStructure.SendMessageInfo sendMessageInfo = new EyouSoft.Model.SMSStructure.SendMessageInfo(); sendMessageInfo.CompanyId = orderModel.Travel; sendMessageInfo.CompanyName = orderModel.TravelName; sendMessageInfo.UserId = this.SiteUserInfo.ID; sendMessageInfo.UserFullName = SiteUserInfo.ContactInfo.ContactName; sendMessageInfo.SMSContent = sendMsg; sendMessageInfo.SendTime = DateTime.Now; //添加要发送的手机号码 List <EyouSoft.Model.SMSStructure.AcceptMobileInfo> moblieList = new List <EyouSoft.Model.SMSStructure.AcceptMobileInfo>(); EyouSoft.Model.SMSStructure.AcceptMobileInfo mobileModel = new EyouSoft.Model.SMSStructure.AcceptMobileInfo(); mobileModel.IsEncrypt = false; if (tourComModel.ContactInfo != null) { mobileModel.Mobile = tourComModel.ContactInfo.Mobile; } moblieList.Add(mobileModel); sendMessageInfo.Mobiles = moblieList; //发送通道 EyouSoft.Model.SMSStructure.SMSChannel sendChannel = new EyouSoft.Model.SMSStructure.SMSChannelList()[Convert.ToInt32(SettingInfoModel.OrderSmsChannelIndex)]; sendMessageInfo.SendChannel = sendChannel; sendMessageInfo.SendType = EyouSoft.Model.SMSStructure.SendType.直接发送; EyouSoft.IBLL.SMSStructure.ISendMessage sBll = EyouSoft.BLL.SMSStructure.SendMessage.CreateInstance(); EyouSoft.Model.SMSStructure.SendResultInfo SendResultModel = sBll.Send(sendMessageInfo); SendResultModel = null; sendMessageInfo = null; #endregion } } #endregion return("ok"); } else { return("服务器忙,请稍后再试!"); } #endregion }
private string FormSave() { //声明操作BLL EyouSoft.IBLL.NewTourStructure.IPowderList tourBll = EyouSoft.BLL.NewTourStructure.BPowderList.CreateInstance(); //创建新的订单 EyouSoft.Model.NewTourStructure.MTourOrder orderModel = new EyouSoft.Model.NewTourStructure.MTourOrder(); string tourID = Utils.GetQueryStringValue("tourID"); //成人数 int adultCount = Utils.GetInt(Utils.GetFormValue(this.txtAdultCount.UniqueID)); if (adultCount == 0) { return("请输入成人数!"); } //儿童数 int childCount = Utils.GetInt(Utils.GetFormValue(this.txtChildCount.UniqueID)); //单房差 int otherCount = Utils.GetInt(Utils.GetFormValue(this.txtOtherCount.UniqueID)); //游客联系人 string contact = Utils.GetFormValue(this.txtContact.UniqueID); //游客联系电话 string conTactTel = Utils.GetFormValue(this.txtConTactTel.UniqueID); //负责人 string travelID = Utils.GetFormValue(this.hideTravelID.UniqueID); string travelName = Utils.GetFormValue(this.txtTravel.UniqueID); string fzr = Utils.GetFormValue(this.txtFzr.UniqueID); //负责人电话 string fzrTel = Utils.GetFormValue(this.txtFzrTel.UniqueID); //增减结算价 decimal addPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtAddPrice.UniqueID)); //游客备注 //组团备注 string remark = Utils.GetFormValue(this.txtRemark.UniqueID); #region 处理旅客 string[] txtName = Utils.GetFormValues("txtName"); string[] txtTel = Utils.GetFormValues("txtTel"); string[] txtCard = Utils.GetFormValues("txtCard"); string[] txtCardS = Utils.GetFormValues("txtCardS"); string[] txtCardT = Utils.GetFormValues("txtCardT"); string[] sltSex = Utils.GetFormValues("sltSex"); string[] sltChild = Utils.GetFormValues("sltChild"); string[] txtNumber = Utils.GetFormValues("txtNumber"); string[] txtRemarks = Utils.GetFormValues("txtRemarks"); string[] cbxVisitor = Utils.GetFormValues("cbxVisitor"); IList <EyouSoft.Model.NewTourStructure.MTourOrderCustomer> customerList = new List <EyouSoft.Model.NewTourStructure.MTourOrderCustomer>(); if (txtName.Length > 0) { for (int i = 0; i < txtName.Length; i++) { EyouSoft.Model.NewTourStructure.MTourOrderCustomer model = new EyouSoft.Model.NewTourStructure.MTourOrderCustomer(); model.CertificatesType = EyouSoft.Model.TicketStructure.TicketCardType.身份证; model.CompanyId = "";//SiteUserInfo.CompanyID if (cbxVisitor.Contains((i + 1).ToString())) { model.IsSaveToTicketVistorInfo = true; } model.ContactTel = txtTel[i]; model.CradType = sltChild[i] == "1" ? EyouSoft.Model.TicketStructure.TicketVistorType.成人 : EyouSoft.Model.TicketStructure.TicketVistorType.儿童; model.IdentityCard = txtCard[i]; model.IssueTime = DateTime.Now; model.Notes = txtRemarks[i]; model.OtherCard = txtCardT[i]; model.Passport = txtCardS[i]; model.Sex = sltSex[i] == "0" ? EyouSoft.Model.CompanyStructure.Sex.男 : EyouSoft.Model.CompanyStructure.Sex.女; model.SiteNo = txtNumber[i]; model.VisitorName = txtName[i]; customerList.Add(model); } } #endregion #region 订单实体赋值 orderModel.Reduction = addPrice; orderModel.AdultNum = adultCount; #region 获得计划中价格信息 decimal reAdultPrice = 0; decimal reChilePrice = 0; decimal reOtherPrice = 0; decimal seAdultPrice = 0; decimal seChildPrice = 0; EyouSoft.Model.NewTourStructure.MPowderList tourModel = tourBll.GetModel(tourID); if (tourModel != null) { reAdultPrice = tourModel.RetailAdultPrice; reChilePrice = tourModel.RetailChildrenPrice; reOtherPrice = tourModel.MarketPrice; seAdultPrice = tourModel.SettlementAudltPrice; seChildPrice = tourModel.SettlementChildrenPrice; //订单实体赋值 orderModel.BusinessNotes = ""; orderModel.DayNum = tourModel.Day; orderModel.LateNum = tourModel.Late; orderModel.LeaveDate = tourModel.LeaveDate; orderModel.RouteId = tourModel.RouteId; orderModel.RouteName = tourModel.RouteName; orderModel.ScheduleNum = tourModel.OrderPeopleNum; orderModel.TourId = tourModel.TourId; orderModel.TourNo = tourModel.TourNo; } #endregion orderModel.ChildPrice = reChilePrice; orderModel.ChildrenNum = childCount; orderModel.Customers = customerList; orderModel.IssueTime = DateTime.Now; orderModel.MarketPrice = reOtherPrice; orderModel.OperationMsg = ""; orderModel.OperatorId = ""; //SiteUserInfo.ID; orderModel.OperatorName = ""; // SiteUserInfo.ContactInfo.ContactName; orderModel.OrderStatus = EyouSoft.Model.NewTourStructure.PowderOrderStatus.组团社待处理; orderModel.PaymentStatus = EyouSoft.Model.NewTourStructure.PaymentStatus.游客未支付; orderModel.PersonalPrice = reAdultPrice; orderModel.SaveDate = null; orderModel.SettlementAudltPrice = seAdultPrice; orderModel.SettlementChildrenPrice = seChildPrice; orderModel.SingleRoomNum = otherCount; orderModel.Travel = travelID; orderModel.TravelName = travelName; orderModel.TravelContact = fzr; orderModel.TravelTel = fzrTel; orderModel.VisitorContact = contact; orderModel.VisitorTel = conTactTel; orderModel.BusinessNotes = remark; orderModel.TotalSalePrice = adultCount * reAdultPrice + childCount * reChilePrice + otherCount * reOtherPrice + addPrice; orderModel.TotalSettlementPrice = adultCount * seAdultPrice + childCount * seChildPrice; if (EyouSoft.BLL.NewTourStructure.BTourOrder.CreateInstance().AddOrUpdTourOrder(orderModel)) { return("ok"); } else { return("服务器忙,请稍后再试!"); } #endregion }
/// <summary> /// 修改订单 /// </summary> /// <returns></returns> private string FormSave() { string orderID = Utils.GetQueryStringValue("orderID"); //声明操作BLL EyouSoft.IBLL.NewTourStructure.ITourOrder orderBll = EyouSoft.BLL.NewTourStructure.BTourOrder.CreateInstance(); //获得订单实体 EyouSoft.Model.NewTourStructure.MTourOrder orderModel = orderBll.GetModel(orderID); //成人数 int adultCount = Utils.GetInt(Utils.GetFormValue(this.txtAdultCount.UniqueID)); if (adultCount == 0) { return("请输入成人数!"); } //儿童数 int childCount = Utils.GetInt(Utils.GetFormValue(this.txtChildCount.UniqueID)); //单房差 int otherCount = Utils.GetInt(Utils.GetFormValue(this.txtOtherCount.UniqueID)); //增减结算价 decimal addReduction = Utils.GetDecimal(Utils.GetFormValue(this.txtAddPrice.UniqueID)); //专线备注 string routeRemarks = Utils.GetFormValue(this.txtRouteRemarks.UniqueID); #region 处理旅客 string[] txtName = Utils.GetFormValues("txtName"); string[] txtTel = Utils.GetFormValues("txtTel"); string[] txtCard = Utils.GetFormValues("txtCard"); string[] txtCardS = Utils.GetFormValues("txtCardS"); string[] txtCardT = Utils.GetFormValues("txtCardT"); string[] sltSex = Utils.GetFormValues("sltSex"); string[] sltChild = Utils.GetFormValues("sltChild"); string[] txtNumber = Utils.GetFormValues("txtNumber"); string[] txtRemarks = Utils.GetFormValues("txtRemarks"); string[] cbxVisitor = Utils.GetFormValues("cbxVisitor"); IList <EyouSoft.Model.NewTourStructure.MTourOrderCustomer> customerList = new List <EyouSoft.Model.NewTourStructure.MTourOrderCustomer>(); if (txtName.Length > 0) { for (int i = 0; i < txtName.Length; i++) { EyouSoft.Model.NewTourStructure.MTourOrderCustomer model = new EyouSoft.Model.NewTourStructure.MTourOrderCustomer(); model.CertificatesType = EyouSoft.Model.TicketStructure.TicketCardType.身份证; model.CompanyId = "";//SiteUserInfo.CompanyID if (cbxVisitor.Contains((i + 1).ToString())) { model.IsSaveToTicketVistorInfo = true; } model.ContactTel = txtTel[i]; model.CradType = sltChild[i] == "1" ? EyouSoft.Model.TicketStructure.TicketVistorType.成人 : EyouSoft.Model.TicketStructure.TicketVistorType.儿童; model.IdentityCard = txtCard[i]; model.IssueTime = DateTime.Now; model.Notes = txtRemarks[i]; model.OtherCard = txtCardT[i]; model.Passport = txtCardS[i]; model.Sex = sltSex[i] == "0" ? EyouSoft.Model.CompanyStructure.Sex.男 : EyouSoft.Model.CompanyStructure.Sex.女; model.SiteNo = txtNumber[i]; model.VisitorName = txtName[i]; customerList.Add(model); } } #endregion #region 订单实体赋值 orderModel.Reduction = addReduction; orderModel.AdultNum = adultCount; orderModel.ChildrenNum = childCount; orderModel.Customers = customerList; orderModel.IssueTime = DateTime.Now; orderModel.OperatorId = ""; //SiteUserInfo.ID; orderModel.OperatorName = ""; // SiteUserInfo.ContactInfo.ContactName; orderModel.OrderStatus = EyouSoft.Model.NewTourStructure.PowderOrderStatus.专线商待处理; orderModel.PaymentStatus = EyouSoft.Model.NewTourStructure.PaymentStatus.游客未支付; orderModel.SaveDate = null; orderModel.SingleRoomNum = otherCount; orderModel.Travel = ""; orderModel.BusinessNotes = routeRemarks; orderModel.TotalSalePrice = adultCount * orderModel.PersonalPrice + childCount * orderModel.ChildPrice + otherCount * orderModel.MarketPrice; //专线计算结算价 需要加减结算价 orderModel.TotalSettlementPrice = adultCount * orderModel.SettlementAudltPrice + childCount * orderModel.SettlementChildrenPrice + addReduction; if (EyouSoft.BLL.NewTourStructure.BTourOrder.CreateInstance().AddOrUpdTourOrder(orderModel)) { return("ok"); } else { return("服务器忙,请稍后再试!"); } #endregion }