/// <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(); } }
/// <summary> /// 保存事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSubmit_Click(object sender, EventArgs e) { NumConfig = (int)(new EyouSoft.BLL.CompanyStructure.CompanySetting().GetTeamNumberOfPeople(CurrentUserCompanyID)); #region 将表单值赋值于变量 //团号 string teamNum = this.txtTeamNum.Text.Trim(); //线路区域名 string lineArea = Utils.GetFormValue(this.ddlLineArea.UniqueID); //计调员 string coordinatorId = Utils.GetFormValue(this.ddlSeller.UniqueID); //线路名称 string xianLuName = this.xianluWindow1.Name; //线路ID string routeId = this.xianluWindow1.Id; //组团社ID int buyerCId = Utils.GetInt(this.hideGroupsId.Value); //组团社名称 string buyerCName = Utils.GetFormValue(this.txtGroupsName.UniqueID); //天数 int?dayCount = Utils.GetIntNull(this.txtDayCount.Text); //人数 int?peopleCount = Utils.GetIntNull(this.txtPeopelCount.Text); //出发交通 string startTraffic = this.txtStartTraffic.Text.Trim(); //返程交通 string endTraffic = this.txtEndTraffic.Text.Trim(); //出团日期 DateTime lDate = Utils.GetDateTime(this.txtLDate.Text); //不含项目 string noProject = this.txtNoProject.Text.Trim(); //购物安排 string buyPlan = this.txtBuyPlan.Text; //儿童安排 string childPlan = this.txtChildPlan.Text; //自费项目 string selfProject = this.txtSelfProject.Text; //注意事项 string note = this.txtNote.Text; //温馨提示 string tips = this.txtTips.Text; //内部信息 string internalMsg = this.txtNeiBu.Text; //集合时间 //string gatheredTime = (Utils.GetFormValue(this.txtGathered.UniqueID)) + " " + ddl_jh_date.SelectedValue + ":00:00"; string gatheredTime = Utils.GetFormValue(this.txtGathered.UniqueID); //集合地点 string place = Utils.GetFormValue(this.txtPlace.UniqueID); //集合标志 string logo = Utils.GetFormValue(this.txtLogo.UniqueID); //送团人 string operatorId = this.selectOperator1.OperId; //常用城市 int tourCity = Utils.GetInt(Utils.GetFormValue(this.ddlCityList.UniqueID)); #endregion #region 验证上传文件的格式是否正确 string msg = ""; if (!EyouSoft.Common.Function.UploadFile.CheckFileType(Request.Files, "fileField", new[] { ".gif", ".jpeg", ".jpg", ".png", ".xls", ".doc", ".docx", ".rar", ".txt" }, null, out msg)) { this.litMsg.Text = Utils.ShowMsg(msg); return; } #endregion #region 地接信息 IList <EyouSoft.Model.TourStructure.TourLocalAgencyInfo> djList = this.DiJieControl1.GetList; #endregion #region 行程安排 IList <EyouSoft.Model.TourStructure.TourPlanInfo> planList = this.xingcheng1.GetValues(); #endregion #region 包含项目 IList <EyouSoft.Model.TourStructure.TourTeamServiceInfo> standList = this.PriceControl1.GetList; #endregion #region 验证 if (lineArea == "") { this.litMsg.Text = Utils.ShowMsg("请选择线路区域!"); return; } //判断是否选择组团社 if (buyerCId <= 0) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请选择组团社!")); return; } if (xianLuName == "") { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请输入线路名称!")); return; } if (coordinatorId == "-1") { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请选择计调员!")); return; } if (dayCount == null || dayCount == 0) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请输入天数!")); return; } if ((peopleCount == null || peopleCount == 0) && NumConfig == (int)EyouSoft.Model.EnumType.CompanyStructure.TeamNumberOfPeople.OnlyTotalNumber) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请输入人数!")); return; } int crNum = Utils.GetInt(txt_crNum.Text); if (crNum == 0 && NumConfig == (int)EyouSoft.Model.EnumType.CompanyStructure.TeamNumberOfPeople.PartNumber) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请输入人数!")); return; } #endregion //声明bll对象 EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo); //声明model对象 EyouSoft.Model.TourStructure.TourTeamInfo model = new EyouSoft.Model.TourStructure.TourTeamInfo(); //如果是修改那么先获得该对象model if (this.hideType.Value == "Update") { //如果是修改操作,那么先获的这个对象 model = (EyouSoft.Model.TourStructure.TourTeamInfo)bll.GetTourInfo(this.hideID.Value); } //判断对象是否存在 if (model != null) { #region 对象属性赋值 model.TourCode = teamNum; model.AreaId = Convert.ToInt32(lineArea); //修改时原购买单位 if (model.BuyerCId > 0) { model.OBuyerCId = model.BuyerCId; } model.Coordinator = new EyouSoft.Model.TourStructure.TourCoordinatorInfo(); model.Coordinator.CoordinatorId = Utils.GetInt(coordinatorId); model.BuyerCId = buyerCId; model.BuyerCName = buyerCName; model.RouteName = xianLuName; if (model.RouteId != 0) { model.ORouteId = model.RouteId; } model.RouteId = Utils.GetInt(routeId); model.TourDays = Convert.ToInt32(dayCount); #region 添加送团人 if (this.selectOperator1.OperId.Trim() != "") { string[] operIdList = this.selectOperator1.OperId.Split(','); if (operIdList.Count() > 0) { model.SentPeoples = new List <EyouSoft.Model.TourStructure.TourSentPeopleInfo>(); for (int i = 0; i < operIdList.Count(); i++) { if (operIdList[i].Trim() != "") { EyouSoft.Model.TourStructure.TourSentPeopleInfo sentPeopleModel = new EyouSoft.Model.TourStructure.TourSentPeopleInfo(); sentPeopleModel.OperatorId = Utils.GetInt(operIdList[i]); model.SentPeoples.Add(sentPeopleModel); } } } } #endregion model.GatheringPlace = place; model.GatheringSign = logo; model.GatheringTime = gatheredTime; model.PlanPeopleNumber = Convert.ToInt32(peopleCount); model.LTraffic = startTraffic; model.RTraffic = endTraffic; model.LDate = lDate; model.LocalAgencys = djList; EyouSoft.Model.TourStructure.TourTeamNormalPrivateInfo tourTeamModel = new EyouSoft.Model.TourStructure.TourTeamNormalPrivateInfo(); tourTeamModel.Plans = planList; tourTeamModel.BuHanXiangMu = noProject; tourTeamModel.GouWuAnPai = buyPlan; tourTeamModel.ErTongAnPai = childPlan; tourTeamModel.ZiFeiXIangMu = selfProject; tourTeamModel.ZhuYiShiXiang = note; tourTeamModel.WenXinTiXing = tips; tourTeamModel.NeiBuXingXi = internalMsg; model.TourNormalInfo = tourTeamModel; model.Services = standList; model.CompanyId = SiteUserInfo.CompanyID; model.OperatorId = SiteUserInfo.ID; model.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.团队计划; model.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal; model.TicketStatus = EyouSoft.Model.EnumType.PlanStructure.TicketState.None; model.TotalAmount = PriceControl1.TotalAmount; //model.SelfUnitPriceAmount = PriceControl1.OnePriceAll; model.TourCityId = tourCity; model.TourTraffic = new List <int>() { Utils.GetInt(Utils.GetFormValue("selectTraffic"), -1) }; ///人数、单价 by txb model.TourTeamUnit = new EyouSoft.Model.TourStructure.MTourTeamUnitInfo(); model.TourTeamUnit.NumberCr = Utils.GetInt(txt_crNum.Text); model.TourTeamUnit.NumberEt = Utils.GetInt(txt_rtNum.Text); model.TourTeamUnit.NumberQp = Utils.GetInt(txt_allNum.Text); model.TourTeamUnit.UnitAmountCr = PriceControl1.cr_price; model.TourTeamUnit.UnitAmountEt = PriceControl1.rt_price; model.TourTeamUnit.UnitAmountQp = PriceControl1.all_price; #endregion #region 单文件 //团队附件实体 EyouSoft.Model.TourStructure.TourAttachInfo attachModel = new EyouSoft.Model.TourStructure.TourAttachInfo(); //文件路径 string filePath = ""; //文件名 string fileName = ""; //文件上传 if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["fileField"], "TeamPlanFile", out filePath, out fileName)) { if (filePath.Trim() != "" && fileName.Trim() != "") { //设置文件上传后的虚拟路劲 attachModel.FilePath = filePath; //保存原文件名 attachModel.Name = fileName; IList <EyouSoft.Model.TourStructure.TourAttachInfo> attachList = new List <EyouSoft.Model.TourStructure.TourAttachInfo>(); attachList.Add(attachModel); model.Attachs = attachList; } else if (this.hideData.Value.Trim() != "") { //设置文件上传后的虚拟路劲 attachModel.FilePath = this.hideData.Value; IList <EyouSoft.Model.TourStructure.TourAttachInfo> attachList = new List <EyouSoft.Model.TourStructure.TourAttachInfo>(); attachList.Add(attachModel); model.Attachs = attachList; } else { model.Attachs = null; } } else { //上传失败提示 this.litMsg.Text = Utils.ShowMsg("文件上传失败!"); return; } #endregion #region 数据操作 int count = 0; if (model.TourTraffic != null && model.TourTraffic.Count > 0) { EyouSoft.BLL.PlanStruture.PlanTrffic BLL = new EyouSoft.BLL.PlanStruture.PlanTrffic(); EyouSoft.Model.PlanStructure.TrafficPricesInfo TrafficPricesInfoModel = BLL.GetTrafficPriceModel(model.TourTraffic.First(), model.LDate); if (TrafficPricesInfoModel != null && TrafficPricesInfoModel.TicketNums > 0) { //新增和复制操作时 进行数据添加操作 if (this.hideType.Value == "Add" || this.hideType.Value == "Copy") { //数据库添加操作 count = bll.InsertTeamTourInfo(model); //新增成功 if (count > 0) { Utils.ShowAndRedirect("添加成功!", "/TeamPlan/TeamPlanList.aspx"); } else //失败时提示 if (count == -1) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, "javascript:alert('团号重复!');"); } else { EyouSoft.Common.Function.MessageBox.ResponseScript(this, "javascript:alert('添加失败!');"); } } else { //数据库修改操作 count = bll.UpdateTeamTourInfo(model); //成功提示 if (count > 0) { Utils.ShowAndRedirect("修改成功!", "/TeamPlan/TeamPlanList.aspx"); } else { EyouSoft.Common.Function.MessageBox.ResponseScript(this, "javascript:alert('修改失败!');"); } } } else { Response.Write("<script type='text/javascript'>alert('提交失败,关联交通票数为零!');location.href=location.href;</script>"); } } else { Response.Write("<script type='text/javascript'>alert('提交失败,关联交通为空!');location.href=location.href;</script>"); } #endregion } else { Utils.ShowAndRedirect("该计划不存在!", "/TeamPlan/TeamPlanList.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindCusList(); string tourId = Utils.GetQueryStringValue("tourId"); //声明bll对象 EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo); //声明团队计划对象 EyouSoft.Model.TourStructure.TourInfo model = (EyouSoft.Model.TourStructure.TourInfo)bll.GetTourInfo(tourId); if (model != null) { lt_routName.Text = model.RouteName; #region 专线 EyouSoft.Model.CompanyStructure.ContactPersonInfo userInfoModel = new EyouSoft.BLL.CompanyStructure.CompanyUser().GetUserBasicInfo(model.OperatorId); if (userInfoModel != null) { txt_Ldate.Value = model.LDate.ToString("yyyy-MM-dd"); txt_lxr2.Value = userInfoModel.ContactName; //主要联系人电话 this.txt_tel2.Value = userInfoModel.ContactTel; //专线FAX this.txt_fax2.Value = userInfoModel.ContactFax; EyouSoft.Model.CompanyStructure.CompanyInfo companyModel = new EyouSoft.BLL.CompanyStructure.CompanyInfo().GetModel(model.CompanyId, SiteUserInfo.SysId); if (companyModel != null) { txt_fax2.Value = companyModel.ContactFax; txt_tel2.Value = companyModel.ContactTel; txt_lxr2.Value = companyModel.ContactName; this.txtyfJbr.Value = companyModel.ContactName; } } #endregion txt_HCHB.Value = model.RTraffic; txt_QCHB.Value = model.LTraffic; if (model.ReleaseType == EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal) { txt_jhDate.Value = model.GatheringTime; //txt_str.Value = model.SentPeoples.FirstOrDefault().OperatorName; EyouSoft.Model.TourStructure.TourSentPeopleInfo sentModel = model.SentPeoples.FirstOrDefault(); if (sentModel != null) { txt_str.Value = sentModel.OperatorName; } txt_jhdd.Value = model.GatheringPlace; txt_jhBZ.Value = model.GatheringSign; xc_Normarl.Visible = true; tb_service_normal.Visible = true; //出团日期 LeaveDate = model.LDate; this.rptTravel.DataSource = model.TourNormalInfo.Plans; this.rptTravel.DataBind(); //不含项目 this.lblNoProject.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.BuHanXiangMu); //购物安排 this.lblBuy.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.GouWuAnPai); //儿童安排 this.lblChildPlan.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.ErTongAnPai); //自费项目 this.lblSelfProject.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.ZiFeiXIangMu); //注意事项 this.lblNote.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.ZhuYiShiXiang); //温馨提示 this.lblTips.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.WenXinTiXing); //行程安排 this.rptTravel.DataSource = model.TourNormalInfo.Plans; this.rptTravel.DataBind(); //包含项目 this.rptProject.DataSource = model.TourNormalInfo.Services; this.rptProject.DataBind(); } else { tb_service_quick.Visible = true; xc_quick.Visible = true; litTravel.Text = model.TourQuickInfo.QuickPlan; litService.Text = model.TourQuickInfo.Service; } } } }
/// <summary> /// 提交事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtn_save_Click(object sender, EventArgs e) { if (Request.QueryString["act"] == "update") { actType = 1; } if (Request.QueryString["act"] == "copy") { actType = 2; } #region 基础数据绑定 IList <EyouSoft.Model.CompanyStructure.CustomStand> listcus = new List <EyouSoft.Model.CompanyStructure.CustomStand>(); EyouSoft.BLL.CompanyStructure.CompanyCustomStand bllCom = new CompanyCustomStand(); EyouSoft.BLL.TourStructure.Tour tour = new EyouSoft.BLL.TourStructure.Tour(); EyouSoft.Model.TourStructure.TourInfo info = new EyouSoft.Model.TourStructure.TourInfo(); if (actType == 1) { info = (EyouSoft.Model.TourStructure.TourInfo)tour.GetTourInfo(Utils.GetQueryStringValue("id")); } listcus = bllCom.GetCustomStandByCompanyId(CurrentUserCompanyID); int kkk = listcus.Count; string[] st = Utils.GetFormValues("eat"); List <EyouSoft.Model.TourStructure.TourPlanInfo> list = xingcheng1.GetValues(); info.AreaId = EyouSoft.Common.Utils.GetInt(Request.Form[ddl_area.UniqueID]); info.RouteName = selectXl.Name; info.TourDays = EyouSoft.Common.Utils.GetInt(txt_Days.Text); info.PlanPeopleNumber = 1;//EyouSoft.Common.Utils.GetInt(txt_pepoleNum.Text); info.TourTraffic = GetSelectTraffic(); EyouSoft.Model.TourStructure.TourCreateRuleInfo rule = new EyouSoft.Model.TourStructure.TourCreateRuleInfo(); if (actType == 0 || actType == 2) { string gz = createTea1.getGuiZe(); rule.EDate = EyouSoft.Common.Utils.GetDateTime(Utils.GetFromQueryStringByKey(gz, "end")); rule.SDate = EyouSoft.Common.Utils.GetDateTime(Utils.GetFromQueryStringByKey(gz, "start")); switch (Utils.GetFromQueryStringByKey(gz, "type")) { case "1": { rule.Cycle = Utils.GetFromQueryStringByKey(gz, "data"); rule.Rule = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.星期; } break; case "2": { rule.Cycle = Utils.GetFromQueryStringByKey(gz, "data"); rule.Rule = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.天数; } break; case "3": { rule.SDate = null; rule.EDate = null; rule.Cycle = null; rule.Rule = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.日期; } break; } info.CreateRule = rule; } #region 出团信息 info.LTraffic = txt_startTraffic.Text; info.RTraffic = txt_endTraffic.Text; 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; //string time = txt_jh_date.Text + " " + ddl_jh_date.SelectedValue + ":00:00"; //info.GatheringTime = Utils.GetDateTimeNullable(time) == null ? string.Empty : time; info.GatheringTime = Utils.GetFormValue(txt_jh_date.UniqueID); info.GatheringPlace = txt_jh_area.Text; info.GatheringSign = txt_jh_logo.Text; #endregion IList <EyouSoft.Model.TourStructure.TourLocalAgencyInfo> local; local = DiJieControl1.GetList; info.LocalAgencys = local; info.CompanyId = CurrentUserCompanyID; IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> pricelist = new List <EyouSoft.Model.TourStructure.TourPriceStandardInfo>(); string[] ddl_price = Utils.GetFormValues("ddl_price"); for (int k = 0; k < ddl_price.Length; k++) { EyouSoft.Model.TourStructure.TourPriceStandardInfo price = new EyouSoft.Model.TourStructure.TourPriceStandardInfo(); price.StandardId = Utils.GetInt(Utils.GetFormValues("ddl_price")[k].Split('|')[0]); if (ddl_price[k] == "" || price.StandardId == 0) { continue; } price.StandardName = Utils.GetFormValues("ddl_price")[k].Split('|')[1]; IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> listLevels = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>(); string[] crPrice = Utils.GetFormValues("txt_cr_price"); for (int i = 0; i < kkk; i++) { int levId = Utils.GetInt(Utils.GetFormValues("hd_cusStandId")[i]); if (levId == 0) { continue; } EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo level = new EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo(); level.AdultPrice = Utils.GetDecimal(Utils.GetFormValues("txt_cr_price")[i + kkk * k]); level.ChildrenPrice = Utils.GetDecimal(Utils.GetFormValues("txt_rt_price")[i + kkk * k]); level.LevelType = EyouSoft.Model.EnumType.CompanyStructure.CustomLevType.其他; level.LevelName = Utils.GetFormValues("hd_cusStandName")[i]; level.LevelId = levId; listLevels.Add(level); } price.CustomerLevels = listLevels; pricelist.Add(price); } IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> levelList = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>(); info.PriceStandards = pricelist; IList <EyouSoft.Model.TourStructure.TourPlanInfo> ilist = new List <EyouSoft.Model.TourStructure.TourPlanInfo>(); ilist = xingcheng1.GetValues(); info.TourNormalInfo = new EyouSoft.Model.TourStructure.TourNormalPrivateInfo(); info.TourNormalInfo.Plans = ilist; IList <EyouSoft.Model.TourStructure.TourAttachInfo> listAttachs = new List <EyouSoft.Model.TourStructure.TourAttachInfo>(); EyouSoft.Model.TourStructure.TourAttachInfo attInfo = new EyouSoft.Model.TourStructure.TourAttachInfo(); string fileAtt = ""; string oldfileAtt = ""; if (EyouSoft.Common.Function.UploadFile.FileUpLoad(FileUpload1.PostedFile, "sanping", out fileAtt, out oldfileAtt)) { attInfo.FilePath = fileAtt; } else { EyouSoft.Common.Function.MessageBox.Show(this.Page, "上传附件失败!"); return; } if (attInfo.FilePath.Length < 1) { attInfo.FilePath = hd_img.Value; } listAttachs.Add(attInfo); info.TourNormalInfo.Services = ConProjectControl1.GetDataList(); info.TourNormalInfo.BuHanXiangMu = txt_noProject.Value; info.TourNormalInfo.GouWuAnPai = txt_buy.Value; info.TourNormalInfo.ErTongAnPai = txt_child.Value; info.TourNormalInfo.ZiFeiXIangMu = txt_owner.Value; info.TourNormalInfo.ZhuYiShiXiang = txt_Note.Value; info.TourNormalInfo.WenXinTiXing = txt_Reminded.Value; info.Attachs = listAttachs; //info.TourDays = createTea1.getDays(); info.OperatorId = SiteUserInfo.ID; info.TourNormalInfo.NeiBuXingXi = Utils.GetFormValue(txt_nbinfo.UniqueID); info.Coordinator = new EyouSoft.Model.TourStructure.TourCoordinatorInfo(); info.Coordinator.CoordinatorId = Utils.GetInt(Utils.GetFormValue("sel_oprator")); info.TourCityId = Utils.GetInt(Utils.GetFormValue(ddl_city.UniqueID)); #endregion #region 新增操作 if (actType == 0 || actType == 2) { info.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal; info.Status = EyouSoft.Model.EnumType.TourStructure.TourStatus.正在收客; info.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划; info.TicketStatus = EyouSoft.Model.EnumType.PlanStructure.TicketState.None; IList <EyouSoft.Model.TourStructure.TourChildrenInfo> listChild = new List <EyouSoft.Model.TourStructure.TourChildrenInfo>(); string[] childTeamNum = Utils.GetFormValue("hidToursNumbers").Split(','); string[] tourcodes = new string[childTeamNum.Length]; for (int i = 0; i < childTeamNum.Length; i++) { ///子团 EyouSoft.Model.TourStructure.TourChildrenInfo child = new EyouSoft.Model.TourStructure.TourChildrenInfo(); child.TourCode = childTeamNum[i].Split('}')[1]; child.LDate = Utils.GetDateTime(childTeamNum[i].Split('{')[0]); listChild.Add(child); tourcodes[i] = child.TourCode; } info.Childrens = listChild; IList <string> list_tourCode = tour.ExistsTourCodes(SiteUserInfo.CompanyID, null, tourcodes); if (list_tourCode.Count > 0) { Response.Write("<script>alert('" + string.Join(",", list_tourCode.ToArray()) + "团号已经存在!');location.href=location.href;</script>"); return; } int ii = tour.InsertTourInfo(info); if (ii > 0) { Response.Write("<script>alert('添加成功!');location.href='default.aspx';</script>"); } else { EyouSoft.Common.Function.MessageBox.Show(this.Page, "添加失败!请重试"); } } #endregion #region 修改操作 else { if (!Utils.PlanIsUpdateOrDelete(info.Status.ToString())) { Response.Write("<script>alert('该团已提交财务,不能对它操作!');location.href=location.href;</script>"); return; } info.TourId = Request.QueryString["id"]; info.Childrens = null; info.TourCode = txt_teamNum.Value; IList <string> list_tourCode = tour.ExistsTourCodes(SiteUserInfo.CompanyID, info.TourId, info.TourCode); if (list_tourCode.Count > 0) { Response.Write("<script>alert('团号已经存在!');location.href=location.href;</script>"); return; } int ii = tour.UpdateTourInfo(info); if (ii > 0) { Response.Write("<script>alert('修改成功!');location.href='default.aspx';</script>"); return; } else { EyouSoft.Common.Function.MessageBox.Show(this.Page, "修改失败!请重试"); return; } } #endregion }