/// <summary> /// 初始化页面 /// </summary> private void PageInit() { EyouSoft.Model.MTravelArticleCX model = new EyouSoft.Model.MTravelArticleCX(); model.ArticleTitle = Utils.GetQueryStringValue("txtArticleTitle"); model.ClassId = Utils.GetInt(Utils.GetQueryStringValue("ddlArticleClass")); model.KeyWords = Utils.GetQueryStringValue("txtKeyWords"); model.OperatorName = Utils.GetQueryStringValue("txtOperatorName"); model.IssueTimeBegin = !string.IsNullOrEmpty(Utils.GetQueryStringValue("txtStartTime")) ? Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtStartTime")) : null; model.IssueTimeEnd = !string.IsNullOrEmpty(Utils.GetQueryStringValue("txtEndTime")) ? Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtEndTime")) : null; model.IsFrontPage = !string.IsNullOrEmpty(Utils.GetQueryStringValue("ddlIsFrontPage")) ? (bool?)(Utils.GetQueryStringValue("ddlIsFrontPage") == "1" ? true : false) : null; model.IsHot = !string.IsNullOrEmpty(Utils.GetQueryStringValue("ddlIsHot")) ? (bool?)(Utils.GetQueryStringValue("ddlIsHot") == "1" ? true : false) : null; pageIndex = Utils.GetInt(Utils.GetQueryStringValue("Page"), 1); EyouSoft.BLL.OtherStructure.BTravelArticle bll = new EyouSoft.BLL.OtherStructure.BTravelArticle(); IList <EyouSoft.Model.MTravelArticle> list = bll.GetList(pageSize, pageIndex, ref recordCount, model, null); if (list != null && list.Count > 0) { this.RpArticle.DataSource = list; this.RpArticle.DataBind(); BindExportPage(); } else { Literal1.Text = "<tr align=\"center\"> <td colspan=\"12\">没有相关数据</td></tr>"; } }
private void PageInit(string id, string dotype) { if (id != "" && dotype != "add") { EyouSoft.BLL.OtherStructure.BTravelArticle bll = new EyouSoft.BLL.OtherStructure.BTravelArticle(); EyouSoft.Model.MTravelArticle model = bll.GetModel(id); if (model != null) { this.txtArticleTitle.Text = model.ArticleTitle; this.ddlClassId.SelectedValue = model.ClassId.ToString(); //this.txtArticleTag.Text = model.ArticleTag; //this.txtKeyWords.Text = model.KeyWords; //this.txtDescription.Text = model.Description; this.txtArticleText.Text = model.ArticleText; //this.txtASource.Text = model.Source; //this.txtLinkUrl.Text = model.LinkUrl; //this.ddlIsFrontPage.SelectedValue = model.IsFrontPage.HasValue ? (model.IsFrontPage.Value ? "1" : "0") : ""; //this.ddlIsHot.SelectedValue = model.IsHot.HasValue ? (model.IsHot.Value ? "1" : "0") : ""; //this.ddlSort.SelectedValue = model.SortRule.ToString(); //this.hdTitleColor.Value = model.TitleColor; //if (!string.IsNullOrEmpty(model.TitleColor)) //{ // this.txtArticleTitle.Attributes["style"] = string.Format("color:{0}", model.TitleColor); //} upload1.YuanFiles = new List<EyouSoft.Web.UserControl.MFileInfo>() { new EyouSoft.Web.UserControl.MFileInfo() { FileName = "附件", FilePath = model.ImgPath } }; if (dotype.Equals("show")) { this.ltClicks.Text = model.Click.ToString(); this.btn.Visible = false; } } } }
protected void InitList() { string typeStr = Utils.GetConfigString("appSettings", "JCtype"); EyouSoft.Model.TravelArticleOrderBy orderBy = new EyouSoft.Model.TravelArticleOrderBy(); orderBy.FiledOrder = Eyousoft_yhq.Model.TravelArticleFiledOrder.IssueTime; orderBy.OrderBy = Eyousoft_yhq.Model.OrderBy.DESC; List <EyouSoft.Model.TravelArticleOrderBy> orderBys = new List <EyouSoft.Model.TravelArticleOrderBy>(); orderBys.Add(orderBy); EyouSoft.Model.MTravelArticleCX chaxun = new EyouSoft.Model.MTravelArticleCX(); if (typeStr.Length > 0) { chaxun.ZXtype = typeStr.Split(','); } pageIndex = UtilsCommons.GetPagingIndex("Page"); IList <EyouSoft.Model.MTravelArticle> list = new EyouSoft.BLL.OtherStructure.BTravelArticle().GetList(pageSize, pageIndex, ref recordCount, chaxun, orderBys); if (list != null && list.Count > 0) { rpt_Notices.DataSource = list; rpt_Notices.DataBind(); this.ExporPageInfoSelect1.intPageSize = pageSize; this.ExporPageInfoSelect1.CurrencyPage = pageIndex; this.ExporPageInfoSelect1.intRecordCount = recordCount; } else { litMsg.Visible = true; } }
protected void InitList() { string typeStr = Utils.GetConfigString("appSettings", "JCtype"); EyouSoft.Model.TravelArticleOrderBy orderBy = new EyouSoft.Model.TravelArticleOrderBy(); orderBy.FiledOrder = Eyousoft_yhq.Model.TravelArticleFiledOrder.IssueTime; orderBy.OrderBy = Eyousoft_yhq.Model.OrderBy.DESC; List<EyouSoft.Model.TravelArticleOrderBy> orderBys = new List<EyouSoft.Model.TravelArticleOrderBy>(); orderBys.Add(orderBy); EyouSoft.Model.MTravelArticleCX chaxun = new EyouSoft.Model.MTravelArticleCX(); if (typeStr.Length > 0) { chaxun.ZXtype = typeStr.Split(','); } pageIndex = UtilsCommons.GetPagingIndex("Page"); IList<EyouSoft.Model.MTravelArticle> list = new EyouSoft.BLL.OtherStructure.BTravelArticle().GetList(pageSize, pageIndex, ref recordCount, chaxun, orderBys); if (list != null && list.Count > 0) { rpt_Notices.DataSource = list; rpt_Notices.DataBind(); this.ExporPageInfoSelect1.intPageSize = pageSize; this.ExporPageInfoSelect1.CurrencyPage = pageIndex; this.ExporPageInfoSelect1.intRecordCount = recordCount; } else { litMsg.Visible = true; } }
/// <summary> /// 批量删除 /// </summary> /// <param name="ids"></param> /// <returns></returns> private string Delete(string ids) { string msg = null; EyouSoft.BLL.OtherStructure.BTravelArticle bll = new EyouSoft.BLL.OtherStructure.BTravelArticle(); if (bll.Delete(ids.Split(','))) { msg = Utils.AjaxReturnJson("1", "删除成功!"); } else { msg = Utils.AjaxReturnJson("0", "删除失败!"); } return(msg); }
/// <summary> /// 初始化页面 /// </summary> private void PageInit() { EyouSoft.Model.TravelArticleOrderBy orderBy = new EyouSoft.Model.TravelArticleOrderBy(); orderBy.FiledOrder = Eyousoft_yhq.Model.TravelArticleFiledOrder.IssueTime; orderBy.OrderBy = Eyousoft_yhq.Model.OrderBy.DESC; List<EyouSoft.Model.TravelArticleOrderBy> orderBys = new List<EyouSoft.Model.TravelArticleOrderBy>(); orderBys.Add(orderBy); EyouSoft.Model.MTravelArticleCX chaxun = new EyouSoft.Model.MTravelArticleCX(); chaxun.IsSystem = new Eyousoft_yhq.Model.ArticleType[] { Eyousoft_yhq.Model.ArticleType.公告 }; IList<EyouSoft.Model.MTravelArticle> list = new EyouSoft.BLL.OtherStructure.BTravelArticle().GetTopList(1, chaxun, orderBys); if (list != null && list.Count > 0) { lbltext.Text = string.Format(" <div class=\"hot\"><a href=\"/NoticeInfo.aspx?NotIceId={0}\"><b>公告:</b>{1}</a><a href=\"/NoticeList.aspx\" class=\"more\">更多 ></a></div>", list[0].ArticleID, list[0].ArticleTitle); } }
protected void Page_Load(object sender, EventArgs e) { string id = EyouSoft.Common.Utils.GetQueryStringValue("NotIceId"); var model = new EyouSoft.BLL.OtherStructure.BTravelArticle().GetModel(id); InitBind(); if (model != null) { lbl_menu.Text = lbl_title.Text = model.ArticleTitle; lbl_time.Text = model.IssueTime.ToString("yyyy年MM月dd日 HH:MM"); lit_text.Text = model.ArticleText; if (!string.IsNullOrEmpty(model.ImgPath)) { lit_file.Text = string.Format(" 点击查看:<a href=\"{0}\"><font class=\"font_f60\">[附件]</font></a>", model.ImgPath); } } }
/// <summary> /// 初始化页面 /// </summary> private void PageInit() { EyouSoft.Model.TravelArticleOrderBy orderBy = new EyouSoft.Model.TravelArticleOrderBy(); orderBy.FiledOrder = Eyousoft_yhq.Model.TravelArticleFiledOrder.IssueTime; orderBy.OrderBy = Eyousoft_yhq.Model.OrderBy.DESC; List <EyouSoft.Model.TravelArticleOrderBy> orderBys = new List <EyouSoft.Model.TravelArticleOrderBy>(); orderBys.Add(orderBy); EyouSoft.Model.MTravelArticleCX chaxun = new EyouSoft.Model.MTravelArticleCX(); chaxun.IsSystem = new Eyousoft_yhq.Model.ArticleType[] { Eyousoft_yhq.Model.ArticleType.公告 }; IList <EyouSoft.Model.MTravelArticle> list = new EyouSoft.BLL.OtherStructure.BTravelArticle().GetTopList(1, chaxun, orderBys); if (list != null && list.Count > 0) { lbltext.Text = string.Format(" <div class=\"hot\"><a href=\"/NoticeInfo.aspx?NotIceId={0}\"><b>公告:</b>{1}</a><a href=\"/NoticeList.aspx\" class=\"more\">更多 ></a></div>", list[0].ArticleID, list[0].ArticleTitle); } }
protected void Page_Load(object sender, EventArgs e) { string id = EyouSoft.Common.Utils.GetQueryStringValue("NotIceId"); var model = new EyouSoft.BLL.OtherStructure.BTravelArticle().GetModel(id); InitBind(); if (model != null) { lbl_menu.Text = lbl_title.Text = model.ArticleTitle; lbl_time.Text = model.IssueTime.ToString("yyyy年MM月dd日 HH:MM"); lit_text.Text = model.ArticleText; if (!string.IsNullOrEmpty(model.ImgPath)) { lit_file.Text = string.Format(" 点击查看:<a href=\"{0}\"><font class=\"font_f60\">[附件]</font></a>", model.ImgPath); } } }
private void PageInit(string id, string dotype) { if (id != "" && dotype != "add") { EyouSoft.BLL.OtherStructure.BTravelArticle bll = new EyouSoft.BLL.OtherStructure.BTravelArticle(); EyouSoft.Model.MTravelArticle model = bll.GetModel(id); if (model != null) { this.txtArticleTitle.Text = model.ArticleTitle; this.ddlClassId.SelectedValue = model.ClassId.ToString(); //this.txtArticleTag.Text = model.ArticleTag; //this.txtKeyWords.Text = model.KeyWords; //this.txtDescription.Text = model.Description; this.txtArticleText.Text = model.ArticleText; //this.txtASource.Text = model.Source; //this.txtLinkUrl.Text = model.LinkUrl; //this.ddlIsFrontPage.SelectedValue = model.IsFrontPage.HasValue ? (model.IsFrontPage.Value ? "1" : "0") : ""; //this.ddlIsHot.SelectedValue = model.IsHot.HasValue ? (model.IsHot.Value ? "1" : "0") : ""; //this.ddlSort.SelectedValue = model.SortRule.ToString(); //this.hdTitleColor.Value = model.TitleColor; //if (!string.IsNullOrEmpty(model.TitleColor)) //{ // this.txtArticleTitle.Attributes["style"] = string.Format("color:{0}", model.TitleColor); //} upload1.YuanFiles = new List <EyouSoft.Web.UserControl.MFileInfo>() { new EyouSoft.Web.UserControl.MFileInfo() { FileName = "附件", FilePath = model.ImgPath } }; if (dotype.Equals("show")) { this.ltClicks.Text = model.Click.ToString(); this.btn.Visible = false; } } } }
protected void InitList() { EyouSoft.Model.TravelArticleOrderBy orderBy = new EyouSoft.Model.TravelArticleOrderBy(); orderBy.FiledOrder = Eyousoft_yhq.Model.TravelArticleFiledOrder.IssueTime; orderBy.OrderBy = Eyousoft_yhq.Model.OrderBy.DESC; List<EyouSoft.Model.TravelArticleOrderBy> orderBys = new List<EyouSoft.Model.TravelArticleOrderBy>(); orderBys.Add(orderBy); EyouSoft.Model.MTravelArticleCX chaxun = new EyouSoft.Model.MTravelArticleCX(); chaxun.IsSystem = new Eyousoft_yhq.Model.ArticleType[] { Eyousoft_yhq.Model.ArticleType.公告 }; pageIndex = UtilsCommons.GetPagingIndex("Page"); IList<EyouSoft.Model.MTravelArticle> list = new EyouSoft.BLL.OtherStructure.BTravelArticle().GetList(pageSize, pageIndex, ref recordCount, chaxun, orderBys); UtilsCommons.Paging(pageSize, ref pageIndex, recordCount); string pagingScript = "pagingConfig.pageSize={0};pagingConfig.pageIndex={1};pagingConfig.recordCount={2};"; if (list != null && list.Count > 0) { rpt_Notices.DataSource = list; rpt_Notices.DataBind(); } RegisterScript(string.Format(pagingScript, pageSize, pageIndex, recordCount)); }
protected void InitList() { EyouSoft.Model.TravelArticleOrderBy orderBy = new EyouSoft.Model.TravelArticleOrderBy(); orderBy.FiledOrder = Eyousoft_yhq.Model.TravelArticleFiledOrder.IssueTime; orderBy.OrderBy = Eyousoft_yhq.Model.OrderBy.DESC; List <EyouSoft.Model.TravelArticleOrderBy> orderBys = new List <EyouSoft.Model.TravelArticleOrderBy>(); orderBys.Add(orderBy); EyouSoft.Model.MTravelArticleCX chaxun = new EyouSoft.Model.MTravelArticleCX(); chaxun.IsSystem = new Eyousoft_yhq.Model.ArticleType[] { Eyousoft_yhq.Model.ArticleType.公告 }; pageIndex = UtilsCommons.GetPagingIndex("Page"); IList <EyouSoft.Model.MTravelArticle> list = new EyouSoft.BLL.OtherStructure.BTravelArticle().GetList(pageSize, pageIndex, ref recordCount, chaxun, orderBys); UtilsCommons.Paging(pageSize, ref pageIndex, recordCount); string pagingScript = "pagingConfig.pageSize={0};pagingConfig.pageIndex={1};pagingConfig.recordCount={2};"; if (list != null && list.Count > 0) { rpt_Notices.DataSource = list; rpt_Notices.DataBind(); } RegisterScript(string.Format(pagingScript, pageSize, pageIndex, recordCount)); }
/// <summary> /// 保存或修改信息 /// </summary> private string PageSave(string id, string dotype) { //t为true 新增,false 修改 bool t = string.IsNullOrEmpty(id) && dotype == "add"; string msg = string.Empty; EyouSoft.BLL.OtherStructure.BTravelArticle bll = new EyouSoft.BLL.OtherStructure.BTravelArticle(); EyouSoft.Model.MTravelArticle model = new EyouSoft.Model.MTravelArticle(); model.ArticleTitle = Utils.GetFormValue(this.txtArticleTitle.UniqueID); model.ClassId = Utils.GetInt(Utils.GetFormValue(this.ddlClassId.UniqueID)); //model.ArticleTag = Utils.GetFormValue(this.txtArticleTag.UniqueID); //model.KeyWords = Utils.GetFormValue(this.txtKeyWords.UniqueID); //model.Description = Utils.GetFormValue(this.txtDescription.UniqueID); model.ArticleText = Utils.GetFormValue(this.txtArticleText.UniqueID); //model.Source = Utils.GetFormValue(this.txtASource.UniqueID); //model.LinkUrl = Utils.GetFormValue(this.txtLinkUrl.UniqueID); model.IsFrontPage = false; model.IsFrontPage = false; model.IsHot = false; ; //model.SortRule = Utils.GetInt(Utils.GetFormValue(this.ddlSort.UniqueID)); //model.TitleColor = Utils.GetFormValue(this.hdTitleColor.UniqueID); var newFiles = upload1.Files; if (newFiles == null || !newFiles.Any()) { var oldFiles = upload1.YuanFiles; if (oldFiles != null && oldFiles.Any()) { model.ImgPath = oldFiles[0].FilePath; } else { model.ImgPath = string.Empty; } } else { model.ImgPath = newFiles[0].FilePath; } model.IssueTime = DateTime.Now; model.OperatorId = userinfo.UserId; bool result = false; if (t) { result = bll.Add(model); } else { model.ArticleID = id; result = bll.Update(model); } switch (result) { case true: msg = Utils.AjaxReturnJson("1", (t ? "新增" : "修改") + "成功"); break; case false: msg = Utils.AjaxReturnJson("0", (t ? "新增" : "修改") + "失败"); break; default: break; } return msg; }
/// <summary> /// 保存或修改信息 /// </summary> private string PageSave(string id, string dotype) { //t为true 新增,false 修改 bool t = string.IsNullOrEmpty(id) && dotype == "add"; string msg = string.Empty; EyouSoft.BLL.OtherStructure.BTravelArticle bll = new EyouSoft.BLL.OtherStructure.BTravelArticle(); EyouSoft.Model.MTravelArticle model = new EyouSoft.Model.MTravelArticle(); model.ArticleTitle = Utils.GetFormValue(this.txtArticleTitle.UniqueID); model.ClassId = Utils.GetInt(Utils.GetFormValue(this.ddlClassId.UniqueID)); //model.ArticleTag = Utils.GetFormValue(this.txtArticleTag.UniqueID); //model.KeyWords = Utils.GetFormValue(this.txtKeyWords.UniqueID); //model.Description = Utils.GetFormValue(this.txtDescription.UniqueID); model.ArticleText = Utils.GetFormValue(this.txtArticleText.UniqueID); //model.Source = Utils.GetFormValue(this.txtASource.UniqueID); //model.LinkUrl = Utils.GetFormValue(this.txtLinkUrl.UniqueID); model.IsFrontPage = false; model.IsFrontPage = false; model.IsHot = false;; //model.SortRule = Utils.GetInt(Utils.GetFormValue(this.ddlSort.UniqueID)); //model.TitleColor = Utils.GetFormValue(this.hdTitleColor.UniqueID); var newFiles = upload1.Files; if (newFiles == null || !newFiles.Any()) { var oldFiles = upload1.YuanFiles; if (oldFiles != null && oldFiles.Any()) { model.ImgPath = oldFiles[0].FilePath; } else { model.ImgPath = string.Empty; } } else { model.ImgPath = newFiles[0].FilePath; } model.IssueTime = DateTime.Now; model.OperatorId = userinfo.UserId; bool result = false; if (t) { result = bll.Add(model); } else { model.ArticleID = id; result = bll.Update(model); } switch (result) { case true: msg = Utils.AjaxReturnJson("1", (t ? "新增" : "修改") + "成功"); break; case false: msg = Utils.AjaxReturnJson("0", (t ? "新增" : "修改") + "失败"); break; default: break; } return(msg); }
/// <summary> /// 批量删除 /// </summary> /// <param name="ids"></param> /// <returns></returns> private string Delete(string ids) { string msg = null; EyouSoft.BLL.OtherStructure.BTravelArticle bll = new EyouSoft.BLL.OtherStructure.BTravelArticle(); if (bll.Delete(ids.Split(','))) { msg = Utils.AjaxReturnJson("1", "删除成功!"); } else { msg = Utils.AjaxReturnJson("0", "删除失败!"); } return msg; }
/// <summary> /// 初始化页面 /// </summary> private void PageInit() { EyouSoft.Model.MTravelArticleCX model = new EyouSoft.Model.MTravelArticleCX(); model.ArticleTitle = Utils.GetQueryStringValue("txtArticleTitle"); model.ClassId = Utils.GetInt(Utils.GetQueryStringValue("ddlArticleClass")); model.KeyWords = Utils.GetQueryStringValue("txtKeyWords"); model.OperatorName = Utils.GetQueryStringValue("txtOperatorName"); model.IssueTimeBegin = !string.IsNullOrEmpty(Utils.GetQueryStringValue("txtStartTime")) ? Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtStartTime")) : null; model.IssueTimeEnd = !string.IsNullOrEmpty(Utils.GetQueryStringValue("txtEndTime")) ? Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtEndTime")) : null; model.IsFrontPage = !string.IsNullOrEmpty(Utils.GetQueryStringValue("ddlIsFrontPage")) ? (bool?)(Utils.GetQueryStringValue("ddlIsFrontPage") == "1" ? true : false) : null; model.IsHot = !string.IsNullOrEmpty(Utils.GetQueryStringValue("ddlIsHot")) ? (bool?)(Utils.GetQueryStringValue("ddlIsHot") == "1" ? true : false) : null; pageIndex = Utils.GetInt(Utils.GetQueryStringValue("Page"), 1); EyouSoft.BLL.OtherStructure.BTravelArticle bll = new EyouSoft.BLL.OtherStructure.BTravelArticle(); IList<EyouSoft.Model.MTravelArticle> list = bll.GetList(pageSize, pageIndex, ref recordCount, model, null); if (list != null && list.Count > 0) { this.RpArticle.DataSource = list; this.RpArticle.DataBind(); BindExportPage(); } else { Literal1.Text = "<tr align=\"center\"> <td colspan=\"12\">没有相关数据</td></tr>"; } }