/// <summary> /// 绑定信息 /// </summary> void BindInfo() { EyouSoft.BLL.TourStructure.TourEveryday bl = new EyouSoft.BLL.TourStructure.TourEveryday(SiteUserInfo); string tourId = Utils.GetQueryStringValue("tourid"); string ApplyId = Utils.GetQueryStringValue("ApplyId"); EyouSoft.Model.TourStructure.TourEverydayInfo model = bl.GetTourEverydayInfo(tourId); #region 价格绑定 IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> listStand = model.PriceStandards; IList <EyouSoft.Model.CompanyStructure.CustomStand> list = new List <EyouSoft.Model.CompanyStructure.CustomStand>(); EyouSoft.BLL.CompanyStructure.CompanyCustomStand bll = new EyouSoft.BLL.CompanyStructure.CompanyCustomStand(); list = bll.GetCustomStandByCompanyId(CurrentUserCompanyID); int kkk = list.Count; IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> plist = model.PriceStandards; for (int i = 0; i < listStand.Count; i++) { for (int j = 0; j < list.Count; j++) { //if(listStand[i].CustomerLevels[i].LevelId == list.sel) if (listStand[i].CustomerLevels.Count > j) { var vn = list.Where(x => x.Id == listStand[i].CustomerLevels[j].LevelId).FirstOrDefault(); if (vn != null) { listStand[i].CustomerLevels[j].LevelName = vn.CustomStandName; } else { listStand[i].CustomerLevels.RemoveAt(j); } } var xn = listStand[i].CustomerLevels.Where(x => x.LevelId == list[j].Id).FirstOrDefault(); if (xn == null) { listStand[i].CustomerLevels.Add(new EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo() { LevelId = list[j].Id, LevelType = list[j].LevType, LevelName = list[j].CustomStandName, AdultPrice = 0, ChildrenPrice = 0 }); } } } sinfo = plist; #endregion hd_area.Value = model.AreaId.ToString();//线路区域 EyouSoft.Model.TourStructure.TourEverydayApplyInfo applyModel = new EyouSoft.Model.TourStructure.TourEverydayApplyInfo(); applyModel = bl.GetTourEverydayApplyInfo(ApplyId); hd_Ldate.Value = applyModel.LDate.ToShortDateString(); txt_ykrs.Value = applyModel.PeopleNumber.ToString(); hd_num.Value = applyModel.PeopleNumber.ToString(); }
/// <summary> /// 申请散客天天发计划,正值时成功,负值或0时失败 /// </summary> /// <param name="info">散客天天发计划申请信息业务实体</param> /// <returns></returns> public int ApplyTourEveryday(EyouSoft.Model.TourStructure.TourEverydayApplyInfo info) { if (info == null) { return(0); } if (info.ApplyCompanyId < 1) { return(-1); } if (info.LDate == DateTime.MinValue) { return(-2); } if (info.LevelId < 1) { return(-3); } if (info.OperatorId < 1) { return(-4); } if (info.StandardId < 1) { return(-5); } if (string.IsNullOrEmpty(info.TourId)) { return(-6); } if (info.PeopleNumber < 1) { return(-7); } info.ApplyId = Guid.NewGuid().ToString(); if (info.Traveller != null && info.Traveller.Travellers != null && info.Traveller.Travellers.Count > 0) { foreach (var item in info.Traveller.Travellers) { item.ID = Guid.NewGuid().ToString(); } } return(dal.ApplyTourEveryday(info)); }
/// <summary> /// 生成计划 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void LinkButton1_Click(object sender, EventArgs e) { EyouSoft.Model.TourStructure.TourInfo info = new EyouSoft.Model.TourStructure.TourInfo(); EyouSoft.BLL.TourStructure.TourEveryday bl = new EyouSoft.BLL.TourStructure.TourEveryday(SiteUserInfo); #region 基础数据获取 string tourId = Utils.GetQueryStringValue("tourid"); string ApplyId = Utils.GetQueryStringValue("ApplyId"); EyouSoft.Model.TourStructure.TourEverydayInfo model = bl.GetTourEverydayInfo(tourId); EyouSoft.Model.TourStructure.TourEverydayApplyInfo applyModel = new EyouSoft.Model.TourStructure.TourEverydayApplyInfo(); applyModel = bl.GetTourEverydayApplyInfo(ApplyId); info.AreaId = model.AreaId; info.Attachs = model.Attachs; #region 子团 IList <EyouSoft.Model.TourStructure.TourChildrenInfo> childlist = new List <EyouSoft.Model.TourStructure.TourChildrenInfo>(); string tourcode = Utils.GetFormValue("txt_tuanhao"); if (tourcode.Trim().Length == 0) { EyouSoft.Common.Function.MessageBox.Show(this, "团号不能为空"); BindInfo(); return; } childlist.Add(new EyouSoft.Model.TourStructure.TourChildrenInfo() { LDate = applyModel.LDate, TourCode = tourcode }); info.Childrens = childlist; #endregion info.CompanyId = CurrentUserCompanyID; info.Coordinator = new EyouSoft.Model.TourStructure.TourCoordinatorInfo() { CoordinatorId = Utils.GetInt(Utils.GetFormValue("sel_oprator")) }; info.CreateRule = new EyouSoft.Model.TourStructure.TourCreateRuleInfo() { Cycle = null, EDate = null, Rule = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.日期, SDate = applyModel.LDate }; info.CreateTime = DateTime.Now; info.Gather = Utils.GetFormValue("txt_jhfs"); info.GatheringPlace = Utils.GetFormValue("txt_jhdd"); info.GatheringSign = Utils.GetFormValue("txt_jhbz"); info.GatheringTime = Utils.GetFormValue("txt_jhdate"); info.LDate = applyModel.LDate; info.LTraffic = Utils.GetFormValue("txt_qcDate"); info.OperatorId = SiteUserInfo.ID; info.ORouteId = model.RouteId; info.PlanPeopleNumber = Utils.GetInt(Utils.GetFormValue("txt_ykrs")); info.PriceStandards = model.PriceStandards; //info.RDate info.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal; info.RouteId = model.RouteId; info.RouteName = model.RouteName; info.RTraffic = Utils.GetFormValue("txt_hcDate"); //info.SellerId //info.SellerName List <EyouSoft.Model.TourStructure.TourSentPeopleInfo> sentpepole = new List <EyouSoft.Model.TourStructure.TourSentPeopleInfo>(); string[] strOperId = SelectgroupPepole.OperId.Split(','); for (int i = 0; i < strOperId.Length; i++) { EyouSoft.Model.TourStructure.TourSentPeopleInfo sent = new EyouSoft.Model.TourStructure.TourSentPeopleInfo(); sent.OperatorId = Utils.GetInt(strOperId[i]); sent.OperatorName = SelectgroupPepole.OperName.Split(',')[i]; sentpepole.Add(sent); } info.SentPeoples = sentpepole; info.Status = EyouSoft.Model.EnumType.TourStructure.TourStatus.正在收客; info.TicketStatus = EyouSoft.Model.EnumType.PlanStructure.TicketState.None; info.TourCode = Utils.GetFormValue("txt_tuanhao"); info.TourDays = model.TourDays; //info.TourId info.TourNormalInfo = new EyouSoft.Model.TourStructure.TourNormalPrivateInfo() { BuHanXiangMu = model.TourNormalInfo.BuHanXiangMu, ErTongAnPai = model.TourNormalInfo.ErTongAnPai, GouWuAnPai = model.TourNormalInfo.GouWuAnPai, NeiBuXingXi = model.TourNormalInfo.NeiBuXingXi, Plans = model.TourNormalInfo.Plans, Services = model.TourNormalInfo.Services, WenXinTiXing = model.TourNormalInfo.WenXinTiXing, ZhuYiShiXiang = model.TourNormalInfo.ZhuYiShiXiang, ZiFeiXIangMu = model.TourNormalInfo.ZiFeiXIangMu }; info.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划; info.VirtualPeopleNumber = 0; #endregion int j = bl.BuildTour(info, tourId, ApplyId); if (j > 0) { Response.Write("<script>alert('生成计划成功!');parent.location.href=parent.location.href;</script>"); BindInfo(); } else { EyouSoft.Common.Function.MessageBox.Show(this, "生成失败"); BindInfo(); } }
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 LinkButton1_Click(object sender, EventArgs e) { EyouSoft.Model.TourStructure.TourInfo info = new EyouSoft.Model.TourStructure.TourInfo(); EyouSoft.BLL.TourStructure.TourEveryday bl = new EyouSoft.BLL.TourStructure.TourEveryday(SiteUserInfo); #region 基础数据 string tourId = Utils.GetQueryStringValue("tourid"); string ApplyId = Utils.GetQueryStringValue("ApplyId"); EyouSoft.Model.TourStructure.TourEverydayInfo model = bl.GetTourEverydayInfo(tourId); EyouSoft.Model.TourStructure.TourEverydayApplyInfo applyModel = new EyouSoft.Model.TourStructure.TourEverydayApplyInfo(); applyModel = bl.GetTourEverydayApplyInfo(ApplyId); info.AreaId = model.AreaId; info.Attachs = model.Attachs; string tourcode = Utils.GetFormValue("txt_tuanhao"); if (tourcode.Trim().Length == 0) { EyouSoft.Common.Function.MessageBox.Show(this, "团号不能为空!"); BindInfo(); return; } #region 子团 IList <EyouSoft.Model.TourStructure.TourChildrenInfo> childlist = new List <EyouSoft.Model.TourStructure.TourChildrenInfo>(); childlist.Add(new EyouSoft.Model.TourStructure.TourChildrenInfo() { LDate = applyModel.LDate, TourCode = tourcode }); info.Childrens = childlist; #endregion info.CompanyId = CurrentUserCompanyID; info.Coordinator = new EyouSoft.Model.TourStructure.TourCoordinatorInfo() { CoordinatorId = Utils.GetInt(Utils.GetFormValue("sel_oprator")) }; info.CreateRule = new EyouSoft.Model.TourStructure.TourCreateRuleInfo() { Cycle = null, EDate = null, Rule = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.日期, SDate = applyModel.LDate }; info.CreateTime = DateTime.Now; info.Gather = Utils.GetFormValue("txt_jhfs"); info.GatheringPlace = Utils.GetFormValue("txt_jhdd"); info.GatheringSign = Utils.GetFormValue("txt_jhbz"); info.GatheringTime = Utils.GetFormValue("txt_jhdate"); info.LDate = applyModel.LDate; info.LTraffic = Utils.GetFormValue("txt_qcDate"); info.OperatorId = SiteUserInfo.ID; info.ORouteId = model.RouteId; info.PlanPeopleNumber = Utils.GetInt(Utils.GetFormValue("txt_ykrs")); info.PriceStandards = model.PriceStandards; //info.RDate info.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Quick; info.RouteId = model.RouteId; info.RouteName = model.RouteName; info.RTraffic = Utils.GetFormValue("txt_hcDate"); //info.SellerId //info.SellerName info.Status = EyouSoft.Model.EnumType.TourStructure.TourStatus.正在收客; info.TicketStatus = EyouSoft.Model.EnumType.PlanStructure.TicketState.None; info.TourCode = Utils.GetFormValue("txt_tuanhao"); info.TourDays = model.TourDays; //info.TourId info.TourQuickInfo = new EyouSoft.Model.TourStructure.TourQuickPrivateInfo() { QuickPlan = model.TourQuickInfo.QuickPlan, Remark = model.TourQuickInfo.Remark, Service = model.TourQuickInfo.Service }; info.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划; info.VirtualPeopleNumber = 0; #endregion int j = bl.BuildTour(info, tourId, ApplyId); if (j > 0) { Response.Write("<script>alert('生成计划成功!');parent.location.href=parent.location.href;</script>"); BindInfo(); } else { EyouSoft.Common.Function.MessageBox.Show(this, "生成失败"); BindInfo(); } }