/// <summary> /// 导出Excel /// </summary> private void ListToExcel(string id) { int toXlsRecordCount = UtilsCommons.GetToXlsRecordCount(); if (toXlsRecordCount < 1) { ResponseToXls(string.Empty); } var s = new StringBuilder(); //团号 线路名称 人头数 销售员 计调员 带团导游 s.Append("团号\t线路名称\t人头数\t销售员\t计调\t带团导游\n"); pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page")); EyouSoft.BLL.SourceStructure.BSource bll = new EyouSoft.BLL.SourceStructure.BSource(); //IList<EyouSoft.Model.SourceStructure.MShopClosingCostModel> list = bll.GetShopTradeListModel(id, this.SiteUserInfo.CompanyId, pageIndex, toXlsRecordCount, ref recordCount); //if (list != null && list.Count > 0) //{ // foreach (var t in list) // { // s.AppendFormat( // "{0}\t{1}\t{2}\t{3}\t{4}\t{5}\n", // t.TourCode, // t.RouteName, // (t.PeopleCount.ToString()), // t.Seller, // t.PlanerModel.ContactName, // (t.GuideList != null && t.GuideList.Count > 0) ? t.GuideList[0].Name : ""); // } //} ResponseToXls(s.ToString()); }
/// <summary> /// 删除 /// </summary> /// <param name="guidID">导游编号</param> /// <returns></returns> protected string DeleteGuid() { string msg = string.Empty; string[] stridList = Utils.GetQueryStringValue("idlist").Split(','); if (stridList.Length > 0) { int r = 0; r = new EyouSoft.BLL.SourceStructure.BSource().DeleteGuideModel(stridList); if (r == 1) { msg = UtilsCommons.AjaxReturnJson("1", "删除成功!"); } else if (r == 2) { msg = UtilsCommons.AjaxReturnJson("0", "导游有安排,不能删除!"); } else { msg = UtilsCommons.AjaxReturnJson("0", " 删除失败!"); } } return(msg); }
/// <summary> /// 初始化 /// </summary> private void DataInit(string pathtype, string pathname, string datacount, string auther, DateTime?starttime, DateTime?endtime) { //获取分页参数并强转 pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page")); EyouSoft.BLL.SourceStructure.BSource bsource = new EyouSoft.BLL.SourceStructure.BSource(); EyouSoft.Model.SourceStructure.MRouteListModel listmodel = new EyouSoft.Model.SourceStructure.MRouteListModel(); listmodel.DayCount = Utils.GetInt(datacount); listmodel.OperatorName = auther; listmodel.RouteName = pathname; listmodel.RouteAreaId = Utils.GetInt(pathtype); listmodel.CompanyId = this.SiteUserInfo.CompanyId; IList <EyouSoft.Model.SourceStructure.MRouteListModel> Pathlist = bsource.GetRouteShowModel(listmodel, starttime, endtime, this.pageIndex, this.pageSize, ref recordCount); if (Pathlist != null && Pathlist.Count > 0) { rptList.DataSource = Pathlist; rptList.DataBind(); } else { this.rptList.Controls.Add(new Label() { Text = "<tr><td colspan='8' align='center'>对不起,没有相关数据!</td></tr>" }); ExporPageInfoSelect1.Visible = false; } //绑定分页 BindPage(); }
/// <summary> /// 导出 /// </summary> protected void ToXls() { System.Text.StringBuilder _s = new System.Text.StringBuilder(); //获取分页参数并强转 pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page")); //导游姓名 string guidName = Utils.GetQueryStringValue("txtGuidName"); //上团时间 DateTime?startTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtStartTime")); //下团时间 DateTime?endTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtEndTime")); IList <EyouSoft.Model.SourceStructure.MGuideListGroup> GuidList = new EyouSoft.BLL.SourceStructure.BSource().GetGuideListGroup(guidName, startTime, endTime, this.SiteUserInfo.CompanyId, pageIndex, pageSize, ref recordCount); _s.Append("导游姓名\t团队数\t团天数\t评分(质量管理中导游总分/评分次数\n"); if (GuidList != null && GuidList.Count > 0) { foreach (var item in GuidList) { _s.AppendFormat("{0}\t{1}\t{2}\t{3}\n", item.Name, item.GroupCount, item.DayCount, item.Score); } } ResponseToXls(_s.ToString()); }
/// <summary> /// 页面初始化 /// </summary> protected void DataInit() { string guID = Utils.GetQueryStringValue("Guid"); if (!string.IsNullOrEmpty(guID)) { EyouSoft.Model.SourceStructure.MSourceGuide model = new EyouSoft.BLL.SourceStructure.BSource().GetGuideModel(guID); if (model != null) { if (model.UserModel != null) { this.hidUserId.Value = model.UserModel.UserId; this.txtUserNames.Text = model.UserModel.UserName; //密码 this.txtuserpwd.Value = model.UserModel.Password; this.hidUserPwd.Value = model.UserModel.Password; //确认密码 this.txtConfirmPwd.Value = model.UserModel.Password; this.hidConfirmPwd.Value = model.UserModel.Password; } //人事档案编号 this.GovFileId.Value = model.GovFileId; this.txtName.Value = model.Name; this.seGenerlist.Items.FindByValue(((int)model.Gender).ToString()).Selected = true; this.ddlleaver.Items.FindByValue(((int)model.Level).ToString()).Selected = true; //类型 this.txtLanguage.Value = model.Language; this.txtCardCode.Value = model.IDNumber; this.txtGuidCode.Value = model.GuideNumber; this.txtTeamHeadCode.Value = model.LeaderNumber; this.dAnchoredComlist.Items.FindByValue(((int)model.AnchoredCom > 0 ? (int)model.AnchoredCom : 3).ToString()).Selected = true; this.ddlAnnualReview.Items.FindByValue(model.AnnualReview == true ? "1" : "0").Selected = true; this.txtHomeTel.Value = model.HomeTel; this.txtMoblie.Value = model.Mobile; this.txtQQ.Value = model.QQ; this.txtEmail.Value = model.Email; this.txtHomeAddress.Value = model.Address; this.txtcharacter.Value = model.Character; this.txtExperienceRoute.Value = model.TourExperience; this.txtCommentAssess.Value = model.CustomerReviews; this.txtSpecialty.Value = model.Specialty; this.txtRemark.Value = model.Remarks; //照片 this.hidFilePath.Value = model.Photo; PhonePath = model.Photo; //导游类别 this.litguidType.Text = GetGuideCategory(model.SourceGuideCategoryList); this.BelongDepart.SectionID = model.UserModel.DeptId.ToString(); this.BelongDepart.SectionName = model.UserModel.DeptName; } else { this.litguidType.Text = GetGuideCategory(null); } } else { this.litguidType.Text = GetGuideCategory(null); } }
/// <summary> /// 初始化 /// </summary> private void DataInit() { //获取分页参数并强转 pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page")); //导游姓名 string guidName = Utils.GetQueryStringValue("txtGuidName"); //上团时间 DateTime?startTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtStartTime")); //下团时间 DateTime?endTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtEndTime")); IList <EyouSoft.Model.SourceStructure.MGuideListGroup> GuidList = new EyouSoft.BLL.SourceStructure.BSource().GetGuideListGroup(guidName, startTime, endTime, this.SiteUserInfo.CompanyId, pageIndex, pageSize, ref recordCount); if (GuidList != null && GuidList.Count > 0) { this.replist.DataSource = GuidList; this.replist.DataBind(); BindPage(); } else { this.lab_text.Text = "对不起,没有相关数据!"; this.ExporPageInfoSelect1.Visible = false; this.ExporPageInfoSelect2.Visible = false; } }
protected void DataInit() { PageIndex = Utils.GetInt(Utils.GetQueryStringValue("page")); string Guid = Utils.GetQueryStringValue("Guid"); if (!string.IsNullOrEmpty(Guid)) { DateTime?StartTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtStartTime")); DateTime?endTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtEndTime")); IList <EyouSoft.Model.SourceStructure.MGuideTourList> list = new EyouSoft.BLL.SourceStructure.BSource().GetGuideTourList(Guid, null, null, StartTime, endTime, this.SiteUserInfo.CompanyId, PageIndex, PageSize, ref RecordCount); if (list != null && list.Count > 0) { this.replist.DataSource = list; this.replist.DataBind(); BindPage(); } else { this.lab_Msg.Text = "<tr><td height=\"28px\" bgcolor=\"#FFFFFF\" colspan=\"6\" align=\"center\">暂无数据</td></tr>"; this.lab_Msg.Visible = true; this.ExporPageInfoSelect1.Visible = false; } list = null; } }
/// <summary> /// 初始化 /// </summary> private void DataInit() { //获取分页参数并强转 pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page")); EyouSoft.Model.SourceStructure.MGuideSearchModel search = new EyouSoft.Model.SourceStructure.MGuideSearchModel(); //导游姓名 string guidName = Utils.GetQueryStringValue("txtguidName"); if (!string.IsNullOrEmpty(guidName)) { search.Name = guidName; } //性别 string gener = Utils.GetQueryStringValue("seGender"); if (!string.IsNullOrEmpty(gener) && gener != "-1") { search.Gender = (EyouSoft.Model.EnumType.GovStructure.Gender)Enum.Parse(typeof(EyouSoft.Model.EnumType.GovStructure.Gender), gener); } //类别 string type = Utils.GetQueryStringValue("seType"); if (!string.IsNullOrEmpty(type) && type != "-1") { search.GuideCategory = (EyouSoft.Model.EnumType.SourceStructure.GuideCategory)Enum.Parse(typeof(EyouSoft.Model.EnumType.SourceStructure.GuideCategory), type); } //级别 string leavel = Utils.GetQueryStringValue("seLevel"); if (!string.IsNullOrEmpty(leavel) && leavel != "-1") { search.Level = (EyouSoft.Model.EnumType.SourceStructure.GuideLevel)Enum.Parse(typeof(EyouSoft.Model.EnumType.SourceStructure.GuideLevel), leavel); } //语种 string language = Utils.GetQueryStringValue("txtguidlanguage"); if (!string.IsNullOrEmpty(language)) { search.Language = language; } IList <EyouSoft.Model.SourceStructure.MGuideListModel> userList = new EyouSoft.BLL.SourceStructure.BSource().GetGuideShowModel(search, this.SiteUserInfo.CompanyId, pageIndex, pageSize, ref recordCount); if (userList != null && userList.Count > 0) { this.replist.DataSource = userList; this.replist.DataBind(); BindPage(); } else { this.litdatamsg.Text = "<tr><td align='center' colspan='12'>没有相关数据!</td></tr>"; this.ExporPageInfoSelect1.Visible = false; this.ExporPageInfoSelect2.Visible = false; } }
/// <summary> /// 删除操作 /// </summary> /// <param name="id">删除ID</param> /// <returns></returns> private string DeleteData(string id) { int b = 0; if (!String.IsNullOrEmpty(id)) { EyouSoft.BLL.SourceStructure.BSource bll = new EyouSoft.BLL.SourceStructure.BSource(); b = bll.DeleteRouteModel(id.Split(',')); } return(b == 1 ? UtilsCommons.AjaxReturnJson("1", "删除成功!") : UtilsCommons.AjaxReturnJson("0", "删除失败!")); }
/// <summary> /// 导出Excel /// </summary> private void ListToExcel(string id) { int toXlsRecordCount = UtilsCommons.GetToXlsRecordCount(); if (toXlsRecordCount < 1) { ResponseToXls(string.Empty); } var s = new StringBuilder(); s.Append("团号\t线路名称\t销售员\t计调员\t导游\t出票数\t明细\t结算金额\t未付金额\n"); pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page")); EyouSoft.BLL.SourceStructure.BSource Bll = new EyouSoft.BLL.SourceStructure.BSource(); //IList<EyouSoft.Model.SourceStructure.MTicketClosingCostModel> list = Bll.GetTicketTradeListModel(id, this.SiteUserInfo.CompanyId, pageIndex, toXlsRecordCount, ref recordCount); //if (list != null && list.Count > 0) //{ // foreach (var t in list) // { // s.AppendFormat( // "{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\n", // t.TourCode, // t.RouteName, // t.Seller, // t.PlanerModel.ContactName, // (t.GuideList != null && t.GuideList.Count > 0) ? t.GuideList[0].Name : "", // (t.TicketCountModel.AdultCount.ToString()) + "+" + (t.TicketCountModel.ChildrenCount.ToString()), // t.CostDetail.Replace("\t", " ").Replace("\r\n", " "), // UtilsCommons.GetMoneyString(t.TradeMoney, ProviderToMoney), // UtilsCommons.GetMoneyString(t.UnPaidCost, ProviderToMoney)); // } // s.AppendFormat( // "{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\n", // "", // "", // "", // "", // "", // "", // "合计", // UtilsCommons.GetMoneyString(list[0].TradeMoneySum, ProviderToMoney), // UtilsCommons.GetMoneyString(list[0].UnPaidCostSum, ProviderToMoney)); //} ResponseToXls(s.ToString()); }
/// <summary> /// 页面初始化 /// </summary> /// <param name="id">操作ID</param> protected void PageInit(string id) { EyouSoft.BLL.SourceStructure.BSource bll = new EyouSoft.BLL.SourceStructure.BSource(); pageIndex = Utils.GetInt(Request.QueryString["Page"], 1); IList <EyouSoft.Model.SourceStructure.MAcceptGuestModel> List = bll.GetSKModelList(id, this.SiteUserInfo.CompanyId, pageIndex, pageSize, ref recordCount); if (List != null && List.Count > 0) { this.RptList.DataSource = List; this.RptList.DataBind(); BindPage(); } else { this.Label1.Text = "<tr class=\"odd\"><td height=\"30px\" colspan=\"6\" align=\"center\">暂无交易信息</td></tr>"; } }
/// <summary> /// 页面初始化 /// </summary> /// <param name="id">操作ID</param> protected void PageInit() { EyouSoft.BLL.SourceStructure.BSource bll = new EyouSoft.BLL.SourceStructure.BSource(); EyouSoft.Model.SourceStructure.MRouteListModel seachModel = new EyouSoft.Model.SourceStructure.MRouteListModel(); seachModel.CompanyId = SiteUserInfo.CompanyId; seachModel.RouteAreaId = Utils.GetInt(Utils.GetQueryStringValue("areaId")); seachModel.RouteName = Utils.GetQueryStringValue("txtRouteName"); IList <EyouSoft.Model.SourceStructure.MRouteListModel> list = bll.GetRouteShowModel(seachModel, null, null, pageIndex, pageSize, ref recordCount); rpt_List.DataSource = list; rpt_List.DataBind(); BindPage(); if (list == null || list.Count < 40) { this.ExporPageInfoSelect1.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { PowerControl(); string name = Utils.GetQueryStringValue("name"); string dotype = Utils.GetQueryStringValue("dotype"); string save = Utils.GetQueryStringValue("save"); string time = Utils.GetQueryStringValue("time"); string planid = Utils.GetQueryStringValue("planid"); string type = Utils.GetQueryStringValue("type"); string guideid = Utils.GetQueryStringValue("guideid"); if (dotype != "") { switch (dotype) { case "save": Response.Clear(); Response.Write(PageSave(guideid, planid)); Response.End(); break; case "delete": Response.Clear(); Response.Write(deleteGuid(planid)); Response.End(); break; case "update": GetGuidModel(planid); break; } } if (!IsPostBack) { DataPageInit(name, time, type, guideid); this.GuidControl1.GuidID = guideid; this.GuidControl1.GuidName = name; var daoYouInfo = new EyouSoft.BLL.SourceStructure.BSource().GetGuideModel(guideid); if (daoYouInfo != null) { txttel.Text = daoYouInfo.Mobile; } } }
/// <summary> /// 初始化 /// </summary> private void DataInit(string id) { //获取分页参数并强转 pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page")); EyouSoft.BLL.SourceStructure.BSource bll = new EyouSoft.BLL.SourceStructure.BSource(); //IList<EyouSoft.Model.SourceStructure.MShopClosingCostModel> list = bll.GetShopTradeListModel(id, this.SiteUserInfo.CompanyId, pageIndex, pageSize, ref recordCount); //if (list != null && list.Count > 0) //{ // this.rptList.DataSource = list; // this.rptList.DataBind(); // //绑定分页 // BindPage(); //} //else //{ // this.literMsg.Text = "<tr bgcolor=\"#e9f4f9\" class=\"odd\"><td align=\"center\" height=\"30px\" colspan=\"7\">暂无交易信息!</td></tr>"; //} }
/// <summary> /// 绑定数据源 /// </summary> private void BindSource() { EyouSoft.BLL.SourceStructure.BSource bSource = new EyouSoft.BLL.SourceStructure.BSource(); EyouSoft.Model.SourceStructure.MSourceTravel sourceTravel = bSource.GetTravelServiceModel(SiteUserInfo.SourceCompanyInfo.CompanyId); if (sourceTravel != null) { //查询国家、省市区域 EyouSoft.BLL.ComStructure.BComCity bComCity = new EyouSoft.BLL.ComStructure.BComCity(); EyouSoft.Model.ComStructure.MCPCC m = bComCity.GetCPCD(CurrentUserCompanyID, sourceTravel.SourceModel.CountryId, sourceTravel.SourceModel.ProvinceId, sourceTravel.SourceModel.CityId, sourceTravel.SourceModel.CountyId); if (m != null) { this.lblCountry.Text = m.CountryName; this.lblProvice.Text = m.ProvinceName; this.lblCity.Text = m.CityName; this.lblCounty.Text = m.CountyName; this.lblType.Text = m.CountryName == "中国" ? "国内" : "国外"; } this.lblName.Text = sourceTravel.SourceModel.Name; this.lblLicense.Text = sourceTravel.SourceModel.LicenseKey; this.lblLegalRepresentative.Text = sourceTravel.SourceTravelModel.LegalRepresentative; this.lblLegalRepresentativePhone.Text = sourceTravel.SourceTravelModel.Telephone; this.lblAddress.Text = sourceTravel.SourceModel.Address; this.lblIsSignContract.Text = sourceTravel.SourceModel.IsSignContract == true ? "是" : "否"; this.lblEffectTime.Text = sourceTravel.SourceModel.ContractPeriodEnd != null?sourceTravel.SourceModel.ContractPeriodEnd.Value.ToString("yyyy-MM-dd") : string.Empty; this.lblFeatureRoute.Text = sourceTravel.SourceTravelModel.Routes; this.lblIsSign.Text = sourceTravel.SourceModel.IsPermission == true ? "是" : "否"; this.lblIsRecommend.Text = sourceTravel.SourceModel.IsRecommend == true ? "是" : "否"; this.lblIsRebatePolicy.Text = sourceTravel.SourceModel.IsCommission == true ? "是" : "否"; this.lblRebatePolicy.Text = sourceTravel.SourceModel.UnitPolicy; } }
/// <summary> /// 初始化 /// </summary> private void DataInit(string guidname, int year, int month, DateTime?startTime, DateTime?endTime, string location) { //获取分页参数并强转 pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page")); EyouSoft.BLL.SourceStructure.BSource bll = new EyouSoft.BLL.SourceStructure.BSource(); startTime = (startTime == null ? null : (DateTime?)startTime); endTime = (endTime == null ? null : (DateTime?)endTime); IList <EyouSoft.Model.SourceStructure.MGuidePlanWork> list = bll.GetGuidePlanWork(this.SiteUserInfo.CompanyId, guidname, year, month, startTime, endTime, location, pageIndex, pageSize, ref recordCount); if (list != null && list.Count > 0) { this.rptList.DataSource = list; this.rptList.DataBind(); //绑定分页 BindPage(); } else { this.lbMsg.Text = "<tr><td colspan=\"36\" align=\"center\">暂无信息</td></tr>"; } }
/// <summary> /// 导出Excel /// </summary> private void ListToExcel(string pathtype, string pathname, string datacount, string auther, DateTime?starttime, DateTime?endtime) { int toXlsRecordCount = UtilsCommons.GetToXlsRecordCount(); if (toXlsRecordCount < 1) { ResponseToXls(string.Empty); } var s = new StringBuilder(); //线路区域 线路名称 天数 发布日期 发布人 上团数 收客数 s.Append("线路区域\t线路名称\t天数\t发布日期\t发布人\t上团数\t收客数\n"); pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page")); EyouSoft.BLL.SourceStructure.BSource bsource = new EyouSoft.BLL.SourceStructure.BSource(); EyouSoft.Model.SourceStructure.MRouteListModel listmodel = new EyouSoft.Model.SourceStructure.MRouteListModel(); listmodel.DayCount = Utils.GetInt(datacount); listmodel.OperatorName = auther; listmodel.RouteName = pathname; listmodel.RouteAreaId = Utils.GetInt(pathtype); listmodel.CompanyId = this.SiteUserInfo.CompanyId; IList <EyouSoft.Model.SourceStructure.MRouteListModel> list = bsource.GetRouteShowModel(listmodel, starttime, endtime, this.pageIndex, this.pageSize, ref recordCount); if (list != null && list.Count > 0) { foreach (var t in list) { s.AppendFormat( "{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\n", t.RouteTypeName, t.RouteName, t.DayCount.ToString(), EyouSoft.Common.UtilsCommons.GetDateString(t.IssueTime, ProviderToDate), t.OperatorName, t.STCount.ToString(), t.SKCount.ToString()); } } ResponseToXls(s.ToString()); }
/// <summary> /// 初始化 /// </summary> private void DataInit(string id) { //获取分页参数并强转 pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page")); EyouSoft.BLL.SourceStructure.BSource bll = new EyouSoft.BLL.SourceStructure.BSource(); //IList<Model.SourceStructure.MOtherClosingCostModel> list = bll.GetOtherTradeListModel(id, this.SiteUserInfo.CompanyId, pageIndex, pageSize, ref recordCount); //if (list != null && list.Count > 0) //{ // this.lbClosingCostSum.Text = UtilsCommons.GetMoneyString(list[0].TradeMoneySum, ProviderToMoney); // this.lbUnpaidCostSum.Text = UtilsCommons.GetMoneyString(list[0].UnPaidCostSum, ProviderToMoney); // this.rptList.DataSource = list; // this.rptList.DataBind(); // BindPage(); //} //else //{ // this.lbMsg.Visible = true; // this.lbMsg.Text = "<tr class=\"odd\"><td height=\"30px\" colspan=\"9\" align=\"center\">暂无交易信息</td></tr>"; // this.ExporPageInfoSelect1.Visible = false; //} }
/// <summary> /// 初始化导游信息 /// </summary> /// <param name="name">导游名称</param> /// <param name="time">安排时间</param> /// <param name="tourid">团号</param> /// <param name="type">类型(已安排,假期,停职)</param> protected void DataPageInit(string name, string time, string type, string guideid) { #region 获取导游信息 //导游姓名 this.labinfo.Text = "[" + name + time + "]"; this.lbguidename.Text = name; this.hdplantype.Value = type; this.hdguideid.Value = guideid; #endregion EyouSoft.BLL.SourceStructure.BSource bll = new EyouSoft.BLL.SourceStructure.BSource(); IList <EyouSoft.Model.SourceStructure.MGuidePlanWork> list = bll.GetGuidePlanWorkInfo(this.SiteUserInfo.CompanyId, guideid, Utils.GetDateTime(time)); if (list != null && list.Count > 0) { this.rptList.DataSource = list; this.rptList.DataBind(); } else { phdFrist.Visible = false; } BindJobType(JobType); }
/// <summary> /// 根据供应商商id获取所有的酒店房型 /// </summary> /// <param name="sourceID"></param> /// <returns></returns> protected string GetRoomType(string sourceID, string roomId, string sueID) { System.Text.StringBuilder sbRoomType = new System.Text.StringBuilder(); if (!string.IsNullOrEmpty(sueID)) { EyouSoft.Model.SourceStructure.MSourceSueHotel hotelSue = new EyouSoft.BLL.SourceStructure.BSourceControl().GetModelByHotelId(sueID, this.SiteUserInfo.CompanyId); if (hotelSue != null) { sbRoomType.Append("<option value='" + hotelSue.RoomId + "," + hotelSue.RoomType + "'>" + hotelSue.RoomType + "</option>"); } } else { if (!string.IsNullOrEmpty(sourceID)) { EyouSoft.Model.SourceStructure.MSourceHotel HotelModel = new EyouSoft.BLL.SourceStructure.BSource().GetOneHotelModel(sourceID); if (HotelModel != null) { if (HotelModel.HotelRoomList != null && HotelModel.HotelRoomList.Count > 0) { for (int i = 0; i < HotelModel.HotelRoomList.Count; i++) { if (roomId == HotelModel.HotelRoomList[i].RoomId) { sbRoomType.Append("<option selected='selected' value='" + HotelModel.HotelRoomList[i].RoomId + "," + HotelModel.HotelRoomList[i].TypeName + "'>" + HotelModel.HotelRoomList[i].TypeName + "</option>"); } else { sbRoomType.Append("<option value='" + HotelModel.HotelRoomList[i].RoomId + "," + HotelModel.HotelRoomList[i].TypeName + "'>" + HotelModel.HotelRoomList[i].TypeName + "</option>"); } } } } } } return(sbRoomType.ToString()); }
/// <summary> /// 页面初始化 /// </summary> /// <param name="id">操作ID</param> protected void PageInit(string id, string dotype) { this.UploadControl1.CompanyID = this.SiteUserInfo.CompanyId; this.txtLastHuman.Text = this.SiteUserInfo.Name; this.txtLastDate.Enabled = false; this.txtLastHuman.Enabled = false; if (String.Equals(dotype, "update", StringComparison.InvariantCultureIgnoreCase) && !string.IsNullOrEmpty(id)) { EyouSoft.BLL.SourceStructure.BSource bll = new EyouSoft.BLL.SourceStructure.BSource(); EyouSoft.Model.SourceStructure.MSourceDining model = bll.GetDiningModel(id); if (model != null) { if (model.SourceModel != null) { Countryindex = model.SourceModel.CountryId; Provinceindex = model.SourceModel.ProvinceId; Cityindex = model.SourceModel.CityId; Areaindex = model.SourceModel.CountyId; this.txtaddress.Text = model.SourceModel.Address; this.txthotleinfo.Text = model.SourceModel.Desc; this.txtHotleName.Text = model.SourceModel.Name; this.txtRemarks.Text = model.SourceModel.Remark; this.txtContractDate.Text = UtilsCommons.GetDateString(model.SourceModel.ContractPeriodEnd, ProviderToDate); this.txtContractDate_Start.Text = UtilsCommons.GetDateString(model.SourceModel.ContractPeriodStart, ProviderToDate); this.txtLastDate.Text = UtilsCommons.GetDateString(model.SourceModel.LastModifyTime, ProviderToDate); this.txtLastHuman.Text = model.SourceModel.LastModifierId; string cuisinename = string.Empty; string cuisineid = string.Empty; if (model.DiningCuisineList != null && model.DiningCuisineList.Count > 0) { for (int i = 0; i < model.DiningCuisineList.Count; i++) { if (model.DiningCuisineList.Count - 1 == i) { cuisinename += model.DiningCuisineList[i].Cuisine.ToString(); cuisineid += ((int)model.DiningCuisineList[i].Cuisine).ToString(); } else { cuisinename += model.DiningCuisineList[i].Cuisine.ToString() + ","; cuisineid += ((int)model.DiningCuisineList[i].Cuisine).ToString() + ","; } } } this.CuisineSelect1.CuisineSelectName = cuisinename; this.CuisineSelect1.CuisineSelectID = cuisineid; radno.Checked = true; if (model.SourceModel.IsCommission) { radyes.Checked = true; radno.Checked = false; } Radio_hd_no.Checked = true; if (model.SourceModel.IsSignContract) { Radio_hd_yes.Checked = true; this.Radio_hd_no.Checked = false; this.txtContractNum.Visible = true; this.txtContractNum.Text = model.SourceModel.ContractCode; } RadRecommend_no.Checked = true; if (model.SourceModel.IsRecommend) { RadRecommend_yes.Checked = true; RadRecommend_no.Checked = false; } RadSign_no.Checked = true; if (model.SourceModel.IsPermission) { RadSign_yes.Checked = true; RadSign_no.Checked = false; } if (model.SourceModel.ContractAttach != null) { StringBuilder strFile = new StringBuilder(); if (model.SourceModel.ContractAttach.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=\"CruiseEditPage.DelFile(this)\" title='删除附件'><img style='vertical-align:middle' src='/images/cha.gif'></a><input type=\"hidden\" name=\"hideFileInfo\" value='{1}|{0}'/></span>", model.SourceModel.ContractAttach.FilePath, model.SourceModel.ContractAttach.Name); } this.lbFiles.Text = strFile.ToString(); } } if (!string.IsNullOrEmpty(model.DiningStandard) && model.DiningStandard.Split('-').Length > 1) { this.txtPmax.Text = model.DiningStandard.Split('-')[1].Replace("元", ""); this.txtPmin.Text = model.DiningStandard.Split('-')[0].Replace("元", ""); } if (model.LinkManList.Count > 0) { this.Contact1.SetTravelList = model.LinkManList; } } else { Utils.ResponseGoBack(); } } }
/// <summary> /// 保存按钮点击事件执行方法 /// </summary> protected string PageSave(string doType, string id) { string msg = string.Empty; //t为false为编辑,true时为新增 bool t = String.Equals(doType, "update", StringComparison.InvariantCultureIgnoreCase) && !string.IsNullOrEmpty(id) ? false : true; //餐馆简介 string Hotleinfo = Utils.GetFormValue(this.txthotleinfo.UniqueID); //国家 string country = Utils.GetFormValue(this.ddlCountry.UniqueID); //省份 string provice = Utils.GetFormValue(this.ddlProvice.UniqueID); //城市 string city = Utils.GetFormValue(this.ddlCity.UniqueID); //县区 string area = Utils.GetFormValue(this.ddlArea.UniqueID); //地址 string address = Utils.GetFormValue(this.txtaddress.UniqueID); //菜系编号 string cuisineid = Utils.GetFormValue(this.CuisineSelect1.CuisineSelectIDClient); //餐馆名称 string HotleName = Utils.GetFormValue(this.txtHotleName.UniqueID).Trim(); //备注 string remarks = Utils.GetFormValue(this.txtRemarks.UniqueID); //餐标最大价格 string Pmax = Utils.GetFormValue(this.txtPmax.UniqueID); //餐标最小价格 string Pmin = Utils.GetFormValue(this.txtPmin.UniqueID); //合同开始时间 string StartTime = Utils.GetFormValue(this.txtContractDate_Start.UniqueID); //合同终止时间 string EndTime = Utils.GetFormValue(this.txtContractDate.UniqueID); if (String.IsNullOrEmpty(HotleName)) { return(EyouSoft.Common.UtilsCommons.AjaxReturnJson("0", "请填写餐馆名称!")); } if (string.IsNullOrEmpty(cuisineid)) { return(EyouSoft.Common.UtilsCommons.AjaxReturnJson("0", "请选择菜系!")); } EyouSoft.Model.SourceStructure.MSourceDining mDining = new EyouSoft.Model.SourceStructure.MSourceDining(); EyouSoft.Model.SourceStructure.MSource msource = new EyouSoft.Model.SourceStructure.MSource(); if (!string.IsNullOrEmpty(id)) { mDining = new EyouSoft.BLL.SourceStructure.BSource().GetDiningModel(id); } IList <EyouSoft.Model.SourceStructure.MSourceDiningCuisine> cuisine = new List <EyouSoft.Model.SourceStructure.MSourceDiningCuisine>(); for (int i = 0; i < cuisineid.Split(',').Length; i++) { cuisine.Add(new EyouSoft.Model.SourceStructure.MSourceDiningCuisine() { Cuisine = (EyouSoft.Model.EnumType.SourceStructure.SourceCuisine)(Utils.GetInt(cuisineid.Split(',')[i])) }); } mDining.DiningCuisineList = cuisine; if (!string.IsNullOrEmpty(Pmax + Pmin)) { mDining.DiningStandard = Pmin + "元-" + Pmax + "元"; } else { mDining.DiningStandard = ""; } mDining.LinkManList = Contact1.GetTravelList; if (!String.IsNullOrEmpty(id)) { mDining.SourceId = id; } msource.CompanyId = this.SiteUserInfo.CompanyId; msource.Address = address; msource.ProvinceId = Utils.GetInt(provice); msource.CityId = Utils.GetInt(city); msource.CountyId = Utils.GetInt(area); msource.CountryId = Utils.GetInt(country); msource.Desc = Hotleinfo; msource.Remark = remarks; msource.LastModifierId = this.SiteUserInfo.Name; msource.LastModifyTime = DateTime.Now; msource.ContractPeriodStart = Utils.GetDateTimeNullable(StartTime); msource.ContractPeriodEnd = Utils.GetDateTimeNullable(EndTime); msource.OperatorId = this.SiteUserInfo.UserId; msource.IssueTime = DateTime.Now; //合同附件(新) string[] visaUpload = Utils.GetFormValues(this.UploadControl1.ClientHideID); string[] oldVisaUpload = Utils.GetFormValues("hideFileInfo"); #region 合同附件 EyouSoft.Model.ComStructure.MComAttach visaModel = new EyouSoft.Model.ComStructure.MComAttach(); if (oldVisaUpload.Length > 0) { for (int i = 0; i < oldVisaUpload.Length; i++) { visaModel.FilePath = oldVisaUpload[i].Split('|')[1]; visaModel.ItemType = EyouSoft.Model.EnumType.ComStructure.AttachItemType.供应商合同附件; visaModel.Name = oldVisaUpload[i].Split('|')[0]; visaModel.Size = 0; } } if (visaUpload.Length > 0) { for (int i = 0; i < visaUpload.Length; i++) { if (visaUpload[i].Trim() != "") { if (visaUpload[i].Split('|').Length > 1) { 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; } } } } #endregion msource.ContractAttach = visaModel; msource.IsCommission = true; //是否签单 msource.IsPermission = false; if (RadSign_yes.Checked) { msource.IsPermission = true; } //是否返佣 msource.IsCommission = false; if (radyes.Checked) { msource.IsCommission = true; } //是否推荐 msource.IsRecommend = false; if (RadRecommend_yes.Checked) { msource.IsRecommend = true; } //是否签订合同 msource.IsSignContract = false; if (Radio_hd_yes.Checked) { msource.IsSignContract = true; msource.ContractCode = Utils.GetFormValue(this.txtContractNum.UniqueID); } msource.Name = HotleName; mDining.SourceModel = msource; mDining.LinkManList = UtilsCommons.GetDataList(); EyouSoft.BLL.SourceStructure.BSource bllsource = new EyouSoft.BLL.SourceStructure.BSource(); int result = 0; if (t) {//新增 result = bllsource.AddDiningModel(mDining); if (result == -1) { msg = "{\"result\":\"0\",\"msg\":\"餐馆名称已存在!\"}"; return(msg); } if (result == -2) { msg = "{\"result\":\"0\",\"msg\":\"餐馆已存在此菜系!\"}"; return(msg); } } else { //编辑 result = bllsource.UpdateDiningModel(mDining); if (result == -1) { msg = "{\"result\":\"0\",\"msg\":\"餐馆名称已存在!\"}"; return(msg); } if (result == -2) { msg = "{\"result\":\"0\",\"msg\":\"餐馆已存在此菜系!\"}"; return(msg); } } string type = t ? "新增" : "修改"; if (result > 0) { msg = "{\"result\":\"1\",\"msg\":\"" + type + "成功!\"}"; return(msg); } else { msg = "{\"result\":\"0\",\"msg\":\"" + type + "失败!\"}"; return(msg); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string suppId = EyouSoft.Common.Utils.GetQueryStringValue("suppId"); string type = EyouSoft.Common.Utils.GetQueryStringValue("type"); string source = EyouSoft.Common.Utils.GetQueryStringValue("source"); if (!string.IsNullOrEmpty(suppId) && !string.IsNullOrEmpty(type)) { switch (type) { case "1": //酒店房型 星级 if (!string.IsNullOrEmpty(source)) { if (source == "1") { EyouSoft.Model.SourceStructure.MSourceHotel HotelModel = new EyouSoft.BLL.SourceStructure.BSource().GetOneHotelModel(suppId); if (HotelModel != null) { if (HotelModel.Star != null) { string star = ((int)HotelModel.Star).ToString(); returnMsg(Newtonsoft.Json.JsonConvert.SerializeObject(HotelModel.HotelRoomList), star); } } } else { if (!string.IsNullOrEmpty(EyouSoft.Common.Utils.GetQueryStringValue("company"))) { //预控房型 EyouSoft.Model.SourceStructure.MSourceSueHotel hotelSue = new EyouSoft.BLL.SourceStructure.BSourceControl().GetModelByHotelId(suppId, EyouSoft.Common.Utils.GetQueryStringValue("company")); if (hotelSue != null) { string roomTypelist = string.Empty; roomTypelist = "["; roomTypelist += "{\"RoomId\":\"" + hotelSue.RoomId + "\",\"userNum\":\"" + (hotelSue.ControlNum - hotelSue.AlreadyNum) + "\",\"TypeName\":\"" + hotelSue.RoomType + "\",\"PriceSK\":\"" + EyouSoft.Common.Utils.FilterEndOfTheZeroDecimal(hotelSue.UnitPrice) + "\"},"; roomTypelist = roomTypelist.TrimEnd(','); roomTypelist += "]"; //酒店星级 EyouSoft.Model.SourceStructure.MSourceHotel HotelModel = new EyouSoft.BLL.SourceStructure.BSource().GetOneHotelModel(hotelSue.SourceId); if (HotelModel != null) { if (HotelModel.Star != null) { string star = ((int)HotelModel.Star).ToString(); returnMsg(roomTypelist, star); } } } } } } break; case "3": if (source == "1") { EyouSoft.Model.SourceStructure.MSourceSpot spotmodel = new EyouSoft.BLL.SourceStructure.BSource().GetSpotModel(suppId); if (spotmodel != null) { if (spotmodel.PriceSystemList != null && spotmodel.PriceSystemList.Count > 0) { returnMsg(Newtonsoft.Json.JsonConvert.SerializeObject(spotmodel.PriceSystemList), ""); } else { returnMsg("[]", ""); } } } else { //预控景点 var yk = new EyouSoft.BLL.SourceStructure.BSourceControl().GetModelBySightId(suppId, EyouSoft.Common.Utils.GetQueryStringValue("company")); if (yk != null) { returnMsg("[{\"Id\":\"" + yk.SpotId + "\",\"userNum\":\"" + (yk.ControlNum - yk.AlreadyNum) + "\",\"SpotName\":\"" + yk.SpotName + "\",\"PriceSK\":\"" + EyouSoft.Common.Utils.FilterEndOfTheZeroDecimal(yk.UnitPrice) + "\"}]", ""); } } break; case "13": if (source == "1") { var m = new EyouSoft.BLL.SourceStructure.BSource().GetOtherModel(suppId); if (m != null) { if (m.OtherTypeList != null && m.OtherTypeList.Count > 0) { returnMsg(Newtonsoft.Json.JsonConvert.SerializeObject(m.OtherTypeList), ""); } else { returnMsg("[]", ""); } } } else { //预控其他 var yk = new EyouSoft.BLL.SourceStructure.BSourceControl().GetModelByOtherId(suppId, EyouSoft.Common.Utils.GetQueryStringValue("company")); if (yk != null) { returnMsg("[{\"OtherId\":\"" + yk.TypeId + "\",\"userNum\":\"" + (yk.ControlNum - yk.AlreadyNum) + "\",\"Name\":\"" + yk.TypeName + "\",\"Price\":\"" + EyouSoft.Common.Utils.FilterEndOfTheZeroDecimal(yk.UnitPrice) + "\"}]", ""); } } break; case "14": if (source == "1") { EyouSoft.Model.SourceStructure.MSourceShip shipModel = new EyouSoft.BLL.SourceStructure.BSource().GetShipModel(suppId); if (shipModel != null) { string shipNamelist = string.Empty; shipNamelist = "["; if (shipModel.SubShipList != null && shipModel.SubShipList.Count > 0) { for (int i = 0; i < shipModel.SubShipList.Count; i++) { shipNamelist += "{\"id\":\"" + shipModel.SubShipList[i].SubId + "\",\"text\":\"" + shipModel.SubShipList[i].ShipName + "\"},"; } shipNamelist = shipNamelist.TrimEnd(','); } shipNamelist += "]"; returnMsg(shipNamelist, ""); } } else { string companyID = EyouSoft.Common.Utils.GetQueryStringValue("company"); if (!string.IsNullOrEmpty(companyID)) { string shipNamelist = string.Empty; shipNamelist += "["; EyouSoft.Model.SourceStructure.MSourceSueShip shipName = new EyouSoft.BLL.SourceStructure.BSourceControl().GetModelByShipId(suppId, companyID); if (shipName != null) { shipNamelist += "{\"id\":\"" + shipName.SubId + "\",\"text\":\"" + shipName.ShipName + "\"},"; shipNamelist = shipNamelist.TrimEnd(','); } shipNamelist += "]"; returnMsg(shipNamelist, ""); } } break; case "4": if (source == "1") { EyouSoft.Model.SourceStructure.MSourceShip shipModel = new EyouSoft.BLL.SourceStructure.BSource().GetShipModel(suppId); if (shipModel != null) { string shipNamelist = string.Empty; shipNamelist = "["; if (shipModel.SubShipList != null && shipModel.SubShipList.Count > 0) { for (int i = 0; i < shipModel.SubShipList.Count; i++) { shipNamelist += "{\"id\":\"" + shipModel.SubShipList[i].SubId + "\",\"text\":\"" + shipModel.SubShipList[i].ShipName + "\"},"; } shipNamelist = shipNamelist.TrimEnd(','); } shipNamelist += "]"; returnMsg(shipNamelist, ""); } } else { string companyID = EyouSoft.Common.Utils.GetQueryStringValue("company"); if (!string.IsNullOrEmpty(companyID)) { string shipNamelist = string.Empty; shipNamelist += "["; EyouSoft.Model.SourceStructure.MSourceSueShip shipName = new EyouSoft.BLL.SourceStructure.BSourceControl().GetModelByShipId(suppId, companyID); if (shipName != null) { shipNamelist += "{\"id\":\"" + shipName.SubId + "\",\"text\":\"" + shipName.ShipName + "\"},"; shipNamelist = shipNamelist.TrimEnd(','); } shipNamelist += "]"; returnMsg(shipNamelist, ""); } } break; case "2": if (source == "1") { EyouSoft.Model.SourceStructure.MSourceMotorcade carModel = new EyouSoft.BLL.SourceStructure.BSource().GetMotorcadeModel(suppId); if (carModel != null) { string CarModelList = string.Empty; CarModelList += "["; if (carModel.CarList != null && carModel.CarList.Count > 0) { for (int i = 0; i < carModel.CarList.Count; i++) { CarModelList += "{\"id\":\"" + carModel.CarList[i].CarId + "\",\"text\":\"" + carModel.CarList[i].TypeName + "\",\"CarCode\":\"" + carModel.CarList[i].CarNumber + "\",\"driver\":\"" + carModel.CarList[i].Driver + "\",\"driverTel\":\"" + carModel.CarList[i].DriverTel + "\"},"; } CarModelList = CarModelList.TrimEnd(','); } CarModelList += "]"; returnMsg(CarModelList, ""); } } else { string companyID = EyouSoft.Common.Utils.GetQueryStringValue("company"); if (!string.IsNullOrEmpty(companyID)) { string CarModelList = string.Empty; CarModelList += "["; EyouSoft.Model.SourceStructure.MSourceSueCar CarModel = new EyouSoft.BLL.SourceStructure.BSourceControl().GetModelByCarId(suppId, companyID); EyouSoft.Model.SourceStructure.MSourceMotorcade carModel = new EyouSoft.BLL.SourceStructure.BSource().GetMotorcadeModel(CarModel.SourceId); if (CarModelList != null && carModel != null) { if (carModel.CarList != null && carModel.CarList.Count > 0) { CarModelList += "{\"id\":\"" + CarModel.CarId + "\",\"text\":\"" + CarModel.TypeName + "\",\"CarCode\":\"" + carModel.CarList.First().CarNumber + "\",\"driver\":\"" + carModel.CarList.First().Driver + "\",\"driverTel\":\"" + carModel.CarList.First().DriverTel + "\"},"; } else { CarModelList += "{\"id\":\"" + CarModel.CarId + "\",\"text\":\"" + CarModel.TypeName + "\"},"; } } else { CarModelList += "{\"id\":\"" + CarModel.CarId + "\",\"text\":\"" + CarModel.TypeName + "\"},"; } CarModelList = CarModelList.TrimEnd(','); CarModelList += "]"; returnMsg(CarModelList, ""); } } break; default: break; } } }
/// <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(); } } }
/// <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> protected string PageSave(string doType, string id) { string msg = string.Empty; if (String.IsNullOrEmpty(Utils.GetFormValue(txtteamName.UniqueID))) { msg = "{\"result\":\"0\",\"msg\":\"车队名称不能为空!\"}"; return(msg); } //t为false为编辑,true时为新增 bool t = String.Equals(doType, "update", StringComparison.InvariantCultureIgnoreCase) && !string.IsNullOrEmpty(id) ? false : true; EyouSoft.BLL.SourceStructure.BSource Bll = new EyouSoft.BLL.SourceStructure.BSource(); MSourceMotorcade model = new MSourceMotorcade(); EyouSoft.Model.SourceStructure.MSource mModel = new EyouSoft.Model.SourceStructure.MSource(); IList <EyouSoft.Model.SourceStructure.MSourceCar> carlist = GetDataList(); if (!string.IsNullOrEmpty(Utils.GetQueryStringValue("id"))) { model = new EyouSoft.BLL.SourceStructure.BSource().GetMotorcadeModel(Utils.GetQueryStringValue("id")); } //合同附件(新) string[] visaUpload = Utils.GetFormValues(this.UploadControl1.ClientHideID); string[] oldVisaUpload = Utils.GetFormValues("hideFileInfo"); #region 合同附件 EyouSoft.Model.ComStructure.MComAttach visaModel = new EyouSoft.Model.ComStructure.MComAttach(); if (oldVisaUpload.Length > 0) { for (int i = 0; i < oldVisaUpload.Length; i++) { visaModel.FilePath = oldVisaUpload[i].Split('|')[1]; visaModel.ItemType = EyouSoft.Model.EnumType.ComStructure.AttachItemType.供应商合同附件; visaModel.Name = oldVisaUpload[i].Split('|')[0]; visaModel.Size = 0; } } if (visaUpload.Length > 0) { for (int i = 0; i < visaUpload.Length; i++) { if (visaUpload[i].Trim() != "") { if (visaUpload[i].Split('|').Length > 1) { 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; } } } } #endregion mModel.ContractAttach = visaModel; mModel.Name = Utils.GetFormValue(txtteamName.UniqueID).Trim(); mModel.Remark = Utils.GetFormValue(txtRemark.UniqueID); mModel.Address = Utils.GetFormValue(this.address.UniqueID); model.SourceModel = mModel; model.SourceModel.CountryId = Utils.GetInt(Utils.GetFormValue(this.ddlCountry.UniqueID)); model.SourceModel.ProvinceId = Utils.GetInt(Utils.GetFormValue(this.ddlProvice.UniqueID)); model.SourceModel.CityId = Utils.GetInt(Utils.GetFormValue(this.ddlCity.UniqueID)); model.SourceModel.CountyId = Utils.GetInt(Utils.GetFormValue(this.ddlArea.UniqueID)); model.SourceModel.LastModifierId = this.SiteUserInfo.Name; model.SourceModel.LastModifyTime = DateTime.Now; model.SourceModel.ContractPeriodStart = EyouSoft.Common.Utils.GetDateTimeNullable(Utils.GetFormValue(txtContractDate_Start.UniqueID)); model.SourceModel.ContractPeriodEnd = EyouSoft.Common.Utils.GetDateTimeNullable(Utils.GetFormValue(txtContractDate.UniqueID)); //获取车辆信息 model.CarList = carlist; //获取联系人信息 model.LinkManList = UtilsCommons.GetDataList(); model.SourceModel.CompanyId = this.SiteUserInfo.CompanyId; model.SourceModel.IssueTime = DateTime.Now; if (!String.IsNullOrEmpty(id)) { model.SourceModel.SourceId = id; } //是否返佣 model.SourceModel.IsCommission = false; if (this.RadioButton1.Checked) { model.SourceModel.IsCommission = true; } //是否签单 model.SourceModel.IsPermission = false; if (this.radyes.Checked) { model.SourceModel.IsPermission = true; } //是否推荐 model.SourceModel.IsRecommend = false; if (radRecommendyes.Checked) { model.SourceModel.IsRecommend = true; } //是否签订合同 model.SourceModel.IsSignContract = false; if (Radio_hd_yes.Checked) { model.SourceModel.IsSignContract = true; model.SourceModel.ContractCode = Utils.GetFormValue(this.txtContractNum.UniqueID); } model.SourceModel.OperatorId = this.SiteUserInfo.UserId; int result = 0; if (t) {//新增 result = Bll.AddMotorcadeModel(model); if (result == -1) { msg = "{\"result\":\"0\",\"msg\":\"车辆名已存在!\"}"; return(msg); } } else { //编辑 result = Bll.UpdateMotorcadeModel(model); if (result == -1) { msg = "{\"result\":\"0\",\"msg\":\"车辆名已存在!\"}"; return(msg); } } string type = t ? "新增" : "修改"; if (result > 0) { msg = "{\"result\":\"1\",\"msg\":\"" + type + "成功!\"}"; return(msg); } else { msg = "{\"result\":\"0\",\"msg\":\"" + type + "失败!\"}"; return(msg); } }
/// <summary> /// 页面初始化 /// </summary> /// <param name="id">操作ID</param> protected void PageInit(string id, string dotype) { this.UploadControl1.CompanyID = this.SiteUserInfo.CompanyId; this.txtLastHuman.Text = this.SiteUserInfo.Name; this.txtLastDate.Enabled = false; this.txtLastHuman.Enabled = false; if (String.Equals(dotype, "update", StringComparison.InvariantCultureIgnoreCase) && !string.IsNullOrEmpty(id)) { EyouSoft.BLL.SourceStructure.BSource BLL = new EyouSoft.BLL.SourceStructure.BSource(); EyouSoft.Model.SourceStructure.MSourceMotorcade Model = BLL.GetMotorcadeModel(id); if (Model != null) { Countryindex = Model.SourceModel.CountryId; Provinceindex = Model.SourceModel.ProvinceId; Cityindex = Model.SourceModel.CityId; Areaindex = Model.SourceModel.CountyId; this.txtRemark.Text = Model.SourceModel.Remark; this.txtteamName.Text = Model.SourceModel.Name; this.txtContractDate.Text = UtilsCommons.SetDateTimeFormart(Model.SourceModel.ContractPeriodEnd); this.txtContractDate_Start.Text = UtilsCommons.SetDateTimeFormart(Model.SourceModel.ContractPeriodStart); this.txtLastHuman.Text = Model.SourceModel.LastModifierId; this.txtLastDate.Text = UtilsCommons.GetDateString(Model.SourceModel.LastModifyTime, ProviderToDate); if (Model.SourceModel != null) { this.RadioButton2.Checked = true; if (Model.SourceModel.IsCommission) { this.RadioButton1.Checked = true; this.RadioButton2.Checked = false; } radRecommendno.Checked = true; if (Model.SourceModel.IsRecommend) { radRecommendyes.Checked = true; radRecommendno.Checked = false; } radno.Checked = true; if (Model.SourceModel.IsPermission) { radyes.Checked = true; radno.Checked = false; } Radio_hd_no.Checked = true; if (Model.SourceModel.IsSignContract) { this.Radio_hd_yes.Checked = true; this.Radio_hd_no.Checked = false; this.txtContractNum.Visible = true; this.txtContractNum.Text = Model.SourceModel.ContractCode; } if (Model.SourceModel.ContractAttach != null) { StringBuilder strFile = new StringBuilder(); if (Model.SourceModel.ContractAttach.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=\"CarEditPage.DelFile(this)\" title='删除附件'><img style='vertical-align:middle' src='/images/cha.gif'></a><input type=\"hidden\" name=\"hideFileInfo\" value='{1}|{0}'/></span>", Model.SourceModel.ContractAttach.FilePath, Model.SourceModel.ContractAttach.Name); } this.lbFiles.Text = strFile.ToString(); } } if (Model.LinkManList.Count > 0) { //获取联系人信息 this.Contact1.SetTravelList = Model.LinkManList; } if (Model.CarList.Count > 0) { //获取联系人信息 this.SetTravelList = Model.CarList; } SetListCount = SetTravelList.Count; } else { Utils.ResponseGoBack(); } } }
//保存 protected string PageSave() { string msg = string.Empty; string returnMsg = string.Empty; //用户名 string username = Utils.GetFormValue(this.txtUserNames.UniqueID); //密码 string userpwd = Utils.GetFormValue(this.txtuserpwd.UniqueID); //确认密码 string confirmPwd = Utils.GetFormValue(this.txtConfirmPwd.UniqueID); //姓名 string name = Utils.GetFormValue(this.txtName.UniqueID); //性别 string sex = Utils.GetFormValue(this.seGenerlist.UniqueID); //级别 string leaver = Utils.GetFormValue(this.ddlleaver.UniqueID); //导游类别 string[] guidType = Utils.GetFormValues("guidType"); //精通语种 string language = Utils.GetFormValue(this.txtLanguage.UniqueID); //身份证号 string CardCode = Utils.GetFormValue(this.txtCardCode.UniqueID); //导游证号 string guidCode = Utils.GetFormValue(this.txtGuidCode.UniqueID); //领带证号 string headTeamCode = Utils.GetFormValue(this.txtTeamHeadCode.UniqueID); //导游证挂靠单位 string LinkedUnit = Utils.GetFormValue(this.dAnchoredComlist.UniqueID); //年审状态 string AnnualReview = Utils.GetFormValue(this.ddlAnnualReview.UniqueID); //家庭电话 string homephone = Utils.GetFormValue(this.txtHomeTel.UniqueID); //手机 string phone = Utils.GetFormValue(this.txtMoblie.UniqueID); //qq string qq = Utils.GetFormValue(this.txtQQ.UniqueID); //E-mail string email = Utils.GetFormValue(this.txtEmail.UniqueID); //家庭地址 string homeaddress = Utils.GetFormValue(this.txtHomeAddress.UniqueID); //性格特点 string character = Utils.GetFormValue(this.txtcharacter.UniqueID); //擅长路线 string ExperienceRoute = Utils.GetFormValue(this.txtExperienceRoute.UniqueID); //客户评价 string CommentAssess = Utils.GetFormValue(this.txtCommentAssess.UniqueID); //特长说明 string Specialty = Utils.GetFormValue(this.txtSpecialty.UniqueID); //备注说明 string remark = Utils.GetFormValue(this.txtRemark.UniqueID); //部门编号 int DeptId = Utils.GetInt(Utils.GetFormValue(BelongDepart.SelectIDClient)); if (string.IsNullOrEmpty(username)) { msg += "请输入用户名!<br/>"; } if (string.IsNullOrEmpty(userpwd) && string.IsNullOrEmpty(this.hidUserPwd.UniqueID)) { msg += "请输入密码!<br/>"; } if (string.IsNullOrEmpty(name)) { msg += "请输入姓名!<br/>"; } if (leaver == "-1") { msg += "请选择导游级别!<br/>"; } if (string.IsNullOrEmpty(phone)) { msg += "请输入手机号码!<br/>"; } if (string.IsNullOrEmpty(qq)) { msg += "请输入qq号码!<br/>"; } if (string.IsNullOrEmpty(email)) { msg += "请输入email地址!<br/>"; } if (DeptId.Equals(0)) { msg += "请选择部门编号!<br/>"; } if (!string.IsNullOrEmpty(msg)) { returnMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); return(returnMsg); } EyouSoft.Model.SourceStructure.MSourceGuide GuidModel = new EyouSoft.Model.SourceStructure.MSourceGuide(); GuidModel.Address = homeaddress; GuidModel.AnchoredCom = (EyouSoft.Model.EnumType.SourceStructure.AnchoredCom)Enum.Parse(typeof(EyouSoft.Model.EnumType.SourceStructure.AnchoredCom), LinkedUnit); GuidModel.AnnualReview = AnnualReview == "0" ? false : true; GuidModel.Character = character; GuidModel.CompanyId = this.SiteUserInfo.CompanyId; GuidModel.CustomerReviews = CommentAssess; GuidModel.DeptId = this.SiteUserInfo.DeptId; GuidModel.Email = email; GuidModel.Gender = (EyouSoft.Model.EnumType.GovStructure.Gender)Enum.Parse(typeof(EyouSoft.Model.EnumType.GovStructure.Gender), sex); GuidModel.GuideNumber = guidCode; GuidModel.HomeTel = homephone; GuidModel.IDNumber = CardCode; GuidModel.IssueTime = System.DateTime.Now; GuidModel.Language = language; GuidModel.LeaderNumber = headTeamCode; GuidModel.Level = (EyouSoft.Model.EnumType.SourceStructure.GuideLevel)Enum.Parse(typeof(EyouSoft.Model.EnumType.SourceStructure.GuideLevel), leaver); GuidModel.MaintainId = this.SiteUserInfo.UserId; GuidModel.MaintainTime = System.DateTime.Now; GuidModel.Mobile = phone; GuidModel.Name = name; GuidModel.OperatorId = this.SiteUserInfo.UserId; GuidModel.QQ = qq; GuidModel.Remarks = remark; if (guidType.Length > 0) { GuidModel.SourceGuideCategoryList = new List <EyouSoft.Model.SourceStructure.MSourceGuideCategory>(); for (int i = 0; i < guidType.Length; i++) { EyouSoft.Model.SourceStructure.MSourceGuideCategory category = new EyouSoft.Model.SourceStructure.MSourceGuideCategory(); category.GuideCategory = (EyouSoft.Model.EnumType.SourceStructure.GuideCategory)Enum.Parse(typeof(EyouSoft.Model.EnumType.SourceStructure.GuideCategory), guidType[i]); GuidModel.SourceGuideCategoryList.Add(category); } } GuidModel.Specialty = Specialty; GuidModel.TourExperience = ExperienceRoute; GuidModel.UserModel = new EyouSoft.Model.ComStructure.MComUser(); GuidModel.UserModel.UserName = username; if (userpwd == "") { GuidModel.UserModel.Password = Utils.GetFormValue(this.hidUserPwd.UniqueID); } else { GuidModel.UserModel.Password = userpwd; } GuidModel.UserModel.CompanyId = this.SiteUserInfo.CompanyId; GuidModel.UserModel.ContactEmail = email; GuidModel.UserModel.ContactMobile = phone; GuidModel.UserModel.ContactName = name; GuidModel.UserModel.Operator = this.SiteUserInfo.Name; GuidModel.UserModel.DeptId = DeptId; #region 文件上传 if (!string.IsNullOrEmpty(Utils.GetFormValue("hidFilePath"))) { GuidModel.Photo = Utils.GetFormValue("hidFilePath"); } else { string[] visaUpload = Utils.GetFormValues(this.SingleFileUpload1.ClientHideID); string[] oldVisaUpload = Utils.GetFormValues("hideFileInfo"); if (visaUpload.Length > 0) { for (int i = 0; i < visaUpload.Length; i++) { if (visaUpload[i].Split('|').Length > 1) { GuidModel.Photo = visaUpload[i].Split('|')[1]; } } } else { if (oldVisaUpload.Length > 0) { for (int i = 0; i < oldVisaUpload.Length; i++) { if (oldVisaUpload[i].Split('|').Length > 1) { GuidModel.Photo = oldVisaUpload[i].Split('|')[1]; } } } } } #endregion string id = Utils.GetQueryStringValue("guideID"); if (!string.IsNullOrEmpty(id)) { GuidModel.UserId = this.hidUserId.Value; GuidModel.UserModel.UserId = this.hidUserId.Value; GuidModel.GuideId = id; //人事档案编号 GuidModel.GovFileId = Utils.GetFormValue(this.GovFileId.UniqueID); //返回值 -1:存在相同的用户名 -2:存在相同的身份证号 -3:存在相同的导游证号 小于0:错误 1:正确 int result = new EyouSoft.BLL.SourceStructure.BSource().UpdateGuideModel(GuidModel); switch (result) { case -1: returnMsg = UtilsCommons.AjaxReturnJson("0", "用户名已存在!"); break; case -2: returnMsg = UtilsCommons.AjaxReturnJson("0", "身份证号已存在!"); break; case -3: returnMsg = UtilsCommons.AjaxReturnJson("0", "导游证号已存在!"); break; case 1: returnMsg = UtilsCommons.AjaxReturnJson("1", "修改成功!"); break; default: returnMsg = UtilsCommons.AjaxReturnJson("0", "修改失败!"); break; } } else //添加 { //返回值 -1:存在相同的用户名 -2:存在相同的身份证号 -3:存在相同的导游证号 int result = new EyouSoft.BLL.SourceStructure.BSource().AddGuideModel(GuidModel); switch (result) { case -1: returnMsg = UtilsCommons.AjaxReturnJson("0", "用户名已存在!"); break; case -2: returnMsg = UtilsCommons.AjaxReturnJson("0", "身份证号已存在!"); break; case -3: returnMsg = UtilsCommons.AjaxReturnJson("0", "导游证号已存在!"); break; case 1: returnMsg = UtilsCommons.AjaxReturnJson("1", "添加成功!"); break; default: returnMsg = UtilsCommons.AjaxReturnJson("0", "添加失败!"); break; } } return(returnMsg); }
/// <summary> /// 保存按钮点击事件执行方法 /// </summary> protected string PageSave(string doType, string id) { string msg = string.Empty; //t为false为编辑,true时为新增 bool t = String.Equals(doType, "update", StringComparison.InvariantCultureIgnoreCase) && !string.IsNullOrEmpty(id) ? false : true; //国家 string country = Utils.GetFormValue(this.ddlCountry.UniqueID); //省份 string provice = Utils.GetFormValue(this.ddlProvice.UniqueID); //城市 string city = Utils.GetFormValue(this.ddlCity.UniqueID); //县区 string area = Utils.GetFormValue(this.ddlArea.UniqueID); //地址 string address = Utils.GetFormValue(this.txtaddress.UniqueID); //商店名称 string ShopName = Utils.GetFormValue(this.txtShopName.UniqueID).Trim(); //商品类别 string saleType = Utils.GetFormValue(this.txtSellType.UniqueID); //备注 string remarks = Utils.GetFormValue(this.txtRemarks.UniqueID); //返佣政策 string Policy = Utils.GetFormValue(this.txtPolicy.UniqueID); //合同开始时间 string ContractStartDate = Utils.GetFormValue(this.txtContractDate_Start.UniqueID); //合同有到期时间 string ContractDate = Utils.GetFormValue(this.txtContractDate.UniqueID); //合同号 string ContractNum = Utils.GetFormValue(this.txtContractNum.UniqueID); if (String.IsNullOrEmpty(ShopName)) { msg = EyouSoft.Common.UtilsCommons.AjaxReturnJson("0", "商店名称不能为空"); return(msg); } //合作协议 string[] agrUpload = Utils.GetFormValues(this.UploadControl2.ClientHideID); string[] oldagrUpload = Utils.GetFormValues("hideagreement"); #region 合作协议上传 string agreement = string.Empty; if (oldagrUpload.Length > 0) { for (int i = 0; i < oldagrUpload.Length; i++) { agreement = oldagrUpload[i].Split('|')[1]; } } if (agrUpload.Length > 0) { for (int i = 0; i < agrUpload.Length; i++) { if (agrUpload[i].Trim() != "") { if (agrUpload[i].Split('|').Length > 1) { if (agrUpload[i].Length > 1) { agreement = agrUpload[i].Split('|')[1]; } } } } } #endregion //合同附件 //合同附件(新) string[] visaUpload = Utils.GetFormValues(this.UploadControl1.ClientHideID); string[] oldVisaUpload = Utils.GetFormValues("hideFileInfo"); #region 合同附件 EyouSoft.Model.ComStructure.MComAttach visaModel = new EyouSoft.Model.ComStructure.MComAttach(); if (oldVisaUpload.Length > 0) { for (int i = 0; i < oldVisaUpload.Length; i++) { visaModel.FilePath = oldVisaUpload[i].Split('|')[1]; visaModel.ItemType = EyouSoft.Model.EnumType.ComStructure.AttachItemType.供应商合同附件; visaModel.Name = oldVisaUpload[i].Split('|')[0]; visaModel.Size = 0; } } if (visaUpload.Length > 0) { for (int i = 0; i < visaUpload.Length; i++) { if (visaUpload[i].Trim() != "") { if (visaUpload[i].Split('|').Length > 1) { 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; } } } } #endregion EyouSoft.BLL.SourceStructure.BSource bllsource = new EyouSoft.BLL.SourceStructure.BSource(); EyouSoft.Model.SourceStructure.MSourceShop Model = new EyouSoft.Model.SourceStructure.MSourceShop(); EyouSoft.Model.SourceStructure.MSource source = new EyouSoft.Model.SourceStructure.MSource(); source.CompanyId = this.SiteUserInfo.CompanyId; source.OperatorId = this.SiteUserInfo.UserId; source.DeptId = this.SiteUserInfo.DeptId; source.LastModifierId = this.SiteUserInfo.Name; source.Name = ShopName; source.UnitPolicy = Policy; Model.SellType = saleType; source.ContractPeriodEnd = string.IsNullOrEmpty(ContractDate) ? null : (DateTime?)DateTime.Parse(ContractDate); source.ContractPeriodStart = string.IsNullOrEmpty(ContractStartDate) ? null : (DateTime?)DateTime.Parse(ContractStartDate); source.LastModifyTime = DateTime.Now; source.IssueTime = DateTime.Now; source.Address = address; source.ContractAttach = visaModel; source.AgreementFile = agreement; if (!String.IsNullOrEmpty(id)) { source.SourceId = id; } //返佣 source.IsCommission = false; if (radyes.Checked) { source.IsCommission = true; } //返单 source.IsBackSingle = false; if (radBackSingleyes.Checked) { source.IsBackSingle = true; } //签单 source.IsPermission = false; if (RadSign_yes.Checked) { source.IsPermission = true; } //推荐 source.IsRecommend = false; if (RadRecommend_yes.Checked) { source.IsRecommend = true; } //合同 source.IsSignContract = false; if (Radio_hd_yes.Checked) { source.IsSignContract = true; source.ContractCode = ContractNum; } source.Remark = remarks; source.CountryId = Utils.GetInt(country); source.ProvinceId = Utils.GetInt(provice); source.CityId = Utils.GetInt(city); source.CountyId = Utils.GetInt(area); source.Name = ShopName; //商品类别未赋值 source.OperatorId = this.SiteUserInfo.UserId; Model.LinkManList = UtilsCommons.GetDataList(); Model.SourceModel = source; int result = 0; if (t) {//新增 result = bllsource.AddShopModel(Model); if (result == -1) { msg = EyouSoft.Common.UtilsCommons.AjaxReturnJson("0", "商店名称已存在"); return(msg); } } else { //编辑 result = bllsource.UpdateShopModel(Model); if (result == -1) { msg = EyouSoft.Common.UtilsCommons.AjaxReturnJson("0", "商店名称已存在"); return(msg); } } string type = t ? "新增" : "修改"; if (result > 0) { msg = EyouSoft.Common.UtilsCommons.AjaxReturnJson("1", type + "成功"); return(msg); } else { msg = EyouSoft.Common.UtilsCommons.AjaxReturnJson("0", type + "失败"); return(msg); } }
/// <summary> /// 页面初始化 /// </summary> /// <param name="id">操作ID</param> protected void PageInit(string id, string dotype) { this.UploadControl1.CompanyID = this.SiteUserInfo.CompanyId; this.UploadControl2.CompanyID = this.SiteUserInfo.CompanyId; if (String.Equals(dotype, "update", StringComparison.InvariantCultureIgnoreCase) && !string.IsNullOrEmpty(id)) { EyouSoft.BLL.SourceStructure.BSource bll = new EyouSoft.BLL.SourceStructure.BSource(); EyouSoft.Model.SourceStructure.MSourceShop model = bll.GetShopModel(id); if (model != null) { this.txtSellType.Text = model.SellType; if (model.SourceModel != null) { this.hidSourceID.Value = model.SourceModel.SourceId; Countryindex = model.SourceModel.CountryId; Provinceindex = model.SourceModel.ProvinceId; Cityindex = model.SourceModel.CityId; Areaindex = model.SourceModel.CountyId; this.txtRemarks.Text = model.SourceModel.Remark; this.txtaddress.Text = model.SourceModel.Address; this.txtPolicy.Text = model.SourceModel.UnitPolicy; this.txtContractDate.Text = UtilsCommons.SetDateTimeFormart(model.SourceModel.ContractPeriodEnd); this.txtContractDate_Start.Text = UtilsCommons.SetDateTimeFormart(model.SourceModel.ContractPeriodStart); this.txtLastDate.Text = UtilsCommons.GetDateString(model.SourceModel.LastModifyTime, ProviderToDate); this.txtLastHuman.Text = model.SourceModel.LastModifierId; this.txtShopName.Text = model.SourceModel.Name; //返佣 if (model.SourceModel.IsCommission) { radyes.Checked = true; radno.Checked = false; } //返单 if (model.SourceModel.IsBackSingle) { radBackSingleyes.Checked = true; radBackSingleno.Checked = false; } //签单 if (model.SourceModel.IsPermission) { RadSign_yes.Checked = true; RadSign_no.Checked = false; } //合同 if (model.SourceModel.IsSignContract) { Radio_hd_yes.Checked = true; Radio_hd_no.Checked = false; this.txtContractNum.Text = model.SourceModel.ContractCode; } //推荐 if (model.SourceModel.IsRecommend) { RadRecommend_yes.Checked = true; RadRecommend_no.Checked = false; } if (model.SourceModel.ContractAttach != null) { StringBuilder strFile = new StringBuilder(); if (model.SourceModel.ContractAttach.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=\"ShopEditPage.DelFile(this)\" title='删除附件'><img style='vertical-align:middle' src='/images/cha.gif'></a><input type=\"hidden\" name=\"hideFileInfo\" value='{1}|{0}'/></span>", model.SourceModel.ContractAttach.FilePath, model.SourceModel.ContractAttach.Name); } this.lbhd.Text = strFile.ToString(); } if (model.SourceModel.AgreementFile != "") { StringBuilder agreement = new StringBuilder(); agreement.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=\"ShopEditPage.DelFile(this)\" title='删除附件'><img style='vertical-align:middle' src='/images/cha.gif'></a><input type=\"hidden\" name=\"hideagreement\" value='{1}|{0}'/></span>", model.SourceModel.AgreementFile, getfilename(model.SourceModel.AgreementFile)); this.lbFiles.Text = agreement.ToString(); } } if (model.LinkManList.Count > 0) { this.Contact1.SetTravelList = model.LinkManList; } } else { Utils.ResponseGoBack(); } } this.txtLastDate.Enabled = false; this.txtLastHuman.Enabled = false; }