private string SaveData() { //返回的信息 string result = ""; string orderId = Utils.GetQueryStringValue("OrderId"); if (!string.IsNullOrEmpty(orderId)) { MTourOrderExpand model = new EyouSoft.BLL.TourStructure.BTourOrder().GetTourOrderExpandByOrderId(orderId); if (model != null) { //非出境团队 if (model.TourType == TourType.地接团队 || model.TourType == TourType.组团团队) { model.MTourOrderTravellerList = UtilsCommons.GetTravelList(); } else if (model.TourType == TourType.出境团队)//出境团队 { model.MTourOrderTravellerList = UtilsCommons.GetTravelListS(); } //修改订单实体 if (new EyouSoft.BLL.TourStructure.BTourOrder().UpdateTourOrderExpand(orderId, model.MTourOrderTravellerList)) { result = UtilsCommons.AjaxReturnJson("true", "保存成功"); } else { result = UtilsCommons.AjaxReturnJson("false", "保存失败"); } } else { result = UtilsCommons.AjaxReturnJson("false", "数据为空"); } } else { result = UtilsCommons.AjaxReturnJson("false", "参数为空"); } return(result); }
/// <summary> /// 保存新的报价 /// </summary> /// <returns></returns> private string PageSave() { string msg = string.Empty; int type = Utils.GetInt(Utils.GetQueryStringValue("type")); #region 获取表单 //线路区域编号 int areaID = Utils.GetInt(Utils.GetFormValue("sltArea")); //线路编号 string routeID = Utils.GetFormValue(this.hideRouteID.UniqueID); //线路名称 string routeName = Utils.GetFormValue(this.txt_RouteName.UniqueID); //天数 int days = Utils.GetInt(Utils.GetFormValue(this.txt_Days.UniqueID)); //客源地 国家 int contryID = Utils.GetInt(Utils.GetFormValue("sltCountry")); //客源地 省份 int provinceID = Utils.GetInt(Utils.GetFormValue("sltProvince")); //询价单位 编号 string buyCompanyID = Utils.GetFormValue(this.UC_CustomerUnitSelect.ClientNameKHBH); //询价单位 名称 string buyCompanyName = Utils.GetFormValue(this.UC_CustomerUnitSelect.ClientNameKHMC); //联系人 string contactName = Utils.GetFormValue(this.txt_Contact.UniqueID); //联系电话 string contactTel = Utils.GetFormValue(this.txt_ConTel.UniqueID); //联系人部门编号 string contactDepartId = Utils.GetFormValue(this.hideContactDeptId.UniqueID); //销售员编号 string sellsID = Utils.GetFormValue(this.SellsSelect1.SellsIDClient); //销售员名称 string sellsName = Utils.GetFormValue(this.SellsSelect1.SellsNameClient); //报价员 取当前登录用户 EyouSoft.Model.TourStructure.MOperatorInfo operatorModel = new EyouSoft.Model.TourStructure.MOperatorInfo(); operatorModel.OperatorId = this.SiteUserInfo.UserId; operatorModel.Name = this.SiteUserInfo.Name; operatorModel.Phone = this.SiteUserInfo.Telephone; //成人数 int adultCount = Utils.GetInt(Utils.GetFormValue(this.txt_Adult.UniqueID)); //成人价格 decimal adultPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtAdultPrice.UniqueID)); //儿童数 int childCount = Utils.GetInt(Utils.GetFormValue(this.txt_Child.UniqueID)); //儿童价格 decimal childPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtChildPrice.UniqueID)); //其它价格 decimal otherPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtOtherPrice.UniqueID)); //行程特色 string planContent = Utils.EditInputText(Request.Form[this.txtPlanContent.UniqueID]); //价格备注 string quoteRemark = Utils.GetFormValue(this.txtQuoteRemark.UniqueID); //合计金额 decimal sumPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtSumPrice.UniqueID)); //签字资料(附件) #region 表单获取 //出团时间 DateTime successDateBegin = Utils.GetDateTime(Utils.GetFormValue(this.txtLDate.UniqueID), DateTime.Now); //出发交通 string successsStraffBegin = Utils.GetFormValue(this.txtSuccesssStraffBegin.UniqueID); //返回交通 string successsStraffEnd = Utils.GetFormValue(this.txtSuccesssStraffEnd.UniqueID); //集合方式 string successGather = Utils.GetFormValue(this.txtSuccessGather.UniqueID); //增加费用 decimal successAddPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtSuccessAddPrice.UniqueID), 0); //增加费用备注 string successAddPriceRemark = Utils.GetFormValue(this.txtSuccessAddPriceRemark.UniqueID); //减少费用 decimal successReducePrice = Utils.GetDecimal(Utils.GetFormValue(this.txtSuccessReducePrice.UniqueID)); //减少费用备注 string successReducePriceRemark = Utils.GetFormValue(this.txtSuccessReducePriceRemark.UniqueID); //导游现收 decimal successGuideIncome = Utils.GetDecimal(Utils.GetFormValue(this.txtSuccessGuideIncome.UniqueID)); //订单备注 string successOrderRemark = Utils.GetFormValue(this.txtSuccessOrderRemark.UniqueID); #region 超限申请表单获取 //垫付金额 decimal applyPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtApplyPrice.UniqueID)); //超限备注 string applyRemarks = Utils.GetFormValue(this.txtApplyRemarks.UniqueID); //申请人编号 string applyManID = this.SiteUserInfo.UserId; //申请日期 DateTime applyDateTime = DateTime.Now; #endregion //变更标题 string changeTitle = Utils.GetFormValue("txt_ChangeTitle"); //变更备注 string changeRemark = Utils.GetFormValue("txt_ChangeRemark"); //签证附件(新) string[] visaUpload = Utils.GetFormValues(this.UploadControl1.ClientHideID); string[] oldVisaUpload = Utils.GetFormValues("hideVisaFile"); #endregion #endregion //1=保存 string saveType = Utils.GetQueryStringValue("saveType"); #region 表单后台验证 if (areaID == 0) { msg = "请选择线路区域!"; } if (routeName == "") { msg += "<br />请输入线路名称!"; } if (days == 0) { msg += "<br />请输入天数!"; } if (buyCompanyID == "") { msg += "<br />请选择客户单位!"; } if (sellsID == "") { msg += "<br />请输入销售员!"; } if (adultCount == 0) { msg += "<br />请输入成人数!"; } if (adultPrice == 0) { msg += "<br />请输入成人价!"; } if (msg != "") { return("{\"result\":\"0\",\"msg\":\"" + msg + "\"}"); } #endregion EyouSoft.BLL.TourStructure.BTour bll = new EyouSoft.BLL.TourStructure.BTour(); EyouSoft.Model.TourStructure.MTourTeamInfo model = new EyouSoft.Model.TourStructure.MTourTeamInfo(); act = Utils.GetQueryStringValue("act"); if (act == "update") { model.TourId = Utils.GetQueryStringValue("id"); } model.AddCostRemark = successAddPriceRemark; model.AdultPrice = adultPrice; model.Adults = adultCount; model.AdvanceApp = null; model.AreaId = areaID; //model.AreaName = ""; model.ChildPrice = childPrice; model.Childs = childCount; model.CompanyId = this.SiteUserInfo.CompanyId; model.CompanyInfo = new MCompanyInfo(); model.CompanyInfo.CompanyId = buyCompanyID; model.CompanyInfo.CompanyName = buyCompanyName; model.CompanyInfo.Contact = contactName; model.CompanyInfo.Phone = contactTel; model.ContactDepartId = contactDepartId; string costCalculation = string.Empty; EyouSoft.Model.TourStructure.MTourService tourService = UtilsCommons.GetTourService(out costCalculation); model.CostCalculation = costCalculation; model.CountryId = contryID; model.Gather = successGather; model.GuideIncome = successGuideIncome; model.LDate = successDateBegin; #region 签证附件 IList <EyouSoft.Model.ComStructure.MComAttach> visaList = null; if (visaUpload.Length > 0) { visaList = new List <EyouSoft.Model.ComStructure.MComAttach>(); for (int i = 0; i < visaUpload.Length; i++) { if (visaUpload[i].Trim() != "") { if (visaUpload[i].Split('|').Length > 1) { EyouSoft.Model.ComStructure.MComAttach visaModel = new EyouSoft.Model.ComStructure.MComAttach(); visaModel.Downloads = 0; visaModel.FilePath = visaUpload[i].Split('|')[1]; visaModel.ItemType = EyouSoft.Model.EnumType.ComStructure.AttachItemType.报价签证资料; visaModel.Name = visaUpload[i].Split('|')[0]; visaModel.Size = 0; visaList.Add(visaModel); } } } } if (oldVisaUpload.Length > 0) { if (visaList == null) { visaList = new List <EyouSoft.Model.ComStructure.MComAttach>(); } for (int i = 0; i < oldVisaUpload.Length; i++) { EyouSoft.Model.ComStructure.MComAttach visaModel = new EyouSoft.Model.ComStructure.MComAttach(); visaModel.Downloads = Utils.GetInt(oldVisaUpload[i].Split('|')[2]); visaModel.FilePath = oldVisaUpload[i].Split('|')[1]; visaModel.ItemType = EyouSoft.Model.EnumType.ComStructure.AttachItemType.计划签证资料; visaModel.Name = oldVisaUpload[i].Split('|')[0]; visaModel.Size = 0; visaList.Add(visaModel); } } model.VisaFileList = visaList; #endregion model.LTraffic = successsStraffBegin; model.OperatorInfo = new EyouSoft.Model.TourStructure.MOperatorInfo(); model.OperatorInfo.OperatorId = this.SiteUserInfo.UserId; model.OperatorInfo.Name = this.SiteUserInfo.Name; model.OperatorInfo.Phone = this.SiteUserInfo.Telephone; model.OrderRemark = successOrderRemark; model.OtherCost = otherPrice; Dictionary <string, object> quoteType = UtilsCommons.GetServiceType(); bool IsTourOrSubentry = (bool)quoteType["IsTourOrSubentry"]; if (IsTourOrSubentry) { //整团 tourService.ServiceStandard = quoteType["Service"].ToString(); model.OutQuoteType = EyouSoft.Model.EnumType.TourStructure.TourQuoteType.整团; } else { //分项 model.TourTeamPrice = (IList <EyouSoft.Model.TourStructure.MTourTeamPrice>)quoteType["Service"]; model.OutQuoteType = EyouSoft.Model.EnumType.TourStructure.TourQuoteType.分项; } model.PlanFeature = planContent; model.ProvinceId = provinceID; model.QuoteRemark = quoteRemark; model.ReduceCostRemark = successReducePriceRemark; model.RouteId = routeID; model.RouteName = routeName; model.RTraffic = successsStraffEnd; model.SaleAddCost = successAddPrice; model.TourChangeTitle = changeTitle; model.TourChangeContent = changeRemark; //获得销售员信息实体 EyouSoft.Model.ComStructure.MComUser sellsModel = new EyouSoft.BLL.ComStructure.BComUser().GetModel(sellsID, SiteUserInfo.CompanyId); if (sellsModel != null) { model.SaleInfo = new EyouSoft.Model.TourStructure.MSaleInfo(); model.SaleInfo.SellerId = sellsID; model.SaleInfo.Name = sellsName; model.SaleInfo.Phone = sellsModel.ContactMobile; model.SaleInfo.DeptId = sellsModel.DeptId; } model.SaleReduceCost = successReducePrice; model.SalerIncome = sumPrice - successGuideIncome; model.AdvanceApp = null; model.SumPrice = sumPrice; model.TourDays = days; model.TourPlan = UtilsCommons.GetPlanList(); model.TourService = tourService; #region 无需赋值 //model.PlanPeopleNumber //model.QuoteRemark //model.RealPeopleNumber //model.Review //model.ReviewTime //model.TourPlaner //model.TourPlanItem //model.TourPlanStatus //model.PeopleNumberLast //model.GuideList = null; //model.IsChange = false; //model.IsReview //model.IsSubmit //model.IsSure 列表 //model.LeavePeopleNumber #endregion model.HeTongCode = Utils.GetFormValue(txtHeTongHao.HeTongCodeClientID); model.HeTongId = Utils.GetFormValue(txtHeTongHao.HeTongIdClientID); //超限赋值 if (saveType == "2") { model.AdvanceApp = new EyouSoft.Model.TourStructure.MAdvanceApp(); model.AdvanceApp.Applier = this.SiteUserInfo.Name; model.AdvanceApp.ApplierId = this.SiteUserInfo.UserId; model.AdvanceApp.DisburseAmount = applyPrice; model.AdvanceApp.ApplyTime = applyDateTime; model.AdvanceApp.DeptId = this.SiteUserInfo.DeptId; model.AdvanceApp.Remark = applyRemarks; } //变更明细 switch (type) { case 1: model.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.组团团队; model.Traveller = UtilsCommons.GetTravelList(); break; case 2: model.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.地接团队; model.Traveller = UtilsCommons.GetTravelList(); break; case 3: model.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.出境团队; model.Traveller = UtilsCommons.GetTravelListS(); break; } if (act == "add" || act == "copy") { model.TourStatus = EyouSoft.Model.EnumType.TourStructure.TourStatus.销售未派计划; int r = bll.AddTourTeam(model); switch (r) { case 0: msg = UtilsCommons.AjaxReturnJson("0", "新增计划 失败,请稍后再试!"); break; case 1: msg = UtilsCommons.AjaxReturnJson("1", "新增计划 成功,正在跳转.."); break; case 2: msg = UtilsCommons.AjaxReturnJson("1", "新增计划 成功,已提交垫付申请!"); break; case 3: msg = UtilsCommons.AjaxReturnJson("2", "操作成功! 销售员已超限,请收款或超限申请!", model.TourId); break; case 4: msg = UtilsCommons.AjaxReturnJson("2", "操作成功! 客户单位已超限,请收款或超限申请!", model.TourId); break; case 5: msg = UtilsCommons.AjaxReturnJson("2", "操作成功! 销售员和客户单位已超限,请收款或超限申请!", model.TourId); break; } } if (act == "update" && model.TourId != "") { model.UpdateTime = DateTime.Now; if (bll.UpdateTourTeam(model)) { msg = UtilsCommons.AjaxReturnJson("1", "修改计划 成功,正在跳转..", model.TourId); } else { msg = UtilsCommons.AjaxReturnJson("0", "修改计划 失败,请稍后再试!", model.TourId); } } return(msg); }
/// <summary> /// 保存新的报价 /// </summary> /// <returns></returns> private string PageSave() { string msg = string.Empty; #region 获取表单 //线路区域编号 int areaID = Utils.GetInt(Utils.GetFormValue("sltArea")); //线路编号 string routeID = Utils.GetFormValue(this.hideRouteID.UniqueID); //线路名称 string routeName = Utils.GetFormValue(this.txt_RouteName.UniqueID); //天数 int days = Utils.GetInt(Utils.GetFormValue(this.txt_Days.UniqueID)); //客源地 国家 int countryID = Utils.GetInt(Utils.GetFormValue("sltCountry")); //客源地 省份 int provinceID = Utils.GetInt(Utils.GetFormValue("sltProvince")); //询价单位 编号 string buyCompanyID = Utils.GetFormValue(this.UC_CustomerUnitSelect.ClientNameKHBH); //询价单位 名称 string buyCompanyName = Utils.GetFormValue(this.UC_CustomerUnitSelect.ClientNameKHMC); //联系人 string contactName = Utils.GetFormValue(this.txt_Contact.UniqueID); //联系电话 string contactTel = Utils.GetFormValue(this.txt_ConTel.UniqueID); //销售员编号 string sellsID = Utils.GetFormValue(this.UC_SellsSelect.SellsIDClient); //销售员名称 string sellsName = Utils.GetFormValue(this.UC_SellsSelect.SellsNameClient); //报价员 取当前登录用户 EyouSoft.Model.TourStructure.MOperatorInfo operatorModel = new EyouSoft.Model.TourStructure.MOperatorInfo(); operatorModel.OperatorId = this.SiteUserInfo.UserId; operatorModel.Name = this.SiteUserInfo.Name; operatorModel.Phone = this.SiteUserInfo.Telephone; //成人数 int adultCount = Utils.GetInt(Utils.GetFormValue(this.txt_Adult.UniqueID)); //成人价格 decimal adultPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtAdultPrice.UniqueID)); //儿童数 int childCount = Utils.GetInt(Utils.GetFormValue(this.txt_Child.UniqueID)); //儿童价格 decimal childPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtChildPrice.UniqueID)); //其它价格 decimal otherPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtOtherPrice.UniqueID)); //行程特色 string planContent = Utils.EditInputText(Request.Form[this.txtPlanContent.UniqueID]); //价格备注 string quoteRemark = Utils.GetFormValue(this.txtQuoteRemark.UniqueID); //合计金额 decimal sumPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtSumPrice.UniqueID)); //询价员 string toOper = Utils.GetFormValue("hideToOperID"); #region 未超限表单获取 //出团时间 DateTime successDateBegin = Utils.GetDateTime(Utils.GetFormValue(this.txtSuccessDateBegin.UniqueID), DateTime.Now); //出发交通 string successsStraffBegin = Utils.GetFormValue(this.txtSuccesssStraffBegin.UniqueID); //返回交通 string successsStraffEnd = Utils.GetFormValue(this.txtSuccesssStraffEnd.UniqueID); //集合方式 string successGather = Utils.GetFormValue(this.txtSuccessGather.UniqueID); //增加费用 decimal successAddPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtSuccessAddPrice.UniqueID), 0); //增加费用备注 string successAddPriceRemark = Utils.GetFormValue(this.txtSuccessAddPriceRemark.UniqueID); //减少费用 decimal successReducePrice = Utils.GetDecimal(Utils.GetFormValue(this.txtSuccessReducePrice.UniqueID)); //减少费用备注 string successReducePriceRemark = Utils.GetFormValue(this.txtSuccessReducePriceRemark.UniqueID); //导游现收 decimal successGuideIncome = Utils.GetDecimal(Utils.GetFormValue(this.txtSuccessGuideIncome.UniqueID)); //订单备注 string successOrderRemark = Utils.GetFormValue(this.txtSuccessOrderRemark.UniqueID); //是否询价 bool isPlanerQuote = Utils.GetFormValue(this.cbxJdxj.UniqueID) == "on" ? true : false; //签证附件(新) string[] visaUpload = Utils.GetFormValues(this.UploadControl1.ClientHideID); string[] oldVisaUpload = Utils.GetFormValues("hideVisaFile"); //联系人部门编号 string contactDeptId = Utils.GetFormValue(this.hideContactDeptId.UniqueID); #endregion #endregion //1=保存,2=报价超限,3=报价未超,4=保存新报价 string saveType = Utils.GetQueryStringValue("saveType"); //如果是保存和保存新报价 则不做控制 if (saveType == "1" || saveType == "4") { #region 表单后台验证 if (areaID == 0) { msg = "请选择线路区域!"; } if (routeName == "") { msg += "<br />请输入线路名称!"; } if (days == 0) { msg += "<br />请输入天数!"; } if (buyCompanyID == "") { msg += "<br />请输入询价单位!"; } if (sellsID == "") { msg += "<br />请输入销售员!"; } if (adultCount == 0) { msg += "<br />请输入成人数!"; } if (adultPrice == 0) { msg += "<br />请输入成人价!"; } if (msg != "") { return(UtilsCommons.AjaxReturnJson("0", msg)); } #endregion } EyouSoft.BLL.TourStructure.BQuote bll = new EyouSoft.BLL.TourStructure.BQuote(); EyouSoft.Model.TourStructure.MTourQuoteInfo model = new EyouSoft.Model.TourStructure.MTourQuoteInfo(); string act = Utils.GetQueryStringValue("act"); string qid = Utils.GetQueryStringValue("id"); model.AdultPrice = adultPrice; model.Adults = adultCount; model.AdvanceApp = null; model.AreaId = areaID; model.BuyCompanyID = buyCompanyID; model.BuyCompanyName = buyCompanyName; model.IsPlanerQuote = isPlanerQuote; model.ChildPrice = childPrice; model.Childs = childCount; model.CompanyId = SiteUserInfo.CompanyId; model.CompanyInfo = new EyouSoft.Model.TourStructure.MCompanyInfo() { CompanyId = buyCompanyID, CompanyName = buyCompanyName, Contact = contactName, Phone = contactTel }; model.Contact = contactName; string costCalculation = string.Empty; EyouSoft.Model.TourStructure.MTourService tourService = UtilsCommons.GetTourService(out costCalculation); model.TourService = tourService; model.CostCalculation = costCalculation; model.CountryId = countryID; model.Days = days; model.InquiryTime = DateTime.Now; model.IsPlanerQuote = false; model.MTourQuoteTourInfo = null; model.OperatorInfo = new EyouSoft.Model.TourStructure.MOperatorInfo(); model.OperatorInfo.OperatorId = this.SiteUserInfo.UserId; model.OperatorInfo.Name = this.SiteUserInfo.Name; model.OperatorInfo.Phone = this.SiteUserInfo.Telephone; model.OtherCost = otherPrice; if (isPlanerQuote) { model.PlanerId = toOper; } #region 签证附件 IList <EyouSoft.Model.ComStructure.MComAttach> visaList = null; if (visaUpload.Length > 0) { visaList = new List <EyouSoft.Model.ComStructure.MComAttach>(); for (int i = 0; i < visaUpload.Length; i++) { if (visaUpload[i].Trim() != "") { if (visaUpload[i].Split('|').Length > 1) { EyouSoft.Model.ComStructure.MComAttach visaModel = new EyouSoft.Model.ComStructure.MComAttach(); visaModel.Downloads = 0; visaModel.FilePath = visaUpload[i].Split('|')[1]; visaModel.ItemType = EyouSoft.Model.EnumType.ComStructure.AttachItemType.报价签证资料; visaModel.Name = visaUpload[i].Split('|')[0]; visaModel.Size = 0; visaList.Add(visaModel); } } } } if (oldVisaUpload.Length > 0) { if (visaList == null) { visaList = new List <EyouSoft.Model.ComStructure.MComAttach>(); } for (int i = 0; i < oldVisaUpload.Length; i++) { EyouSoft.Model.ComStructure.MComAttach visaModel = new EyouSoft.Model.ComStructure.MComAttach(); visaModel.Downloads = Utils.GetInt(oldVisaUpload[i].Split('|')[2]); visaModel.FilePath = oldVisaUpload[i].Split('|')[1]; visaModel.ItemType = EyouSoft.Model.EnumType.ComStructure.AttachItemType.报价签证资料; visaModel.Name = oldVisaUpload[i].Split('|')[0]; visaModel.Size = 0; visaList.Add(visaModel); } } model.VisaFileList = visaList; #endregion Dictionary <string, object> quoteType = UtilsCommons.GetServiceType(); bool IsTourOrSubentry = (bool)quoteType["IsTourOrSubentry"]; if (IsTourOrSubentry) { //整团 model.ServiceStandard = quoteType["Service"].ToString(); model.OutQuoteType = EyouSoft.Model.EnumType.TourStructure.TourQuoteType.整团; } else { //分项 model.TourTeamPrice = (IList <EyouSoft.Model.TourStructure.MTourTeamPrice>)quoteType["Service"]; model.OutQuoteType = EyouSoft.Model.EnumType.TourStructure.TourQuoteType.分项; } model.Phone = contactTel; model.ContactDepartId = contactDeptId; model.PlanFeature = planContent; model.ProvinceId = provinceID; model.QuotePlan = UtilsCommons.GetPlanList(); model.QuoteRemark = quoteRemark; model.QuoteState = EyouSoft.Model.EnumType.TourStructure.QuoteState.未处理; model.QuoteType = (EyouSoft.Model.EnumType.TourStructure.ModuleType)(type - 1); model.RouteId = routeID; model.RouteName = routeName; model.TotalPrice = sumPrice; model.QuoteId = qid; //获得销售员信息实体 EyouSoft.Model.ComStructure.MComUser sellsModel = new EyouSoft.BLL.ComStructure.BComUser().GetModel(sellsID, SiteUserInfo.CompanyId); if (sellsModel != null) { model.SaleInfo = new EyouSoft.Model.TourStructure.MSaleInfo(); model.SaleInfo.SellerId = sellsID; model.SaleInfo.Name = sellsName; model.SaleInfo.Phone = sellsModel.ContactMobile; model.SaleInfo.DeptId = sellsModel.DeptId; } bool result = false; //新增,修改,复制 if (saveType == "1") { if (act == "add" || act == "copy") { model.ParentId = "0"; result = bll.AddTourQuote(model); msg = UtilsCommons.AjaxReturnJson("1", "新增报价成功,正在跳转.."); } if (act == "update") { model.QuoteId = qid; model.UpdateTime = DateTime.Now; result = bll.UpdateTourQuote(model); msg = UtilsCommons.AjaxReturnJson("1", "修改成功,正在跳转.."); } } //超限实体赋值 if (saveType == "2") { model.AdvanceApp = new EyouSoft.Model.TourStructure.MAdvanceApp(); model.AdvanceApp.Applier = this.SiteUserInfo.Name; model.AdvanceApp.ApplierId = this.SiteUserInfo.UserId; //model.AdvanceApp.DisburseAmount = applyPrice; //model.AdvanceApp.ApplyTime = applyDateTime; model.AdvanceApp.DeptId = this.SiteUserInfo.DeptId; //model.AdvanceApp.Remark = applyRemarks; model.MTourQuoteTourInfo = null; int r = bll.SuccessTourQuote(model); result = (r == 1 || r == 3) ? true : false; msg = UtilsCommons.AjaxReturnJson("1", "成功提交垫付申请,等待审核!"); } //未超限实体赋值 if (saveType == "3") { model.MTourQuoteTourInfo = new EyouSoft.Model.TourStructure.MTourQuoteTourInfo(); model.MTourQuoteTourInfo.AddCostRemark = successAddPriceRemark; model.MTourQuoteTourInfo.Gather = successGather; model.MTourQuoteTourInfo.GuideIncome = successGuideIncome; model.MTourQuoteTourInfo.LDate = successDateBegin; model.MTourQuoteTourInfo.LTraffic = successsStraffBegin; model.MTourQuoteTourInfo.OrderRemark = successOrderRemark; model.MTourQuoteTourInfo.ReduceCostRemark = successReducePriceRemark; model.MTourQuoteTourInfo.RTraffic = successsStraffEnd; model.MTourQuoteTourInfo.SaleAddCost = successAddPrice; model.MTourQuoteTourInfo.SaleReduceCost = successReducePrice; model.MTourQuoteTourInfo.SalerIncome = sumPrice - successGuideIncome; model.AdvanceApp = null; switch (type) { case 1: model.MTourQuoteTourInfo.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.组团团队; model.MTourQuoteTourInfo.Traveller = UtilsCommons.GetTravelList(); break; case 2: model.MTourQuoteTourInfo.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.地接团队; model.MTourQuoteTourInfo.Traveller = UtilsCommons.GetTravelList(); break; case 3: model.MTourQuoteTourInfo.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.出境团队; model.MTourQuoteTourInfo.Traveller = UtilsCommons.GetTravelListS(); break; } model.MTourQuoteTourInfo.TourStatus = EyouSoft.Model.EnumType.TourStructure.TourStatus.销售未派计划; model.UpdateTime = DateTime.Now; int successState = bll.SuccessTourQuote(model); switch (successState) { case 2: msg = UtilsCommons.AjaxReturnJson("1", "报价成功!"); result = true; break; case 4: msg = UtilsCommons.AjaxReturnJson("0", "操作失败!"); break; case 5: msg = UtilsCommons.AjaxReturnJson("2", "报价成功,但销售员超限!,是否需要进行收款操作?"); result = true; break; case 6: msg = UtilsCommons.AjaxReturnJson("2", "报价成功,但客户单位超限!,是否需要进行收款操作?"); result = true; break; case 7: msg = UtilsCommons.AjaxReturnJson("2", "报价成功,但销售员和客户单位超限!,是否需要进行收款操作?"); result = true; break; default: msg = UtilsCommons.AjaxReturnJson("0", "操作失败!"); break; } if (successState == 1) { msg = UtilsCommons.AjaxReturnJson("0", "超限、垫付申请中,不能报价!"); } if (successState == 2) { msg = UtilsCommons.AjaxReturnJson("1", "报价成功!"); result = true; } } if (saveType == "4") { model.ParentId = Utils.GetFormValue(this.hideFristQuoteId.UniqueID); result = bll.AddNewTourQuote(model); msg = UtilsCommons.AjaxReturnJson("1", "新增新报价成功,正在跳转.."); } if (saveType == "5") { result = bll.CalcelTourQuote(qid, Utils.GetFormValue("txtCanelRemark")); msg = UtilsCommons.AjaxReturnJson("1", "取消成功,正在跳转.."); } if (!result) { msg = UtilsCommons.AjaxReturnJson("0", "操作失败,请稍后尝试!"); } return(msg); //model.CancelReason = ""; //model.IsLatest //model.OrderCode = ""; //model.OrderId = ""; //model.Planer //model.TimeCount //model.TotalPrice //model.TourPrice //model.TourQuoteNo //model.UpdateTime //model.VisaFileList }
/// <summary> /// 页面验证 /// </summary> /// <param name="order"></param> /// <param name="msg"></param> /// <returns></returns> private bool PageValidate(ref EyouSoft.Model.TourStructure.MTourOrderExpand order, ref string msg) { //验证的字段 string DCompanyName = Utils.GetFormValue("txtDCompanyName"); if (string.IsNullOrEmpty(DCompanyName)) { msg += "客源单位 不能为空!</br>"; } string DContactName = Utils.GetFormValue("txtDContactName"); if (string.IsNullOrEmpty(DContactName)) { msg += "联系人 不能为空!</br>"; } string DContactTel = Utils.GetFormValue("txtDContactTel"); if (string.IsNullOrEmpty(DContactTel)) { msg += "联系定电话 不能为空!</br>"; } int Adults = Utils.GetInt(Utils.GetFormValue("txtAdults")); if (Adults < 0) { msg += "成人数 格式不正确!</br>"; } int Childs = Utils.GetInt(Utils.GetFormValue("txtChilds")); if (Childs < 0) { msg += "儿童数 格式不正确!</br>"; } decimal SumPrice = Utils.GetDecimal(Utils.GetFormValue("txtSumPrice")); if (SumPrice <= 0) { msg += "合计金额 格式不正确!</br>"; } string saveDate = Utils.GetFormValue("txtSaveSeatDate"); if (!string.IsNullOrEmpty(saveDate)) { DateTime?SaveSeatDate = Utils.GetDateTimeNullable(saveDate); if (!SaveSeatDate.HasValue) { msg += "留位时间 格式不正确!</br>"; } } string tourType = Utils.GetFormValue("hfTourType"); if (msg.Length <= 0) { //短线 if (!string.IsNullOrEmpty(Utils.GetQueryStringValue("IsShort"))) { string CarLocationID = Utils.GetFormValue("selPickUpPosition"); if (!string.IsNullOrEmpty(CarLocationID)) { EyouSoft.Model.TourStructure.MTourOrderCarLocation modelcar = new EyouSoft.Model.TourStructure.MTourOrderCarLocation(); string location = this.hidlocation.Value; string desc = this.hidDesc.Value; modelcar.Desc = desc; modelcar.Location = location; modelcar.OffPrice = Utils.GetDecimal(this.hidOffPrice.Value); modelcar.OnPrice = Utils.GetDecimal(this.hidOnPrice.Value); modelcar.TourLocationId = CarLocationID; order.TourOrderCarLocation = modelcar; } IList <EyouSoft.Model.TourStructure.MTourOrderCarTypeSeat> listSeat = new List <EyouSoft.Model.TourStructure.MTourOrderCarTypeSeat>(); listSeat = Newtonsoft.Json.JsonConvert.DeserializeObject <IList <MTourOrderCarTypeSeat> >(Utils.GetFormValue(this.SetSeat1.setSeatHidClientID)); order.TourOrderCarTypeSeatList = listSeat; } order.CompanyId = SiteUserInfo.CompanyId; order.TourId = Utils.GetQueryStringValue("TourId"); order.BuyCompanyName = SiteUserInfo.TourCompanyInfo.CompanyName; order.BuyCompanyId = SiteUserInfo.TourCompanyInfo.CompanyId; //客源单位联系人信息(当前分销商) string lxrId = SiteUserInfo.TourCompanyInfo.LxrId; order.ContactDepartId = lxrId; EyouSoft.BLL.CrmStructure.BCrmLinkMan link = new EyouSoft.BLL.CrmStructure.BCrmLinkMan(); EyouSoft.Model.CrmStructure.MCrmLinkman linkMan = link.GetLinkManModel(lxrId); if (linkMan != null) { order.ContactName = linkMan.Name; order.ContactTel = linkMan.Telephone; } order.OrderStatus = EyouSoft.Model.EnumType.TourStructure.OrderStatus.未处理; //联系人信息 order.DCompanyName = DCompanyName; order.DContactName = DContactName; order.DContactTel = DContactTel; //销售员信息 order.SellerId = SiteUserInfo.UserId; order.SellerName = SiteUserInfo.Name; order.DeptId = SiteUserInfo.DeptId; //操作员信息 order.Operator = SiteUserInfo.Name; order.OperatorId = SiteUserInfo.UserId; order.Adults = Adults; order.Childs = Childs; //价格组成 string strPrice = Utils.GetFormValue("txt_PriceStand_radio_price"); if (!string.IsNullOrEmpty(strPrice)) { string[] price = strPrice.Split('|'); order.LevId = Utils.GetInt(price[0]); order.AdultPrice = Utils.GetDecimal(price[1]); order.ChildPrice = Utils.GetDecimal(price[2]); } string strStandard = Utils.GetFormValue("_hstandard"); if (!string.IsNullOrEmpty(strStandard)) { int Standard = Utils.GetInt(strStandard); order.PriceStandId = Standard; EyouSoft.BLL.TourStructure.BTour bll = new EyouSoft.BLL.TourStructure.BTour(); EyouSoft.Model.TourStructure.MTourSanPinInfo model = (EyouSoft.Model.TourStructure.MTourSanPinInfo)bll.GetTourInfo(order.TourId); IList <EyouSoft.Model.TourStructure.MTourPriceStandard> standardList = model.MTourPriceStandard.Where(c => c.Standard == Standard).ToList(); if (standardList != null && standardList.Count != 0) { List <EyouSoft.Model.TourStructure.MTourPriceLevel> levelList = new List <EyouSoft.Model.TourStructure.MTourPriceLevel>(); foreach (var a in standardList) { levelList.AddRange(a.PriceLevel); } if (levelList != null && levelList.Count != 0) { EyouSoft.Model.TourStructure.MTourPriceLevel item = levelList.SingleOrDefault(c => c.LevType == EyouSoft.Model.EnumType.ComStructure.LevType.内部结算价); if (item != null) { order.PeerAdultPrice = item.AdultPrice; order.PeerChildPrice = item.ChildPrice; order.PeerLevId = item.LevelId; order.SettlementMoney = order.PeerAdultPrice * Adults + order.PeerChildPrice * Childs; } } } } order.SaleAddCost = Utils.GetDecimal(Utils.GetFormValue("txtSaleAddCost")); order.SaleAddCostRemark = Utils.GetFormValue("txtSaleAddCostRemark"); order.SaleReduceCost = Utils.GetDecimal(Utils.GetFormValue("txtSaleReduceCost")); order.SaleReduceCostRemark = Utils.GetFormValue("txtSaleReduceCostRemark"); order.SumPrice = Utils.GetDecimal(Utils.GetFormValue("txtSumPrice")); order.SaveSeatDate = Utils.GetDateTimeNullable(Utils.GetFormValue("txtSaveSeatDate")); order.OrderRemark = Utils.GetFormValue("txtOrderRemark"); order.OrderType = EyouSoft.Model.EnumType.TourStructure.OrderType.分销商下单; order.MTourOrderTravellerList = new List <EyouSoft.Model.TourStructure.MTourOrderTraveller>(); order.TourType = (EyouSoft.Model.EnumType.TourStructure.TourType)Enum.Parse(typeof(EyouSoft.Model.EnumType.TourStructure.TourType), tourType); switch (order.TourType) { case EyouSoft.Model.EnumType.TourStructure.TourType.组团散拼: case TourType.组团散拼短线: case EyouSoft.Model.EnumType.TourStructure.TourType.地接散拼: order.MTourOrderTravellerList = UtilsCommons.GetTravelList(); break; case EyouSoft.Model.EnumType.TourStructure.TourType.出境散拼: order.MTourOrderTravellerList = UtilsCommons.GetTravelListS(); break; } } return(msg.Length <= 0); }
/// <summary> /// 保存按钮点击事件执行方法 /// </summary> protected string PageSave() { string msg = ""; #region 获得参数 string doType = Utils.GetQueryStringValue("doType"); string saveType = Utils.GetQueryStringValue("saveType"); string tourID = Utils.GetQueryStringValue("tourID"); string orderID = Utils.GetQueryStringValue("orderID"); #endregion #region 获得表单 //联系人 string contactName = Utils.GetFormValue(this.txtContact.UniqueID); string contactTel = Utils.GetFormValue(this.txtContactTel.UniqueID); //联系人部门编号 string contactDepartId = Utils.GetFormValue(this.hideContactDeptId.UniqueID); //销售员 string sellsID = Utils.GetFormValue(this.SellsSelect1.SellsIDClient); string sellsName = Utils.GetFormValue(this.SellsSelect1.SellsNameClient); //客户单位 string companyID = Utils.GetFormValue(this.CustomerUnitSelect1.ClientNameKHBH); string companyName = Utils.GetFormValue(this.CustomerUnitSelect1.ClientNameKHMC); #region 团队计划价格组成 //成人单价 decimal adultPrice = Utils.GetDecimal(Utils.GetFormValue(this.hideAdultPrice.UniqueID)); //成人数 int adultCount = Utils.GetInt(Utils.GetFormValue(this.txtAdultCount.UniqueID)); //儿童单价 decimal childPrice = Utils.GetDecimal(Utils.GetFormValue(this.hideChildPrcie.UniqueID)); //儿童数量 int childCount = Utils.GetInt(Utils.GetFormValue(this.txtChildCount.UniqueID)); #endregion //增加费用 decimal addPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtAddPrice.UniqueID)); //增加费用备注 string remarksFrist = Utils.GetFormValue(this.txtRemarksFrist.UniqueID); //减少费用 decimal reducePrice = Utils.GetDecimal(Utils.GetFormValue(this.txtReducePrice.UniqueID)); //减少费用备注 string remarksSecond = Utils.GetFormValue(this.txtRemarksSecond.UniqueID); //导游现收 decimal guidePrice = Utils.GetDecimal(Utils.GetFormValue(this.txtGuidePrice.UniqueID)); //合计金额 decimal totalPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtTotalPrice.UniqueID)); //销售应收 decimal sellPrice = totalPrice - guidePrice; //订单备注 string orderRemarks = Utils.GetFormValue(this.txtRemarksOrder.UniqueID); //合同号 string contractCode = Utils.GetFormValue(txtHeTongHao.HeTongCodeClientID); string contractCodeId = Utils.GetFormValue(txtHeTongHao.HeTongIdClientID); //客源地 国家 int countryID = Utils.GetInt(Utils.GetFormValue("sltCountry")); //客源地 省份 int provinceID = Utils.GetInt(Utils.GetFormValue("sltProvince")); //预留截至时间 DateTime?saveSeatDate = Utils.GetDateTimeNullable(Utils.GetFormValue(this.txtSaveSeatDate.UniqueID)); //团类型 EyouSoft.Model.EnumType.TourStructure.TourType tourType = (EyouSoft.Model.EnumType.TourStructure.TourType)Utils.GetInt(Utils.GetFormValue(this.hideTourType.UniqueID)); //订单来源 EyouSoft.Model.EnumType.TourStructure.OrderType orderType = (EyouSoft.Model.EnumType.TourStructure.OrderType)Utils.GetInt(Utils.GetFormValue(this.hideOrderFrom.UniqueID)); #endregion #region 表单验证 if (contactName == "") { msg = "请输入联系人!<br />"; } if (sellsID == "" || sellsName == "") { msg += "请选择销售员!<br />"; } if (adultPrice <= 0) { msg += "请输入成人单价!<br />"; } if (adultCount <= 0) { msg += "请输入成人数!<br />"; } if (saveType == "1" && saveSeatDate == null) { msg += "请选择预留日期!<br />"; } if (saveType == "1" && saveSeatDate != null) { GetMaxDateTime(); if (saveSeatDate > Utils.GetDateTime(MaxDateTime) || saveSeatDate < DateTime.Now.AddMinutes(5)) { msg += "请选择新的预留日期!<br />"; } } if (msg != "") { return(UtilsCommons.AjaxReturnJson("0", msg)); } #endregion EyouSoft.BLL.TourStructure.BTourOrder orderBll = new EyouSoft.BLL.TourStructure.BTourOrder(); EyouSoft.Model.TourStructure.MTourOrderExpand orderModel = new EyouSoft.Model.TourStructure.MTourOrderExpand(); orderModel.BuyCompanyId = companyID; orderModel.BuyCompanyName = companyName; orderModel.ContactName = contactName; orderModel.ContactTel = contactTel; orderModel.ContactDepartId = contactDepartId; orderModel.SellerId = sellsID; orderModel.SellerName = sellsName; orderModel.OperatorId = SiteUserInfo.UserId; orderModel.Operator = SiteUserInfo.Name; orderModel.Adults = adultCount; orderModel.Childs = childCount; orderModel.PriceStandId = Utils.GetInt(Utils.GetFormValue(this.hidePriceStandID.UniqueID)); orderModel.BuyCountryId = countryID; orderModel.BuyProvincesId = provinceID; orderModel.SettlementMoney = adultPrice * adultCount + childCount * childPrice; #region 销售价 orderModel.LevId = Utils.GetInt(Utils.GetFormValue(this.hideLevelID.UniqueID)); orderModel.AdultPrice = Utils.GetDecimal(Utils.GetFormValue(this.hideAdultPrice.UniqueID)); orderModel.ChildPrice = Utils.GetDecimal(Utils.GetFormValue(this.hideChildPrcie.UniqueID)); #endregion #region 结算价 orderModel.PeerAdultPrice = Utils.GetDecimal(Utils.GetFormValue(this.hideSettAdultPrice.UniqueID)); orderModel.PeerChildPrice = Utils.GetDecimal(Utils.GetFormValue(this.hideSettChildPrice.UniqueID)); orderModel.PeerLevId = Utils.GetInt(Utils.GetFormValue(this.hideSettLevelID.UniqueID)); #endregion orderModel.ContractCode = contractCode; orderModel.ContractId = contractCodeId; orderModel.OrderRemark = orderRemarks; orderModel.SaleAddCost = addPrice; orderModel.SaleAddCostRemark = remarksFrist; orderModel.SaleReduceCost = reducePrice; orderModel.SaleReduceCostRemark = remarksSecond; orderModel.SalerIncome = sellPrice; orderModel.GuideIncome = guidePrice; orderModel.SumPrice = totalPrice; orderModel.CompanyId = SiteUserInfo.CompanyId; orderModel.DeptId = Utils.GetInt(Utils.GetFormValue(this.hideDeptID.UniqueID)); orderModel.TourId = tourID; switch (tourType) { case EyouSoft.Model.EnumType.TourStructure.TourType.出境散拼: case EyouSoft.Model.EnumType.TourStructure.TourType.出境团队: orderModel.MTourOrderTravellerList = UtilsCommons.GetTravelListS(); break; case EyouSoft.Model.EnumType.TourStructure.TourType.组团散拼: case EyouSoft.Model.EnumType.TourStructure.TourType.地接散拼: case EyouSoft.Model.EnumType.TourStructure.TourType.地接团队: case EyouSoft.Model.EnumType.TourStructure.TourType.组团团队: orderModel.MTourOrderTravellerList = UtilsCommons.GetTravelList(); break; } int result = 0; //散拼订单新增 orderModel.TourType = tourType; orderModel.IssueTime = DateTime.Now; orderModel.NeiBuXinXi = Utils.GetFormValue(txtNeiBuXinXi.UniqueID); #region 变更实体 EyouSoft.Model.TourStructure.MTourOrderChange changeModel = new EyouSoft.Model.TourStructure.MTourOrderChange(); changeModel.CompanyId = orderModel.CompanyId; changeModel.TourId = orderModel.TourId; changeModel.ChangePerson = adultCount + childCount; changeModel.ChangePrice = totalPrice; changeModel.CompanyId = SiteUserInfo.CompanyId; if (Utils.GetFormValue(this.hideOldAdultCount.UniqueID).Split('|').Length == 2) { int oldAdultCount = Utils.GetInt(Utils.GetFormValue(this.hideOldAdultCount.UniqueID).Split('|')[0]); int oldChildCount = Utils.GetInt(Utils.GetFormValue(this.hideOldAdultCount.UniqueID).Split('|')[1]); //changeModel.Content = "成人数由" + adultCount + "变" + oldAdultCount; changeModel.Content = "成人数由" + oldAdultCount + "变" + adultCount; //changeModel.Content += " 儿童数由" + childCount + "变" + oldChildCount; changeModel.Content += " 儿童数由" + oldChildCount + "变" + childCount; } changeModel.IssueTime = DateTime.Now; changeModel.IsSure = false; changeModel.Operator = SiteUserInfo.Name; changeModel.OperatorId = SiteUserInfo.UserId; changeModel.OrderId = orderID; changeModel.ChangeType = EyouSoft.Model.EnumType.TourStructure.ChangeType.修改; if (Utils.GetFormValue(this.hideOrderBianGeng.UniqueID) == "true") { changeModel.ChangeType = EyouSoft.Model.EnumType.TourStructure.ChangeType.变更; } #endregion switch (saveType) { //确认预留 case "1": orderModel.OrderStatus = EyouSoft.Model.EnumType.TourStructure.OrderStatus.已留位; orderModel.SaveSeatDate = saveSeatDate; orderModel.TourOrderChange = changeModel; break; //确定成交 case "2": orderModel.OrderStatus = EyouSoft.Model.EnumType.TourStructure.OrderStatus.已成交; orderModel.SaveSeatDate = null; orderModel.TourOrderChange = changeModel; break; case "4": orderModel.OrderStatus = (EyouSoft.Model.EnumType.TourStructure.OrderStatus)Utils.GetInt(Utils.GetFormValue(this.hideOrderState.UniqueID)); orderModel.SaveSeatDate = saveSeatDate; orderModel.TourOrderChange = changeModel; break; //取消订单 case "5": int bllRetCode1 = 0; bllRetCode1 = orderBll.UpdateTourOrderExpand(orderID, EyouSoft.Model.EnumType.TourStructure.OrderStatus.已取消, null); if (bllRetCode1 == 1) { return(UtilsCommons.AjaxReturnJson("1", "操作成功")); } else if (bllRetCode1 == -99) { return(UtilsCommons.AjaxReturnJson("0", "不存在的订单信息")); } else if (bllRetCode1 == -98) { return(UtilsCommons.AjaxReturnJson("0", "已取消的订单不可重复取消订单")); } else if (bllRetCode1 == -97) { return(UtilsCommons.AjaxReturnJson("0", "该计划状态不允许取消订单")); } else if (bllRetCode1 == -96) { return(UtilsCommons.AjaxReturnJson("0", "已确认合同金额不允许取消订单")); } else if (bllRetCode1 == -95) { return(UtilsCommons.AjaxReturnJson("0", "已存在收款信息不允许取消订单")); } else { return(UtilsCommons.AjaxReturnJson("0", "操作失败")); } //不受理 case "6": int bllRetCode2 = 0; bllRetCode2 = orderBll.UpdateTourOrderExpand(orderID, EyouSoft.Model.EnumType.TourStructure.OrderStatus.受理, null); if (bllRetCode2 == 1) { return(UtilsCommons.AjaxReturnJson("1", "操作成功")); } else if (bllRetCode2 == -99) { return(UtilsCommons.AjaxReturnJson("0", "不存在的订单信息")); } else if (bllRetCode2 == -98) { return(UtilsCommons.AjaxReturnJson("0", "已取消的订单不可重复取消订单")); } else if (bllRetCode2 == -97) { return(UtilsCommons.AjaxReturnJson("0", "该计划状态不允许取消订单")); } else if (bllRetCode2 == -96) { return(UtilsCommons.AjaxReturnJson("0", "已确认合同金额不允许取消订单")); } else if (bllRetCode2 == -95) { return(UtilsCommons.AjaxReturnJson("0", "已存在收款信息不允许取消订单")); } else { return(UtilsCommons.AjaxReturnJson("0", "操作失败")); } } #region 新增订单 if (tourID != "" && orderID == "") { orderModel.OrderId = Guid.NewGuid().ToString(); orderModel.OrderType = EyouSoft.Model.EnumType.TourStructure.OrderType.代客预定; result = orderBll.AddTourOrderExpand(orderModel); } #endregion #region 修改订单 if (orderID != "") { //如果计划是供应商 发布的,且不超限 那么订单状态永远是未处理 if (Utils.GetFormValue(this.hideSourceID.UniqueID).Trim() != "") { orderModel.OrderStatus = EyouSoft.Model.EnumType.TourStructure.OrderStatus.未处理; } orderModel.OrderId = orderID; orderModel.OrderType = orderType; result = orderBll.UpdateTourOrderExpand(orderModel); } switch (result) { case 1: msg = UtilsCommons.AjaxReturnJson("0", "报名失败,总人数超过计划剩余人数!"); break; case 2: msg = UtilsCommons.AjaxReturnJson("0", "报名失败,合同号未领用!"); break; case 3: if (saveType == "1") { msg = UtilsCommons.AjaxReturnJson("1", "预留成功,正在跳转.."); } if (saveType == "2") { msg = UtilsCommons.AjaxReturnJson("1", "确认成功!"); } if (saveType == "3") { msg = UtilsCommons.AjaxReturnJson("1", "垫付申请成功!"); } if (saveType == "4") { msg = UtilsCommons.AjaxReturnJson("1", "操作成功!"); } break; case 4: msg = UtilsCommons.AjaxReturnJson("0", "报名失败,未知错误!"); break; case 5: case 9: msg = UtilsCommons.AjaxReturnJson("2", "操作成功! 销售员已超限,请收款或超限申请!", orderModel.OrderId); break; case 6: case 10: msg = UtilsCommons.AjaxReturnJson("2", "操作成功! 客户单位已超限,请收款或超限申请!", orderModel.OrderId); break; case 7: case 11: msg = UtilsCommons.AjaxReturnJson("2", "操作成功! 销售员和客户单位已超限,请收款或超限申请!", orderModel.OrderId); break; } #endregion return(msg); }