protected void InitBindLinePro() { //线路区域编号 int LineTypeID = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.ddlLineType.UniqueID), "")); if (LineTypeID == 0) { SetErrorMsg(false, "请选择线路区域!"); return; } //线路名称 string LineName = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.txt_LineName.UniqueID.Trim()), ""); if (LineName == "") { SetErrorMsg(false, "请填写线路名称!"); return; } //线路描述 string Desriptoin = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_XianlDescript.UniqueID.Trim()), ""); //旅游天数 int Days = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.Txt_Days.UniqueID.Trim())); if (Days == 0) { SetErrorMsg(false, "请填写旅游天数!"); return; } //不包含项目 string ProjectNo = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_XianlProjectNo.UniqueID.Trim()), ""); //购物安排 string ShoppPlan = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_ShoppPlan.UniqueID.Trim()), ""); //儿童安排 string ChildPlan = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_ChildPlan.UniqueID.Trim()), ""); //自费项目 string Expensce = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_expensce.UniqueID.Trim()), ""); //注意事项 string Notes = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_Notes.UniqueID.Trim()), ""); //温馨提醒 string Remind = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_Remind.UniqueID.Trim()), ""); //内部信息 string Reception = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_Reception.UniqueID.Trim()), ""); //线路库业务逻辑类 EyouSoft.BLL.RouteStructure.Route Route = new EyouSoft.BLL.RouteStructure.Route(); //线路基本信息实体类 EyouSoft.Model.RouteStructure.RouteInfo Routeinfo = new EyouSoft.Model.RouteStructure.RouteInfo(); Routeinfo.AreaId = LineTypeID; Routeinfo.RouteName = LineName; Routeinfo.RouteDepict = Desriptoin; Routeinfo.RouteDays = Days; Routeinfo.Attachs = new List <EyouSoft.Model.TourStructure.TourAttachInfo>(); //标准发布团队行程信息业务实体 Routeinfo.RouteNormalInfo = new EyouSoft.Model.TourStructure.TourNormalPrivateInfo(); #region 包含项目 Routeinfo.RouteNormalInfo.Services = this.ProjectControl1.GetDataList(); Routeinfo.RouteNormalInfo.WenXinTiXing = Remind; Routeinfo.RouteNormalInfo.ZhuYiShiXiang = Notes; Routeinfo.RouteNormalInfo.ZiFeiXIangMu = Expensce; #endregion #region 获取行程信息 List <EyouSoft.Model.TourStructure.TourPlanInfo> PlanInfo = this.xingcheng1.GetValues(); Routeinfo.RouteNormalInfo.Plans = PlanInfo; Routeinfo.RouteNormalInfo.BuHanXiangMu = ProjectNo; Routeinfo.RouteNormalInfo.ErTongAnPai = ChildPlan; Routeinfo.RouteNormalInfo.GouWuAnPai = ShoppPlan; Routeinfo.RouteNormalInfo.NeiBuXingXi = Reception; #endregion #region 附件 //线路附件实体 EyouSoft.Model.TourStructure.TourAttachInfo TourAttachInfo = new EyouSoft.Model.TourStructure.TourAttachInfo(); //文件路径 string filePath = string.Empty; //文件名 string fileName = string.Empty; HttpPostedFile FileUpload = Request.Files["fileUpLoad"]; if (!string.IsNullOrEmpty(FileUpload.FileName) && FileUpload.ContentLength > 0) { //文件上传 if (EyouSoft.Common.Function.UploadFile.FileUpLoad(FileUpload, "LineListFile", out filePath, out fileName)) { if (filePath.Trim() != "" && fileName.Trim() != "") { //设置文件上传后的虚拟路劲 TourAttachInfo.FilePath = filePath; //保存原文件名 TourAttachInfo.Name = fileName; Routeinfo.Attachs.Add(TourAttachInfo); } } else { //上传失败提示 this.litMsg.Text = EyouSoft.Common.Utils.ShowMsg("文件上传失败!"); return; } } else { TourAttachInfo.FilePath = hidOldFilePath.Value; TourAttachInfo.Name = hidOldName.Value; Routeinfo.Attachs.Add(TourAttachInfo); } #endregion //公司编号 Routeinfo.CompanyId = SiteUserInfo.CompanyID; //当前操作员编号 Routeinfo.OperatorId = SiteUserInfo.ID; //当前操作员姓名 if (SiteUserInfo.ContactInfo != null) { Routeinfo.OperatorName = SiteUserInfo.ContactInfo.ContactName; } string hidType = EyouSoft.Common.Utils.GetFormValue(this.hideType.UniqueID); #region 列表线路数据修改 if (hidType == "update") { //线路编号 int RouteId = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hidRouteid.UniqueID)); Routeinfo.RouteId = RouteId; } #endregion #region 导航菜单线路数据修改 if (hidType == "UpdateT") { //线路编号 int RouteID = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hidRouteid.UniqueID)); Routeinfo.RouteId = RouteID; } #endregion #region 制线路信息 if (hidType == "Copy") { //线路编号 int RouteID = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hidRouteid.UniqueID)); Routeinfo.RouteId = RouteID; } #endregion if (hidType == "Copy") { if (Route.InsertRouteInfo(Routeinfo) > 0) { SetErrorMsg(true, "线路信息添加成功!"); } else { SetErrorMsg(false, "线路信息添加失败!"); } } if (hidType == "update" || hidType == "UpdateT") { if (Route.UpdateRouteInfo(Routeinfo) > 0) { SetErrorMsg(true, "线路信息修改成功!"); } else { SetErrorMsg(false, "线路信息修改失败!"); } } }
protected void InitLineInfo(int RouteId) { EyouSoft.BLL.RouteStructure.Route Bll_Route = new EyouSoft.BLL.RouteStructure.Route(); EyouSoft.Model.RouteStructure.RouteInfo Model_Routeinfo = new EyouSoft.Model.RouteStructure.RouteInfo(); //根据线路区域编号获取线路信息 Model_Routeinfo = Bll_Route.GetRouteInfo(RouteId); if (Model_Routeinfo != null) { //线路区域编号 if (this.ddlLineType.Items.FindByValue(Model_Routeinfo.AreaId.ToString()) != null) { this.ddlLineType.Items.FindByValue(Model_Routeinfo.AreaId.ToString()).Selected = true; } //线路名称 this.txt_LineName.Value = Model_Routeinfo.RouteName; //线路描述 this.Txt_XianlDescript.Value = Model_Routeinfo.RouteDepict; //旅游天数 this.Txt_Days.Value = Convert.ToString(Model_Routeinfo.RouteDays); //行程信息集合 this.xingcheng1.Bind(Model_Routeinfo.RouteNormalInfo.Plans.ToList()); //附件信息 IList <EyouSoft.Model.TourStructure.TourAttachInfo> attachList = Model_Routeinfo.Attachs; if (attachList.Count > 0 && attachList != null) { EyouSoft.Model.TourStructure.TourAttachInfo fileModel = attachList[0]; hypFilePath.NavigateUrl = fileModel.FilePath; this.hidOldName.Value = fileModel.Name; this.hidOldFilePath.Value = fileModel.FilePath; if (fileModel.Name.Trim() == "") { this.pnlFile.Visible = false; } } else { this.pnlFile.Visible = false; } //包含信息项目 this.ProjectControl1.SetList = Model_Routeinfo.RouteNormalInfo.Services; this.ProjectControl1.SetDataList(); //不包含项目 this.Txt_XianlProjectNo.Value = Model_Routeinfo.RouteNormalInfo.BuHanXiangMu; //儿童安排 this.Txt_ChildPlan.Value = Model_Routeinfo.RouteNormalInfo.ErTongAnPai; //购物安排 this.Txt_ShoppPlan.Value = Model_Routeinfo.RouteNormalInfo.GouWuAnPai; //内部信息 this.Txt_Reception.Value = Model_Routeinfo.RouteNormalInfo.NeiBuXingXi; //温馨提醒 this.Txt_Remind.Value = Model_Routeinfo.RouteNormalInfo.WenXinTiXing; //主要事项 this.Txt_Notes.Value = Model_Routeinfo.RouteNormalInfo.ZhuYiShiXiang; //自费项目 this.Txt_expensce.Value = Model_Routeinfo.RouteNormalInfo.ZiFeiXIangMu; } Bll_Route = null; Model_Routeinfo = null; }
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) { #region 基础数据读取 if (Request.QueryString["act"] == "update") { actType = 1; } if (Request.QueryString["act"] == "copy") { actType = 2; } 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"); info.RouteId = Utils.GetInt(selectXl.Id); info.AreaId = Utils.GetInt(Utils.GetFormValue(ddl_area.UniqueID)); info.RouteName = selectXl.Name; info.TourDays = EyouSoft.Common.Utils.GetInt(Utils.GetFormValue(txt_Days.UniqueID)); info.PlanPeopleNumber = 1;//EyouSoft.Common.Utils.GetInt(Utils.GetFormValue(txt_pepoleNum.UniqueID)); info.TourTraffic = GetSelectTraffic(); EyouSoft.Model.TourStructure.TourCreateRuleInfo rule = new EyouSoft.Model.TourStructure.TourCreateRuleInfo(); #region 建团规则 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; } else { } #endregion info.LTraffic = txt_startTraffic.Text; info.RTraffic = txt_endTraffic.Text; IList <EyouSoft.Model.TourStructure.TourLocalAgencyInfo> local; local = DiJieControl1.GetList; info.LocalAgencys = local; info.CompanyId = CurrentUserCompanyID; info.TourQuickInfo = new EyouSoft.Model.TourStructure.TourQuickPrivateInfo(); 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]); price.StandardName = Utils.GetFormValues("ddl_price")[k].Split('|')[1]; if (ddl_price[k] == "" || price.StandardId == 0) { continue; } 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.OperatorId = SiteUserInfo.ID; info.PriceStandards = pricelist; EyouSoft.Model.TourStructure.TourQuickPrivateInfo qinfo = new EyouSoft.Model.TourStructure.TourQuickPrivateInfo(); qinfo.QuickPlan = Utils.EditInputText(txt_xinchen.Text); qinfo.Service = Utils.EditInputText(txt_fuwu.Text); qinfo.Remark = Utils.GetFormValue(txt_remark.UniqueID); info.TourQuickInfo = qinfo; 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.Attachs = listAttachs; //info.TourDays = createTea1.getDays(); 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.Quick; 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; if (!CheckGrant(TravelPermission.散拼计划_散拼计划_新增计划)) { Utils.ResponseNoPermit(TravelPermission.散拼计划_散拼计划_新增计划, false); } 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>"); } } #endregion else #region 修改 { 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; if (!CheckGrant(TravelPermission.散拼计划_散拼计划_修改计划)) { Utils.ResponseNoPermit(TravelPermission.散拼计划_散拼计划_修改计划, false); } 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>"); } else { Response.Write("<script>alert('修改失败!');location.href=location.href;</script>"); } } #endregion }
/// <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 = Utils.InputText(this.txtTeamNum.Text); //线路区域名 string lineArea = Utils.GetFormValue(this.ddlLineArea.UniqueID); //计调员 string coordinatorId = Utils.GetFormValue(this.ddlSeller.UniqueID); //组团社ID int buyerCId = Utils.GetInt(this.hideGroupsId.Value); //组团社名称 string buyerCName = Utils.GetFormValue(this.txtGroupsName.UniqueID); //线路名称 string xianLuName = this.xianluWindow1.Name; //线路ID string routeId = this.xianluWindow1.Id; //天数 int dayCount = Utils.GetInt(this.txtDayCount.Text); //人数 int peopleCount = Utils.GetInt(this.txtPeopelCount.Text); //出发交通 string startTraffic = Utils.InputText(this.txtStartTraffic.Text); //返程交通 string endTraffic = Utils.InputText(this.txtEndTraffic.Text.Trim()); //出团日期 DateTime lDate = Convert.ToDateTime(this.txtLDate.Text); //回团日期 // DateTime rDate = Convert.ToDateTime(this.txtRDate.Text); //添加地接社信息 IList <EyouSoft.Model.TourStructure.TourLocalAgencyInfo> list = this.DiJieControl1.GetList; //添加价格组成 IList <EyouSoft.Model.TourStructure.TourTeamServiceInfo> listPrice = this.PriceControl1.GetList; //行程安排 string travel = Utils.EditInputText(this.txtTravel.Text); //服务标准 string services = Utils.EditInputText(this.txtServices.Text); //备注 string remarks = this.txtRemarks.Text; //常用城市 int tourCity = Utils.GetInt(Utils.GetFormValue(this.ddlCityList.UniqueID)); #endregion #region 验证 //判断线路区域不能为空 if (lineArea == "") { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请选择线路区域")); return; } //判断是否选择组团社 if (buyerCId <= 0) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请选择组团社!")); return; } if (coordinatorId == "-1") { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请选择计调员!")); return; } //判断线路名称不能为空 if (xianLuName == "") { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请输入线路名称!")); return; } //判断天数不能为空 if (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 #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 //声明bll对象 EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(); //声明团队计划对象 EyouSoft.Model.TourStructure.TourTeamInfo model = new EyouSoft.Model.TourStructure.TourTeamInfo(); if (this.hideType.Value == "Update") { //如果是修改操作,那么先获的这个对象 model = (EyouSoft.Model.TourStructure.TourTeamInfo)bll.GetTourInfo(this.hideID.Value); } #region 对象属性赋值 //判断对象时候存在 if (model != null) { //对象属性赋值 model.TourCode = teamNum; model.AreaId = Convert.ToInt32(lineArea); model.Coordinator = new EyouSoft.Model.TourStructure.TourCoordinatorInfo(); model.Coordinator.CoordinatorId = Utils.GetInt(coordinatorId); //修改时原购买单位 if (model.BuyerCId > 0) { model.OBuyerCId = model.BuyerCId; } model.BuyerCId = buyerCId; model.BuyerCName = buyerCName; model.RouteName = xianLuName; if (model.RouteId > 0) { model.ORouteId = model.RouteId; } model.RouteId = Utils.GetInt(routeId); model.TourDays = dayCount; model.PlanPeopleNumber = peopleCount; model.LTraffic = startTraffic; model.RTraffic = endTraffic; model.LDate = lDate; model.LocalAgencys = list; model.Services = listPrice; model.CompanyId = SiteUserInfo.CompanyID; EyouSoft.Model.TourStructure.TourQuickPrivateInfo quickInfo = new EyouSoft.Model.TourStructure.TourQuickPrivateInfo(); quickInfo.QuickPlan = travel; quickInfo.Service = services; quickInfo.Remark = remarks; model.TourQuickInfo = quickInfo; model.OperatorId = SiteUserInfo.ID; model.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.团队计划; model.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Quick; model.TicketStatus = EyouSoft.Model.EnumType.PlanStructure.TicketState.None; model.TotalAmount = PriceControl1.TotalAmount; 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 (Utils.GetFormValue(this.hideData.UniqueID).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 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, Utils.ShowMsg("团号重复!")); } else { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("添加失败!")); } } else { //数据库修改操作 count = bll.UpdateTeamTourInfo(model); //成功提示 if (count > 0) { Utils.ShowAndRedirect("修改成功!", "/TeamPlan/TeamPlanList.aspx"); } else { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("修改失败!")); } } } 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>"); } } else { Utils.ShowAndRedirect("该计划不存在!", "/TeamPlan/TeamPlanList.aspx"); } }
/// <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 }
protected void OnSave() { bool result = true; //线路区域编号 int LineTypeID = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(ddlLineType.UniqueID), "")); if (LineTypeID == 0) { result = false; MessageBox.Show(this, "请选择线路区域!"); return; } //线路名称 string LineName = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.txt_LineName.Name), ""); if (LineName == "") { result = false; MessageBox.Show(this, "请填写线路名称!"); return; } //线路描述 string LineDesCription = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(txt_Description.UniqueID), ""); //旅游天数 int txtDays = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(txt_Days.UniqueID), "")); if (txtDays == 0) { result = false; MessageBox.Show(this, "请填写旅游天数!"); return; } //行程安排 string Arrange = EyouSoft.Common.Utils.EditInputText(Request.Form[txt_Travel.UniqueID]); //服务标准 string Standard = EyouSoft.Common.Utils.EditInputText(Request.Form[txt_Services.UniqueID]); //备注 string Remarks = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(txt_Remarks.UniqueID), ""); //线路库业务逻辑类 EyouSoft.BLL.RouteStructure.Route Route = new EyouSoft.BLL.RouteStructure.Route(); //线路信息实体类 EyouSoft.Model.RouteStructure.RouteInfo Routeinfo = new EyouSoft.Model.RouteStructure.RouteInfo(); Routeinfo.AreaId = LineTypeID; Routeinfo.RouteName = LineName; //快速发布团队专有信息实体类 EyouSoft.Model.TourStructure.TourQuickPrivateInfo TourQuickPrivateInfo = new EyouSoft.Model.TourStructure.TourQuickPrivateInfo(); TourQuickPrivateInfo.QuickPlan = Arrange; TourQuickPrivateInfo.Remark = Remarks; TourQuickPrivateInfo.Service = Standard; Routeinfo.RouteQuickInfo = TourQuickPrivateInfo; Routeinfo.RouteDepict = LineDesCription; Routeinfo.RouteDays = txtDays; //设置线路的发布类型 Routeinfo.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Quick; //公司编号 Routeinfo.CompanyId = SiteUserInfo.CompanyID; //当前登录人编号 Routeinfo.OperatorId = SiteUserInfo.ID; //当前登录人姓名 if (SiteUserInfo.ContactInfo != null) { Routeinfo.OperatorName = SiteUserInfo.ContactInfo.ContactName; } if (EyouSoft.Common.Utils.GetFormValue("filehid") == "dele") { Routeinfo.Attachs = new List <EyouSoft.Model.TourStructure.TourAttachInfo>(); //线路附件实体 EyouSoft.Model.TourStructure.TourAttachInfo TourAttachInfo = new EyouSoft.Model.TourStructure.TourAttachInfo(); TourAttachInfo.FilePath = ""; TourAttachInfo.Name = ""; Routeinfo.Attachs.Add(TourAttachInfo); } //附件 if (Request.Files.Count > 0) { Routeinfo.Attachs = new List <EyouSoft.Model.TourStructure.TourAttachInfo>(); //线路附件实体 EyouSoft.Model.TourStructure.TourAttachInfo TourAttachInfo = new EyouSoft.Model.TourStructure.TourAttachInfo(); //文件路径 string filePath = string.Empty; //文件名 string fileName = string.Empty; //文件上传 if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["fileUpLoad"], "LineListFile", out filePath, out fileName)) { if (filePath.Trim() != "" && fileName.Trim() != "") { //设置文件上传后的虚拟路劲 TourAttachInfo.FilePath = filePath; //保存原文件名 TourAttachInfo.Name = fileName; Routeinfo.Attachs.Add(TourAttachInfo); } else { //设置文件上传后的虚拟路劲 TourAttachInfo.FilePath = ""; //保存原文件名 TourAttachInfo.Name = ""; Routeinfo.Attachs.Add(TourAttachInfo); } } } string hidType = EyouSoft.Common.Utils.GetFormValue(this.hideType.UniqueID); #region 列表线路数据修改 if (hidType == "update") { //线路编号 int RouteId = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hidRouteid.UniqueID)); Routeinfo.RouteId = RouteId; } #endregion #region 导航菜单线路数据修改 if (hidType == "UpdateT") { //线路编号 int RouteID = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hidRouteid.UniqueID)); Routeinfo.RouteId = RouteID; } #endregion #region 制线路信息 if (hidType == "Copy") { //线路编号 int RouteID = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hidRouteid.UniqueID)); Routeinfo.RouteId = RouteID; } #endregion if (hidType == "Copy") { if (result) { if (Route.InsertRouteInfo(Routeinfo) > 0) { MessageBox.ShowAndRedirect(this, "线路信息添加成功!", "/xianlu/LineProducts.aspx"); } else { MessageBox.ShowAndRedirect(this, "线路信息添加失败!", "/xianlu/LineProducts.aspx"); } } } if (hidType == "update" || hidType == "UpdateT") { if (result) { if (Route.UpdateRouteInfo(Routeinfo) > 0) { MessageBox.ShowAndRedirect(this, "线路信息修改成功!", "/xianlu/LineProducts.aspx"); } else { MessageBox.ShowAndRedirect(this, "线路信息修改失败!", "/xianlu/LineProducts.aspx"); } } } #region 释放资源 Route = null; Routeinfo = null; TourQuickPrivateInfo = null; #endregion }
/// <summary> /// 页面控件赋值 /// </summary> /// <param name="id">计划ID</param> protected void DataInit(string id) { //获得团队计划model EyouSoft.Model.TourStructure.TourTeamInfo model = (EyouSoft.Model.TourStructure.TourTeamInfo) new EyouSoft.BLL.TourStructure.Tour().GetTourInfo(id); if (model != null) { //如果该团队计划已经核算结束或提交财务,那么不提供修改功能 if (model.Status == EyouSoft.Model.EnumType.TourStructure.TourStatus.核算结束 || model.Status == EyouSoft.Model.EnumType.TourStructure.TourStatus.财务核算) { this.pelAdd.Visible = false; } if (model.TourTraffic != null && model.TourTraffic.Count > 0) { strTraffic = GetTrafficList(model.TourTraffic.First()); } #region 页面控件赋值 //类型判断 if (model.ReleaseType == EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal) { Response.Redirect("/TeamPlan/StandardVersion.aspx?type=" + this.hideType.Value + "&id=" + id); return; } //线路区域 DdlAreaInit(model.AreaId.ToString()); //计调员 GetSettleByArea(model.AreaId, model.Coordinator != null ? model.Coordinator.CoordinatorId.ToString() : ""); //团队编号 this.txtTeamNum.Text = model.TourCode; this.hideOldTeamNum.Value = model.TourCode; //线路ID this.xianluWindow1.Id = model.RouteId.ToString(); //线路名称 this.xianluWindow1.Name = model.RouteName; //天数 this.txtDayCount.Text = model.TourDays.ToString(); //人数 this.txtPeopelCount.Text = model.PlanPeopleNumber.ToString(); this.hid_PeopelCount.Value = model.PlanPeopleNumber.ToString(); //出发交通 this.txtStartTraffic.Text = model.LTraffic; //返程交通 this.txtEndTraffic.Text = model.RTraffic; //出团日期 this.txtLDate.Text = model.LDate.ToString("yyyy-MM-dd"); //回团日期 //this.txtRDate.Text = model.RDate.ToString("yyyy-MM-dd"); //地接社信息 this.DiJieControl1.SetList = model.LocalAgencys; //价格组成 this.PriceControl1.SetList = model.Services; //设置合计价格 this.PriceControl1.TotalAmount = model.TotalAmount; if (model.TourTeamUnit != null) { this.PriceControl1.all_price = model.TourTeamUnit.UnitAmountQp; this.PriceControl1.cr_price = model.TourTeamUnit.UnitAmountCr; this.PriceControl1.rt_price = model.TourTeamUnit.UnitAmountEt; txt_allNum.Text = model.TourTeamUnit.NumberQp.ToString(); txt_crNum.Text = model.TourTeamUnit.NumberCr.ToString(); txt_rtNum.Text = model.TourTeamUnit.NumberEt.ToString(); hid_Num.Value = (model.TourTeamUnit.NumberQp + model.TourTeamUnit.NumberCr + model.TourTeamUnit.NumberEt).ToString(); } if (model.TourQuickInfo != null) { //行程安排 this.txtTravel.Text = model.TourQuickInfo.QuickPlan; //服务标准 this.txtServices.Text = model.TourQuickInfo.Service; //备注 this.txtRemarks.Text = model.TourQuickInfo.Remark; } //组团社ID this.hideGroupsId.Value = model.BuyerCId.ToString(); //组团社名称 this.txtGroupsName.Text = model.BuyerCName; //常用城市 CityDataInit(model.TourCityId.ToString()); //文件 IList <EyouSoft.Model.TourStructure.TourAttachInfo> attachList = model.Attachs; if (attachList != null && attachList.Count > 0) { EyouSoft.Model.TourStructure.TourAttachInfo fileModel = attachList[0]; if (fileModel != null) { if (fileModel.FilePath.Trim() == "") { this.pnlFile.Visible = false; } else { this.lblFileName.Text = "<a href=\"" + fileModel.FilePath + "\" target=\"_blank\">查看附件</a>"; this.hideData.Value = fileModel.FilePath; } } } else { this.pnlFile.Visible = false; } #endregion } }
protected void OnSave() { bool result = true; //线路区域 int lineTypeID = Utils.GetInt(Utils.GetString(Utils.GetFormValue(ddlLineType.UniqueID), "")); if (lineTypeID == 0) { result = false; MessageBox.Show(this, "请选择线路区域!"); return; } //线路名称 string lineName = Utils.GetString(Utils.GetFormValue(this.txt_LineName.Name), ""); if (lineName == "") { result = false; MessageBox.Show(this, "请填写线路名称!"); return; } //线路描述 string Description = Utils.GetString(Utils.GetFormValue(this.txt_Description.UniqueID), ""); //旅游天数 int Days = Utils.GetInt(Utils.GetString(Utils.GetFormValue(this.txt_Days.UniqueID), "")); if (Days == 0) { result = false; MessageBox.Show(this, "请填写旅游天数!"); return; } //不包含项目 string ProjectNo = Utils.GetString(Utils.GetFormValue(this.txt_ProjectNo.UniqueID), ""); //购物安排 string ShoppingPlan = Utils.GetString(Utils.GetFormValue(this.txt_ShoppingPlan.UniqueID), ""); //儿童安排 string ChildrenPlan = Utils.GetString(Utils.GetFormValue(this.txt_ChildrenPlan.UniqueID), ""); //自费项目 string ExpenseProject = Utils.GetString(Utils.GetFormValue(this.txt_ExpenseProject.UniqueID), ""); //注意事项 string Notes = Utils.GetString(Utils.GetFormValue(this.txt_Notes.UniqueID), ""); //温馨提示 string reminder = Utils.GetString(Utils.GetFormValue(this.Txt_Reminder.UniqueID), ""); //内部信息 string Infromation = Utils.GetString(Utils.GetFormValue(this.Txt_Infromation.UniqueID), ""); //线路库业务逻辑类 EyouSoft.BLL.RouteStructure.Route Route = new EyouSoft.BLL.RouteStructure.Route(); //线路基本信息实体类 EyouSoft.Model.RouteStructure.RouteInfo Routeinfo = new EyouSoft.Model.RouteStructure.RouteInfo(); Routeinfo.AreaId = lineTypeID; Routeinfo.RouteName = lineName; Routeinfo.RouteDepict = Description; Routeinfo.RouteDays = Days; Routeinfo.Attachs = new List <EyouSoft.Model.TourStructure.TourAttachInfo>(); //标准发布团队行程信息业务实体 Routeinfo.RouteNormalInfo = new EyouSoft.Model.TourStructure.TourNormalPrivateInfo(); #region 获取行程信息 Routeinfo.RouteNormalInfo.Plans = this.xingcheng1.GetValues(); Routeinfo.RouteNormalInfo.BuHanXiangMu = ProjectNo; Routeinfo.RouteNormalInfo.ErTongAnPai = ChildrenPlan; Routeinfo.RouteNormalInfo.GouWuAnPai = ShoppingPlan; Routeinfo.RouteNormalInfo.NeiBuXingXi = Infromation; #endregion //包含项目 Routeinfo.RouteNormalInfo.Services = this.ConProjectControl1.GetDataList(); Routeinfo.RouteNormalInfo.WenXinTiXing = reminder; Routeinfo.RouteNormalInfo.ZhuYiShiXiang = Notes; Routeinfo.RouteNormalInfo.ZiFeiXIangMu = ExpenseProject; //设置线路的发布类型 Routeinfo.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal; //公司编号 Routeinfo.CompanyId = SiteUserInfo.CompanyID; //当前操作员编号 Routeinfo.OperatorId = SiteUserInfo.ID; //当前操作员姓名 if (SiteUserInfo.ContactInfo != null) { Routeinfo.OperatorName = SiteUserInfo.ContactInfo.ContactName; } #region 附件 //线路附件实体 EyouSoft.Model.TourStructure.TourAttachInfo TourAttachInfo = new EyouSoft.Model.TourStructure.TourAttachInfo(); //文件路径 string filePath = string.Empty; //文件名 string fileName = string.Empty; //文件上传 if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["fileUpLoad"], "LineListFile", out filePath, out fileName)) { if (filePath.Trim() != "" && fileName.Trim() != "") { //设置文件上传后的虚拟路劲 TourAttachInfo.FilePath = filePath; //保存原文件名 TourAttachInfo.Name = fileName; Routeinfo.Attachs.Add(TourAttachInfo); } } else { //上传失败提示 this.litMsg.Text = Utils.ShowMsg("文件上传失败!"); return; } #endregion if (result) { if (Route.InsertRouteInfo(Routeinfo) > 0) { MessageBox.ShowAndRedirect(this, "线路信息添加成功!", "/xianlu/LineProducts.aspx"); } else { MessageBox.ShowAndRedirect(this, "线路信息添加成功!", "/xianlu/Add_xl_Standard.aspx"); } } Route = null; Routeinfo = null; }
/// <summary> /// 页面控件初始化 /// </summary> /// <param name="id"></param> protected void DataInit(string id) { //初始化时 获得Model EyouSoft.Model.TourStructure.TourTeamInfo model = (EyouSoft.Model.TourStructure.TourTeamInfo) new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo).GetTourInfo(id); if (model != null) { //如果该团队计划已经核算结束或提交财务,那么不提供修改功能 if (model.Status == EyouSoft.Model.EnumType.TourStructure.TourStatus.核算结束 || model.Status == EyouSoft.Model.EnumType.TourStructure.TourStatus.财务核算) { this.pelAdd.Visible = false; } if (model.TourTraffic != null && model.TourTraffic.Count > 0) { strTraffic = GetTrafficList(model.TourTraffic.First()); } #region 页面控件赋值 //类型判断 if (model.ReleaseType == EyouSoft.Model.EnumType.TourStructure.ReleaseType.Quick) { Response.Redirect("/TeamPlan/FastVersion.aspx?type=" + this.hideType.Value + "&id=" + id); return; } //线路区域 DdlAreaInit(model.AreaId.ToString()); //计调员 GetSettleByArea(model.AreaId, model.Coordinator != null ? model.Coordinator.CoordinatorId.ToString() : ""); //团队编号 this.txtTeamNum.Text = model.TourCode; this.hideOldTeamNum.Value = model.TourCode; //线路ID this.xianluWindow1.Id = model.RouteId.ToString(); //线路名称 this.xianluWindow1.Name = model.RouteName; //天数 this.txtDayCount.Text = model.TourDays.ToString(); //人数 this.txtPeopelCount.Text = model.PlanPeopleNumber.ToString(); this.hid_PeopelCount.Value = model.PlanPeopleNumber.ToString(); //出发交通 this.txtStartTraffic.Text = model.LTraffic; //返程交通 this.txtEndTraffic.Text = model.RTraffic; //出团日期 this.txtLDate.Text = model.LDate.ToString("yyyy-MM-dd"); //地接社信息 this.DiJieControl1.SetList = model.LocalAgencys; //行程安排 this.xingcheng1.Bind(model.TourNormalInfo.Plans.ToList()); //包含项目 this.PriceControl1.SetList = model.Services; //设置合计价格 this.PriceControl1.TotalAmount = model.TotalAmount; //单价合计 //this.PriceControl1.OnePriceAll = model.SelfUnitPriceAmount; if (model.TourTeamUnit != null) { this.PriceControl1.all_price = model.TourTeamUnit.UnitAmountQp; this.PriceControl1.cr_price = model.TourTeamUnit.UnitAmountCr; this.PriceControl1.rt_price = model.TourTeamUnit.UnitAmountEt; txt_allNum.Text = model.TourTeamUnit.NumberQp.ToString(); txt_crNum.Text = model.TourTeamUnit.NumberCr.ToString(); txt_rtNum.Text = model.TourTeamUnit.NumberEt.ToString(); hid_Num.Value = (model.TourTeamUnit.NumberQp + model.TourTeamUnit.NumberCr + model.TourTeamUnit.NumberEt).ToString(); } //不含项目 this.txtNoProject.Text = model.TourNormalInfo.BuHanXiangMu; //购物安排 this.txtBuyPlan.Text = model.TourNormalInfo.GouWuAnPai; //儿童安排 this.txtChildPlan.Text = model.TourNormalInfo.ErTongAnPai; //自费项目 this.txtSelfProject.Text = model.TourNormalInfo.ZiFeiXIangMu; //注意事项 this.txtNote.Text = model.TourNormalInfo.ZhuYiShiXiang; //温馨提示 this.txtTips.Text = model.TourNormalInfo.WenXinTiXing; //内部信息 this.txtNeiBu.Text = model.TourNormalInfo.NeiBuXingXi; //组团社ID this.hideGroupsId.Value = model.BuyerCId.ToString(); //组团社名称 this.txtGroupsName.Text = model.BuyerCName; //集合地点 this.txtPlace.Text = model.GatheringPlace; //集合标志 this.txtLogo.Text = model.GatheringSign; //集合时间 //if (Utils.GetDateTimeNullable(model.GatheringTime) == null) //{ // this.txtGathered.Text = string.Empty; //} //else //{ // //日期 // string[] date = model.GatheringTime.Split(' '); // //时间 // if (date.Length > 1) // { // //日期部分赋值 // this.txtGathered.Text = date[0]; // //拆分时间部分 // string[] time = date[1].Split(':'); // if (time.Length > 0) // { // //取时间部分的时 // ddl_jh_date.SelectedValue = time[0]; // } // } // else // { // //日期部分赋值 // this.txtGathered.Text = date[0]; // } //} this.txtGathered.Text = model.GatheringTime; //常用城市 CityDataInit(model.TourCityId.ToString()); #region 添加送团人 //model.SentPeoples = new List<EyouSoft.Model.TourStructure.TourSentPeopleInfo>(); if (model.SentPeoples != null && model.SentPeoples.Count > 0) { for (int i = 0; i < model.SentPeoples.Count; i++) { this.selectOperator1.OperId += model.SentPeoples[i].OperatorId + ","; this.selectOperator1.OperName += model.SentPeoples[i].OperatorName + ","; } this.selectOperator1.OperName.TrimEnd(','); this.selectOperator1.OperId.TrimEnd(','); } #endregion //文件显示 IList <EyouSoft.Model.TourStructure.TourAttachInfo> attachList = model.Attachs; if (attachList != null && attachList.Count > 0) { EyouSoft.Model.TourStructure.TourAttachInfo fileModel = attachList[0]; if (fileModel.FilePath.Trim() == "") { this.pnlFile.Visible = false; } else { this.hideData.Value = fileModel.FilePath; this.lblFileName.Text = "<a href=\"" + fileModel.FilePath + "\" target=\"_blank\">查看附件</a>"; } } else { this.pnlFile.Visible = false; } #endregion } else { //如果未找到则跳转至列表 Response.Redirect("/TeamPlan/TeamPlanList.aspx"); } }
/// <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"); } }
/// <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 }
/// <summary> /// 提交数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void LinkButton1_Click(object sender, EventArgs e) { EyouSoft.BLL.TourStructure.TourEveryday bll = new EyouSoft.BLL.TourStructure.TourEveryday(SiteUserInfo); EyouSoft.Model.TourStructure.TourEverydayInfo model = new EyouSoft.Model.TourStructure.TourEverydayInfo(); #region 基础数据 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; 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(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++) { 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.Quick; model.RouteId = Utils.GetInt(selectXl.Id); model.RouteName = selectXl.Name; model.TourDays = Utils.GetInt(Utils.GetFormValue(txt_Days.UniqueID)); EyouSoft.Model.TourStructure.TourQuickPrivateInfo privateInfo = new EyouSoft.Model.TourStructure.TourQuickPrivateInfo(); privateInfo.QuickPlan = Utils.GetFormValue(txt_xinchen.UniqueID); privateInfo.Remark = Utils.GetFormValue(txt_remark.UniqueID); privateInfo.Service = Utils.GetFormValue(txt_fuwu.UniqueID); model.TourQuickInfo = 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, "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); 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 }