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); }
private void Save() { EyouSoft.BLL.TourStructure.LineInquireQuoteInfo tsBLL = new EyouSoft.BLL.TourStructure.LineInquireQuoteInfo(); tsModel = new LineInquireQuoteInfo(); //初始化model tid = Utils.GetInt(Utils.GetFormValue("tid")); //获取表操作值 bool res; if (tid > 0) { tsModel = tsBLL.GetQuoteModel(tid, 0, SiteUserInfo.TourCompany.TourCompanyId, true); xcModel = tsModel.XingCheng; } /////////////////////////////////////普通数据 tsModel.CustomerName = SiteUserInfo.TourCompany.CompanyName; //询价单位=当前单位名称??编号?? tsModel.ContactName = SiteUserInfo.ContactInfo.ContactName; //联系人姓名 tsModel.CustomerId = SiteUserInfo.TourCompany.TourCompanyId; //询价单位编号 tsModel.CompanyId = SiteUserInfo.CompanyID; //专线公司编号 tsModel.ContactTel = Utils.GetFormValue("vontactTel").ToString(); //联系人电话 tsModel.RouteName = xianluWindow1.Name; //线路名称 tsModel.RouteId = Utils.GetInt(xianluWindow1.Id); //线路ID tsModel.LeaveDate = Convert.ToDateTime(this.txtLDate.Text); //预计出团日期 tsModel.PeopleNum = Utils.GetInt(Utils.GetFormValue("number")); //人数??总人数??成人数??儿童数?? /////////////////////////////////////行程要求////////上传验证 if (string.IsNullOrEmpty(xcModel.PlanAccessory)) { string[] allowExtensions = new string[] { ".jpeg", ".jpg", ".bmp", ".gif", ".pdf", ".xls", ".xlsx", ".doc", ".docx" }; string msg = string.Empty; bool nameForm = EyouSoft.Common.Function.UploadFile.CheckFileType(Request.Files, "workAgree", allowExtensions, null, out msg); if (!nameForm) { lstMsg.Text = msg; } } ////////////////////////////////////行程要求////////上传文件 if (Request.Files.Count > 0)//上传 { string filepath = string.Empty; string oldfilename = string.Empty; bool result = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["workAgree"], "SupplierControlFile", out filepath, out oldfilename); if (result) { xcModel.PlanAccessoryName = oldfilename;//协议名 xcModel.PlanAccessory = filepath; } } /////////////////////////////////////////行程要求////文本输入 xcModel.QuotePlan = Utils.EditInputText(txt_xinchen.Text); tsModel.XingCheng = xcModel; //行程要求=输入框+附件 tsModel.Requirements = ConProjectControl1.GetDataList(); //客人要求 tsModel.SpecialClaim = Utils.GetFormValue("quotePlan");; //特殊要求说明 ///////////////////////////////////////游客信息 int cusLength = Utils.GetFormValues("cusName").Length; tsModel.Traveller = new TourEverydayApplyTravellerInfo(); tsModel.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 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]); toc.Sex = (EyouSoft.Model.EnumType.CompanyStructure.Sex)cusSex; #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; } } tsModel.Traveller.Travellers.Add(toc); } /// if (tid > 0 && lstMsg.Text == "") { tsModel.Id = tid; res = tsBLL.UpdateInquire(tsModel); } else { res = tsBLL.AddInquire(tsModel); } if (res) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, ";alert('保存成功!');location.href='SelectMoney.aspx';</script>"); } else { EyouSoft.Common.Function.MessageBox.ResponseScript(this, ";alert('保存失败!');"); } }
/// <summary> /// 提交数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtn_save_Click(object sender, EventArgs e) { #region 获取基础数据 EyouSoft.BLL.TourStructure.TourEveryday bll = new EyouSoft.BLL.TourStructure.TourEveryday(SiteUserInfo); EyouSoft.Model.TourStructure.TourEverydayInfo model = new EyouSoft.Model.TourStructure.TourEverydayInfo(); model.AreaId = Utils.GetInt(Utils.GetFormValue(ddl_area.UniqueID)); model.CompanyId = CurrentUserCompanyID; model.CreateTime = DateTime.Now; model.OperatorId = SiteUserInfo.ID; IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> pricelist = new List <EyouSoft.Model.TourStructure.TourPriceStandardInfo>(); IList <EyouSoft.Model.CompanyStructure.CustomStand> listcus = new List <EyouSoft.Model.CompanyStructure.CustomStand>(); EyouSoft.BLL.CompanyStructure.CompanyCustomStand bllCom = new CompanyCustomStand(); listcus = bllCom.GetCustomStandByCompanyId(CurrentUserCompanyID); int kkk = listcus.Count; for (int k = 0; k < Utils.GetFormValues("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 (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++) { 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 = Utils.GetInt(Utils.GetFormValues("hd_cusStandId")[i]); if (level.LevelId == 0) { continue; } listLevels.Add(level); } price.CustomerLevels = listLevels; pricelist.Add(price); } IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> levelList = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>(); model.PriceStandards = pricelist; model.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal; model.RouteId = Utils.GetInt(selectXl.Id); model.RouteName = selectXl.Name; model.TourDays = Utils.GetInt(Utils.GetFormValue(txt_Days.UniqueID)); EyouSoft.Model.TourStructure.TourNormalPrivateInfo privateInfo = new EyouSoft.Model.TourStructure.TourNormalPrivateInfo(); privateInfo.BuHanXiangMu = Utils.GetFormValue(txt_noProject.UniqueID); privateInfo.ErTongAnPai = Utils.GetFormValue(txt_child.UniqueID); privateInfo.GouWuAnPai = Utils.GetFormValue(txt_buy.UniqueID); privateInfo.NeiBuXingXi = Utils.GetFormValue(txt_nbinfo.UniqueID); privateInfo.Plans = xingcheng1.GetValues(); privateInfo.Services = ConProjectControl1.GetDataList(); privateInfo.WenXinTiXing = Utils.GetFormValue(txt_Reminded.UniqueID); privateInfo.ZhuYiShiXiang = Utils.GetFormValue(txt_Note.UniqueID); privateInfo.ZiFeiXIangMu = Utils.GetFormValue(txt_owner.UniqueID); model.TourNormalInfo = privateInfo; #region 附件 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, "dayDayPublish", 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); model.Attachs = listAttachs; #endregion #endregion #region 数据库修改或添加 if (Request.QueryString["act"] == "update") { model.TourId = Utils.GetQueryStringValue("id"); int i = bll.UpdateTourEverydayInfo(model); if (i > 0) { EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "修改成功!", "DaydayPublish.aspx"); } else { EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "修改失败!", Request.Url.ToString()); } } else { int i = bll.InsertTourEverydayInfo(model); if (i > 0) { EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "添加成功!", "DaydayPublish.aspx"); } else { EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "添加失败!", Request.Url.ToString()); } } #endregion }
/// <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 }