/// <summary> /// 保存执行方法 /// </summary> private string PageSave(string id, string doType) { string msg = string.Empty; //t为false为编辑,true时为新增 bool t = String.Equals(doType, "update", StringComparison.InvariantCultureIgnoreCase) && !string.IsNullOrEmpty(id) ? false : true; string AdultPrice = Utils.GetFormValue(txtAdultPrice.UniqueID); //成人价格 string ChildPrice = Utils.GetFormValue(txtChildPrice.UniqueID); //儿童价格 string TotalPrice = Utils.GetFormValue(txtTotalPrice.UniqueID); //合计价格 string Collection = Utils.GetFormValue(txtCollection.UniqueID); //集合方式 string DayCount = Utils.GetFormValue(txtDayCount.UniqueID); //天数 string StartTraffic = Utils.GetFormValue(txtStartTraffic.UniqueID); //出发交通 string EndTraffic = Utils.GetFormValue(txtEndTraffic.UniqueID); //返程交通 //txtFile 附件 string OtherPrice = Utils.GetFormValue(txtOtherPrice.UniqueID); //其他费用 string PathDesc = Utils.GetFormValue(txtPathDesc.UniqueID); //线路描述 string PathName = Utils.GetFormValue(txtPathName.UniqueID).Trim(); //线路名称 string AreaID = Utils.GetFormValue(HidRouteAreaID.UniqueID); //线路区域编号 string StrRemark = Utils.GetFormValue(txtPathRemark.UniqueID); //获取价格备注 if (string.IsNullOrEmpty(PathName)) { msg = UtilsCommons.AjaxReturnJson("0", "请输入线路名称"); return(msg); } EyouSoft.Model.SourceStructure.MRoute ModelRoute = new EyouSoft.Model.SourceStructure.MRoute(); EyouSoft.BLL.SourceStructure.BSource bll = new EyouSoft.BLL.SourceStructure.BSource(); if (!string.IsNullOrEmpty(id) && doType == "update") { ModelRoute = bll.GetRouteModel(id); ModelRoute.RouteId = id; if (string.IsNullOrEmpty(AreaID)) { AreaID = ModelRoute.AreaId.ToString(); } } if (Utils.GetInt(AreaID) == 0) { msg = UtilsCommons.AjaxReturnJson("0", "请选择线路区域!"); return(msg); } //合同附件 //合同附件(新) string[] hdUpload = Utils.GetFormValues(this.UploadControl1.ClientHideID); string[] oldhdUpload = Utils.GetFormValues("hideFileInfo"); #region 合同附件 EyouSoft.Model.ComStructure.MComAttach hdModel = new EyouSoft.Model.ComStructure.MComAttach(); if (oldhdUpload.Length > 0) { for (int i = 0; i < oldhdUpload.Length; i++) { hdModel.FilePath = oldhdUpload[i].Split('|')[1]; hdModel.ItemType = EyouSoft.Model.EnumType.ComStructure.AttachItemType.线路附件; hdModel.Name = oldhdUpload[i].Split('|')[0]; hdModel.Size = 0; } } if (hdUpload.Length > 0) { for (int i = 0; i < hdUpload.Length; i++) { if (hdUpload[i].Trim() != "") { if (hdUpload[i].Split('|').Length > 1) { hdModel.Downloads = 0; hdModel.FilePath = hdUpload[i].Split('|')[1]; hdModel.ItemType = EyouSoft.Model.EnumType.ComStructure.AttachItemType.线路附件; hdModel.Name = hdUpload[i].Split('|')[0]; hdModel.Size = 0; } } } } ModelRoute.Attach = hdModel; #endregion #region 签证附件 //签证附件(新) string[] visaUpload = Utils.GetFormValues(this.UploadControl2.ClientHideID); string[] oldVisaUpload = Utils.GetFormValues("hideVisaFile"); IList <EyouSoft.Model.ComStructure.MComAttach> visaList = null; 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.FilePath = oldVisaUpload[i].Split('|')[1]; visaModel.ItemType = EyouSoft.Model.EnumType.ComStructure.AttachItemType.线路签证资料; visaModel.Name = oldVisaUpload[i].Split('|')[0]; visaList.Add(visaModel); } } if (visaUpload.Length > 0) { if (visaList == null) { 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.FilePath = visaUpload[i].Split('|')[1]; visaModel.ItemType = EyouSoft.Model.EnumType.ComStructure.AttachItemType.线路签证资料; visaModel.Name = visaUpload[i].Split('|')[0]; visaList.Add(visaModel); } } } } ModelRoute.VisaInfoList = visaList; #endregion //对外报价 ModelRoute.PlanModelList = UtilsCommons.GetPlanList();//行程安排 #region 线路服务赋值 string costCalculation = string.Empty; EyouSoft.Model.TourStructure.MTourService tourService = UtilsCommons.GetTourService(out costCalculation); ModelRoute.ServicesModel = tourService; #endregion ModelRoute.AdultPrice = Utils.GetDecimal(AdultPrice); ModelRoute.AreaId = Utils.GetInt(AreaID); ModelRoute.ChildrenPrice = Utils.GetDecimal(ChildPrice); ModelRoute.OtherPrice = Utils.GetDecimal(OtherPrice); ModelRoute.CompanyId = this.SiteUserInfo.CompanyId; ModelRoute.Days = Utils.GetInt(DayCount); ModelRoute.DepartureTraffic = StartTraffic; ModelRoute.ReturnTraffic = EndTraffic; ModelRoute.SetMode = Collection; ModelRoute.LineIntro = PathDesc; ModelRoute.RouteName = PathName; ModelRoute.PathRemark = StrRemark; ModelRoute.OperatorId = this.SiteUserInfo.UserId; ModelRoute.DeptId = this.SiteUserInfo.DeptId; ModelRoute.IsShare = true; if (radno.Checked) { ModelRoute.IsShare = false; } ModelRoute.IssueTime = DateTime.Now; #region 对外报价赋值 ForeignQuote1.IsFromTourOrRoute = false; Dictionary <string, object> Standarlist = UtilsCommons.GetServiceType(); bool IsTourOrSubentry = (bool)Standarlist["IsTourOrSubentry"]; ModelRoute.IsTourOrSubentry = IsTourOrSubentry; ModelRoute.StandardModelList = new List <EyouSoft.Model.SourceStructure.MRouteStandard>(); if (IsTourOrSubentry) { ModelRoute.Service = Standarlist["Service"].ToString(); } else { ModelRoute.StandardModelList = (IList <EyouSoft.Model.SourceStructure.MRouteStandard>)Standarlist["Service"]; } #endregion ModelRoute.TotalPrice = Utils.GetDecimal(TotalPrice); int result = 0; if (t) { //返回值 -1:已经存在相同的线路名称 -2;同一个行程已经存在相同的景点 -3:已经存在相同的附件名称 -4:公司编号未赋值 -5:线路必填信息不完善 0:事务回滚 1:正确 result = bll.AddRouteModel(ModelRoute); } else { result = bll.UpdateRouteModel(ModelRoute); } msg = GetResult(result, t ? "新增" : "修改"); return(msg); }
/// <summary> /// 页面初始化 /// </summary> /// <param name="id">操作ID</param> protected void PageInit(string id, string dotype) { this.CostAccounting1.IsRoute = true; this.UploadControl1.CompanyID = this.SiteUserInfo.CompanyId; this.UploadControl2.CompanyID = this.SiteUserInfo.CompanyId; if (String.Equals(dotype, "update", StringComparison.InvariantCultureIgnoreCase) || String.Equals(dotype, "copy", StringComparison.InvariantCultureIgnoreCase) && !string.IsNullOrEmpty(id)) { EyouSoft.BLL.SourceStructure.BSource BLL = new EyouSoft.BLL.SourceStructure.BSource(); EyouSoft.Model.SourceStructure.MRoute Model = BLL.GetRouteModel(id); if (Model != null) { txtAdultPrice.Text = Utils.FilterEndOfTheZeroDecimal(Model.AdultPrice); txtChildPrice.Text = Utils.FilterEndOfTheZeroDecimal(Model.ChildrenPrice); txtCollection.Text = Model.SetMode; txtDayCount.Text = Model.Days.ToString(); txtEndTraffic.Text = Model.ReturnTraffic; txtPathRemark.Text = Model.PathRemark; //txtFile txtOtherPrice.Text = Utils.FilterEndOfTheZeroDecimal(Model.OtherPrice); txtPathDesc.Text = Model.LineIntro; if (dotype == "update") { txtPathName.Text = Model.RouteName; } if (dotype == "copy") { this.HidRouteAreaID.Value = Model.AreaId.ToString(); } txtStartTraffic.Text = Model.DepartureTraffic; txtTotalPrice.Text = Utils.FilterEndOfTheZeroDecimal(Model.TotalPrice); this.radyes.Checked = true; AreaID = Model.AreaId; if (Model.IsShare == false) { this.radyes.Checked = false; this.radno.Checked = true; } if (Model.IsTourOrSubentry) { ForeignQuote1.IsTourOrSubentry = true;//团 if (!string.IsNullOrEmpty(Model.Service)) { ForeignQuote1.GroupService = Model.Service; } } else { ForeignQuote1.IsTourOrSubentry = false;//分项 if (Model.StandardModelList != null) { this.ForeignQuote1.StandardRouteList = Model.StandardModelList; } } if (Model.ServicesModel != null) { this.CostAccounting1.ChildServiceItem = Model.ServicesModel.ChildServiceItem; //this.CostAccounting1.CostCalculation=Model.ServicesModel. this.CostAccounting1.InsiderInfor = Model.ServicesModel.InsiderInfor; //this.CostAccounting1.IsSanPin this.CostAccounting1.NeedAttention = Model.ServicesModel.NeedAttention; this.CostAccounting1.NoNeedItem = Model.ServicesModel.NoNeedItem; this.CostAccounting1.OwnExpense = Model.ServicesModel.OwnExpense; //this.CostAccounting1.ServiceStandard=Model.ServicesModel. this.CostAccounting1.ShoppingItem = Model.ServicesModel.ShoppingItem; this.CostAccounting1.WarmRemind = Model.ServicesModel.WarmRemind; } if (Model.PlanModelList != null) { Journey1.SetPlanList = Model.PlanModelList; } if (Model.Attach != null) { StringBuilder strFile = new StringBuilder(); if (Model.Attach.FilePath != "") { strFile.AppendFormat("<span class='upload_filename'><a href='/CommonPage/FileDownLoad.aspx?doType=downLoad&filePath={0}&name={1}' target='_blank'>{1}</a><a href=\"javascript:void(0)\" onclick=\"PathEditPage.DelFile(this)\" title='删除附件'><img style='vertical-align:middle' src='/images/cha.gif'></a><input type=\"hidden\" name=\"hideFileInfo\" value='{1}|{0}'/></span>", Model.Attach.FilePath, Model.Attach.Name); } this.lbFiles.Text = strFile.ToString(); } if (Model.VisaInfoList != null && Model.VisaInfoList.Count > 0) { string visaStr = string.Empty; for (int i = 0; i < Model.VisaInfoList.Count; i++) { visaStr += "<span class='upload_filename'> <a href='" + Model.VisaInfoList[i].FilePath + "' target='_blank'>" + Model.VisaInfoList[i].Name + "</a><a href='javascript:void(0);' onclick='PathEditPage.DelFile(this);return false;'> <img style='vertical-align:middle' src='/images/cha.gif'></a><input type='hidden' name='hideVisaFile' value='" + Model.VisaInfoList[i].Name + "|" + Model.VisaInfoList[i].FilePath + "|" + Model.VisaInfoList[i].Downloads.ToString() + "'></span>"; } this.lbqzinfo.Text = visaStr; } } else { Utils.ResponseGoBack(); } } }
private void PageInit(string GYSID) { this.txtsourcename.Text = SiteUserInfo.CompanyName; this.txtname.Text = SiteUserInfo.Name; this.txttel.Text = SiteUserInfo.Telephone; this.txtfax.Text = SiteUserInfo.Fax; EyouSoft.BLL.SourceStructure.BSource BLL = new EyouSoft.BLL.SourceStructure.BSource(); EyouSoft.Model.SourceStructure.MRoute model = BLL.GetRouteModel(GYSID); if (model != null) { this.lbRouteName.Text = model.RouteName; //this.lbPeoNum.Text = model.Adults.ToString() + "<sup>+" + model.Childs.ToString() + "</sup>"; //this.lbAdultsNum.Text = model.Adults.ToString() + "人"; //this.lbChildsNum.Text = model.Childs.ToString() + "人"; //this.txtunitname.Text = model.BuyCompanyName; //this.txtunitContactname.Text = model.Contact; //this.txtunittel.Text = model.Phone; //this.lbRouteName.Text = model.RouteName; #region 行程 IList <EyouSoft.Model.TourStructure.MPlanBaseInfo> planinfo = model.PlanModelList.OrderBy(m => m.Days).ToList(); if (planinfo != null && planinfo.Count > 0) { StringBuilder strAllDateInfo = new StringBuilder(); string Dinner = string.Empty;//包餐(早、中、晚) foreach (EyouSoft.Model.TourStructure.MPlanBaseInfo Plan in planinfo) { if (Plan.Breakfast) { Dinner += "早、"; } if (Plan.Lunch) { Dinner += "中、"; } if (Plan.Supper) { Dinner += "晚、"; } strAllDateInfo.AppendFormat("<table width='696' border='0' align='center' cellpadding='0' cellspacing='0' class='borderline_2'><tr><td width='35%' class='small_title'><b class='font16'>第{0}天 {6}</b></td><td width='15%' class='small_title'><b class='font14'>交通:{1}</b></td><td width='20%' class='small_title'><b class='font14'>餐:{2}</b></td><td width='30%' class='small_title'><b class='font14'>住宿:{3}</b></td></tr></table><table width='696' border='0' align='center' cellpadding='0' cellspacing='0' style='margin-top:0px' class='list_2'><tr><td class='td_text' style='border-top:none;' width='{7}'>{4}</td>{5}</tr></table>", Plan.Days.ToString(), Plan.Traffic, Dinner, Plan.Hotel, Plan.Content, string.IsNullOrEmpty(Plan.FilePath) ? "" : "<td style='border-top:none;'><img src='http://" + Request.Url.Authority + Plan.FilePath + "' width='202' height='163' /></td>", Plan.Section, string.IsNullOrEmpty(Plan.FilePath) ? "100%" : "480px"); Dinner = string.Empty; } this.lbtourplan.Text = strAllDateInfo.ToString(); } #endregion #region 线路特色 if (string.IsNullOrEmpty(model.TripAdvantage)) { this.TPlanFeature.Visible = false; } else { this.lbPlanFeature.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TripAdvantage); } #endregion #region 计划服务 if (model.ServicesModel != null) { #region 务标准 if (string.IsNullOrEmpty(model.ServicesModel.ServiceStandard)) { this.TService.Visible = false; } else { this.lbService.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServicesModel.ServiceStandard); } #endregion #region 务不含 if (string.IsNullOrEmpty(model.ServicesModel.NoNeedItem)) { this.TNoService.Visible = false; } else { this.lbnoService.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServicesModel.NoNeedItem); } #endregion #region 购物安排 if (string.IsNullOrEmpty(model.ServicesModel.ShoppingItem)) { this.TShopping.Visible = false; } else { this.lbshopping.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServicesModel.ShoppingItem); } #endregion #region 儿童安排 if (string.IsNullOrEmpty(model.ServicesModel.ChildServiceItem)) { this.TChildren.Visible = false; } else { this.lbchildren.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServicesModel.ChildServiceItem); } #endregion #region 自费项目 if (string.IsNullOrEmpty(model.ServicesModel.OwnExpense)) { this.TSelfProject.Visible = false; } else { this.lbselfproject.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServicesModel.OwnExpense); } #endregion #region 温馨提醒 if (string.IsNullOrEmpty(model.ServicesModel.WarmRemind)) { this.TWarmRemind.Visible = false; } else { this.lbwarmremind.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServicesModel.WarmRemind); } #endregion #region 注意事项 if (string.IsNullOrEmpty(model.ServicesModel.NeedAttention)) { this.TNeedAttention.Visible = false; } else { this.lbneedattention.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServicesModel.NeedAttention); } #endregion } else { this.TPlanService.Visible = false; } #endregion #region 务标准 if (model.IsTourOrSubentry) { this.TOption.Visible = false; this.lballservice.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.Service); } else { this.TAll.Visible = false; IList <EyouSoft.Model.SourceStructure.MRouteStandard> TeamPrice = model.StandardModelList; StringBuilder strTeamPrice = new StringBuilder(); foreach (MRouteStandard teamprice in TeamPrice) { if (!string.IsNullOrEmpty(teamprice.Type.ToString())) { strTeamPrice.AppendFormat("<tr><td width='9%' align='left'><b class='font14'>{0}</b></td><td align='left'>{1}</td><td width='13%' align='center'>{2}</td>", teamprice.Type.ToString(), EyouSoft.Common.Function.StringValidate.TextToHtml(teamprice.Standard), EyouSoft.Common.UtilsCommons.GetMoneyString(teamprice.UnitPrice, ProviderToMoney) + "/" + teamprice.Unit.ToString()); } } this.lboptionservice.Text = strTeamPrice.ToString(); } #endregion #region 报价备注 this.lbremark.Text = model.PathRemark; #endregion //#region 销售员 //if (model.SaleInfo != null) //{ // var xiaoShouYuanInfo = new EyouSoft.BLL.ComStructure.BComUser().GetModel(model.SaleInfo.SellerId, SiteUserInfo.CompanyId); // if (xiaoShouYuanInfo != null) // { // this.txtname.Text = xiaoShouYuanInfo.ContactName; // this.txttel.Text = xiaoShouYuanInfo.ContactTel; // this.txtfax.Text = xiaoShouYuanInfo.ContactFax; // } //} //#endregion } }