/// <summary> /// 初始化计划列表 /// </summary> private void InitPowderList() { //分页参数 int pageSize = 10, pageCurrent = Utils.GetInt(Utils.GetQueryStringValue("page"), 1), recordCount = 0; //线路名称 lbl_lineName.Text = Utils.GetQueryStringValue("routename"); #region 添加需要验证的日期 /*已经存在计划的日期不允许重复添加*/ MPowderSearch queryModel = new MPowderSearch(); queryModel.RouteId = Utils.GetQueryStringValue("routeid"); IPowderList bll = EyouSoft.BLL.NewTourStructure.BPowderList.CreateInstance(); var list = bll.GetList(0, queryModel, 0); DateTime[] leaveDate = bll.GetList(0, queryModel, 0).Select(testls => testls.LeaveDate).ToArray(); int i = leaveDate.Length; /*已经添加计划的日期*/ while (i-- > 0) { /*因为iframe的日期格式为yyyy-M-d,所以你懂得*/ leaveDateStr += leaveDate[i].ToString("yyyy-M-d") + ","; } /*当天日期*/ //leaveDateStr += DateTime.Now.ToString("yyyy-M-d") + ","; #endregion //当前线路散拼计划列表 IList <MPowderList> ls = bll.GetList( pageSize, pageCurrent, ref recordCount, Utils.GetQueryStringValue("routeid"), Utils.GetQueryStringValue("tourNo"), Utils.GetDateTimeNullable(Utils.GetQueryStringValue("startDate")), Utils.GetDateTimeNullable(Utils.GetQueryStringValue("endDate"))); txt_selectEndDate.Value = Utils.GetQueryStringValue("endDate"); txt_selectStartDate.Value = Utils.GetQueryStringValue("startDate"); if (ls != null && ls.Count > 0) { ExportPageInfo1.Visible = true; rpt_Tlist.DataSource = ls; rpt_Tlist.DataBind(); this.ExportPageInfo1.intPageSize = pageSize; this.ExportPageInfo1.intRecordCount = recordCount; this.ExportPageInfo1.CurrencyPage = pageCurrent; //this.ExportPageInfo1.UrlParams = Request.QueryString; this.ExportPageInfo1.PageLinkURL = Request.ServerVariables["SCRIPT_NAME"].ToString() + "?"; this.ExportPageInfo1.UrlParams.Add("routeid", Utils.GetQueryStringValue("routeid")); this.ExportPageInfo1.UrlParams.Add("routename", Utils.GetQueryStringValue("routename")); this.ExportPageInfo1.UrlParams.Add("tourNo", Utils.GetQueryStringValue("tourNo")); this.ExportPageInfo1.UrlParams.Add("startDate", Utils.GetQueryStringValue("startDate")); this.ExportPageInfo1.UrlParams.Add("endDate", Utils.GetQueryStringValue("endDate")); } }
/// <summary> /// 保存 /// </summary> private void Save() { IPowderList bll = EyouSoft.BLL.NewTourStructure.BPowderList.CreateInstance(); bool isSave = false; MPowderList model = bll.GetModel(tourId); if (model == null) { Response.Clear(); Response.Write(isSave.ToString()); Response.End(); return; } string[] tourIds = Utils.GetFormValue(hd_tourIds.UniqueID).Split(','); #region 行程信息 //主要浏览 if (model.RouteType == AreaType.国际线) { //主要浏览国家 model.BrowseCountrys = new List <MBrowseCountryControl>(); string[] browseCountryControl = Utils.GetFormValue(hd_BrowseCountrys.UniqueID).Split(','); int i = browseCountryControl.Length; string[] qzArr = Utils.GetFormValue(hd_qz.UniqueID).Split(','); while (i-- > 0) { MBrowseCountryControl browseCityControlModel = new MBrowseCountryControl(); browseCityControlModel.CountryId = Utils.GetInt(browseCountryControl[i]); if (qzArr.Length > 0) { int j = qzArr.Length; while (j-- > 0) { if (qzArr[j] == browseCountryControl[i]) { browseCityControlModel.IsVisa = true; } } } model.BrowseCountrys.Add(browseCityControlModel); } model.IsNotVisa = chk_null.Checked; //国际线路成人定金 model.AdultPrice = Utils.GetDecimal(Utils.GetFormValue(txt_AdultDeposit.UniqueID), -1); //国际线路儿童定金 model.ChildrenPrice = Utils.GetDecimal(Utils.GetFormValue(txt_ChildrenDeposit.UniqueID), -1); } else { //主要浏览城市 IList <MBrowseCityControl> browseCityControl = new List <MBrowseCityControl>(); string[] browseCitys = Utils.GetFormValue(hd_BrowseCitys.UniqueID).Split(','); int i = browseCitys.Length; while (i-- > 0) { MBrowseCityControl browseCityControlModel = new MBrowseCityControl(); //拆分城市县 int[] array = Utils.StringArrToIntArr(browseCitys[i].Split('|')); if (array.Length > 1) { //县Id browseCityControlModel.CountyId = array[0]; //城市Id browseCityControlModel.CityId = array[1]; } else { //城市Id browseCityControlModel.CityId = Utils.GetInt(browseCitys[i]); } browseCityControl.Add(browseCityControlModel); } model.BrowseCitys = browseCityControl; } //线路名称 model.RouteName = Utils.GetFormValue(txt_LineName.UniqueID); //B2B显示控制 model.B2B = (RouteB2BDisplay)Utils.GetInt(Utils.GetFormValue(dropB2B.UniqueID)); //B2C显示控制 model.B2C = (RouteB2CDisplay)Utils.GetInt(Utils.GetFormValue(dropB2C.UniqueID)); //B2B排序值 model.B2BOrder = Utils.GetInt(Utils.GetFormValue(txt_B2B.UniqueID)); //B2C排序值 model.B2COrder = Utils.GetInt(Utils.GetFormValue(txt_B2C.UniqueID)); //推荐类型 model.RecommendType = (RecommendType)Utils.GetInt(Utils.GetFormValue(ddl_Status.UniqueID)); //出发交通 model.StartTraffic = (TrafficType)Utils.GetInt(Utils.GetFormValue(ddl_DepartureTraffic.UniqueID)); //返回交通 model.EndTraffic = (TrafficType)Utils.GetInt(Utils.GetFormValue(ddl_ReturnTraffic.UniqueID)); //出发城市 string[] sCity = Utils.GetFormValue(hd_goCity.UniqueID).Split('|'); model.StartCity = Utils.GetInt(sCity[0]); model.StartCityName = sCity[1]; //返回城市 string[] eCity = Utils.GetFormValue(hd_returnCity.UniqueID).Split('|'); model.EndCity = Utils.GetInt(eCity[0]); model.EndCityName = eCity[1]; //线路特色 model.Characteristic = Utils.GetFormValue(txt_LineFeatures.UniqueID); //天数 model.Day = Utils.GetInt(Utils.GetFormValue(txt_days.UniqueID)); //夜数 model.Late = Utils.GetInt(Utils.GetFormValue(txt_nights.UniqueID)); //线路主题 model.Themes = GetTheme(); //报价包含 string fITOrTeam = Utils.GetFormValue("hd_FITOrTeam").Trim(); //发布人账号 model.OperatorId = Utils.GetFormValue(hiddropPublisher.UniqueID); //实例化 model.ServiceStandard = new MServiceStandard(); if (fITOrTeam == "FIT") { model.FitQuotation = Utils.GetFormValue(txt_FIT.UniqueID); } else { //用车 model.ServiceStandard.CarContent = Utils.GetFormValue("txt_car"); //其他包含 model.ServiceStandard.IncludeOtherContent = Utils.GetFormValue("txt_qt"); //用餐 model.ServiceStandard.DinnerContent = Utils.GetFormValue("txt_yc"); //导游 model.ServiceStandard.GuideContent = Utils.GetFormValue("txt_dy"); //住宿 model.ServiceStandard.ResideContent = Utils.GetFormValue("txt_zs"); //景点 model.ServiceStandard.SightContent = Utils.GetFormValue("txt_jd"); //往返交通 model.ServiceStandard.TrafficContent = Utils.GetFormValue("txt_fhjt"); } //报价不包含 model.ServiceStandard.NotContainService = Utils.GetFormValue(txt_PriceExcluding.UniqueID); //赠送项目 model.ServiceStandard.GiftInfo = Utils.GetFormValue(txt_GiftItems.UniqueID); //儿童及其他安排 model.ServiceStandard.ChildrenInfo = Utils.GetFormValue(txt_OtherArr.UniqueID); //购物安排 model.ServiceStandard.ShoppingInfo = Utils.GetFormValue(txt_ShoppingArr.UniqueID); //自费项目 model.ServiceStandard.ExpenseItem = Utils.GetFormValue(txt_ThisConsumption.UniqueID); //销售商须知(只有组团社用到) model.VendorsNotes = Utils.GetFormValue(txt_Notes.UniqueID); //备注 model.ServiceStandard.Notes = Utils.GetFormValue(txt_Remarks.UniqueID); //销售区域 model.Citys = GetSalesArea(); //行程类型 string travelType = Utils.GetFormValue("hd_TravelContent").Trim(); #endregion if (!isAllUpdata) { #region 散拼计划修改 #region 团队信息 //公司编号 model.Publishers = companyid; //团队人数 model.TourNum = Utils.GetInt(Utils.GetFormValue(txt_orderPeopleNum.UniqueID)); //报名截止时间 model.RegistrationEndDate = Utils.GetDateTime(Utils.GetFormValue(txt_registrationEndDate.UniqueID)); if (!model.IsLimit) { //余位 model.MoreThan = Utils.GetInt(Utils.GetFormValue(txt_moreThan.UniqueID)); } //留位 model.SaveNum = Utils.GetInt(Utils.GetFormValue(txt_saveNum.UniqueID)); //成人市场价 model.RetailAdultPrice = Utils.GetDecimal(Utils.GetFormValue(txt_retailAdultPrice.UniqueID)); //成人结算价 model.SettlementAudltPrice = Utils.GetDecimal(Utils.GetFormValue(txt_settlementAudltPrice.UniqueID)); //儿童市场价 model.RetailChildrenPrice = Utils.GetDecimal(Utils.GetFormValue(txt_retailChildrenPrice.UniqueID)); //儿童结算价 model.SettlementChildrenPrice = Utils.GetDecimal(Utils.GetFormValue(txt_settlementChildrenPrice.UniqueID)); //单房差 model.MarketPrice = Utils.GetDecimal(Utils.GetFormValue(txt_marketPrice.UniqueID)); //集合说明 model.SetDec = Utils.GetFormValue(txt_setDec.UniqueID); //线路销售备注 model.TourNotes = Utils.GetFormValue(txt_tourNotes.UniqueID); //领队全陪 model.TeamLeaderDec = Utils.GetFormValue(txt_teamLeaderDec.UniqueID); //航班出发时间 model.StartDate = Utils.GetFormValue(txt_startDate.UniqueID); //航班返回时间 model.EndDate = Utils.GetFormValue(txt_endDate.UniqueID); //收客状态 model.PowderTourStatus = (PowderTourStatus)Utils.GetInt(Utils.GetFormValue(ddl_powderTourStatus.UniqueID), 3); //国际线路成人定金 model.AdultPrice = Utils.GetDecimal(Utils.GetFormValue(txt_AdultDeposit.UniqueID), -1); //国际线路儿童定金 model.ChildrenPrice = Utils.GetDecimal(Utils.GetFormValue(txt_ChildrenDeposit.UniqueID), -1); #endregion if (travelType == "SAE") { //行程简易版 model.StandardStroke = Utils.EditInputText( Request.Form[txt_BriefnessTravel.UniqueID] != null && Request.Form[txt_BriefnessTravel.UniqueID].ToString().Length > 0 ? Request.Form[txt_BriefnessTravel.UniqueID] : string.Empty); isSave = bll.UpdatePowder(model); } else { //行程内容标准 model.StandardPlans = GetTravel(); isSave = bll.UpdatePowder(model); } #endregion } else { #region 批量修改散拼计划 if (travelType == "SAE") { //行程简易版 model.StandardStroke = Utils.EditInputText( Request.Form[txt_BriefnessTravel.UniqueID] != null && Request.Form[txt_BriefnessTravel.UniqueID].ToString().Length > 0 ? Request.Form[txt_BriefnessTravel.UniqueID] : string.Empty); } else { //行程内容标准 model.StandardPlans = GetTravel(); } #endregion isSave = bll.UpdateStandardPlan(model, tourIds); } Response.Clear(); Response.Write(isSave.ToString()); Response.End(); }