protected void Page_Load(object sender, EventArgs e) { string action = Web9long.Web.Util.Query("action"); int objid; if (action == "edit"||action=="view") { if (!int.TryParse(Web9long.Web.Util.Query("id"), out objid)) Web9long.Web.Clew.AlertBack("参数错误"); ety = bll.GetOnlyRow<EmptyTable>("select * from Advertising where DN_id=" + objid); if (ety == null) Web9long.Web.Clew.AlertBack("信息不存在或已被删除!"); txt_Objid.Value = objid.ToString(); } if (!IsPostBack) { if (action == "edit"||action=="view") { txtadTitle.Text = ety.Get<string>("DN_adTitle"); rblAdType.SelectedValue = ety.Get<string>("DN_AdType").Trim(); txtAdRemark.Text = ety.Get<string>("DN_AdRemark"); txtAdNum.Text = ety.Get<string>("DN_AdNum"); txtAdPrice.Text = ety.Get<string>("DN_AdPrice"); txtAdWidth.Text = ety.Get<string>("DN_AdWidth"); txtAdHeight.Text = ety.Get<string>("DN_AdHeight"); rblAdTarget.SelectedValue = ety.Get<string>("DN_AdTarget"); if (action == "view") btnSubmit.Visible = false; } } }
protected void btnSubmit_Click(object sender, EventArgs e) { bool rs = false; string url = "Payment_List.aspx"; ety = new EmptyTable(); ety.TableCondition().TableName = "Com_Payment"; ety.Set("ON_eee",cbleee.Text.Trim()); ety.Set("ON_222",rbl222.SelectedValue.Trim()); ety.Set("ON_title",txttitle.Text.Trim()); ety.Set("ON_paytype",txtpaytype.Text.Trim()); ety.Set("ON_is_lock",txtis_lock.Text.Trim()); ety.Set("ON_sort_id",txtsort_id.Text.Trim()); ety.Set("ON_poundagetype",txtpoundagetype.Text.Trim()); ety.Set("ON_poundage_amount",txtpoundage_amount.Text.Trim()); ety.Set("ON_img_url",txtimg_url.Text.Trim()); ety.Set("ON_remark",txtremark.Text.Trim()); ety.Set("ON_api_path",txtapi_path.Text.Trim()); if (txt_Objid.Value != "") { ety.TableCondition().Where = "ON_ID=" + txt_Objid.Value; rs = bll.Update(ety) > 0; } else { rs = bll.Insert(ety) > 0; } Web9long.Web.Clew.Alert("操作" + (rs ? "成功" : "失败") + "!", url); }
protected void Page_Load(object sender, EventArgs e) { string action = Web9long.Web.Util.Query("action"); int objid; if (action == "edit"||action=="view") { if (!int.TryParse(Web9long.Web.Util.Query("id"), out objid)) Web9long.Web.Clew.AlertBack("参数错误"); ety = bll.GetOnlyRow<EmptyTable>("select * from SYS_channel where CL_ID=" + objid); if (ety == null) Web9long.Web.Clew.AlertBack("信息不存在或已被删除!"); txtObjid.Value = objid.ToString(); } if (!IsPostBack) { if (action == "edit"||action=="view") { txtName.Text = ety.Get<string>("CL_Name"); txtTitle.Text = ety.Get<string>("CL_Title"); ddlModelId.SelectedValue = ety.Get<string>("CL_TypeID"); txtSortId.Text = ety.Get<string>("CL_Sort"); txtwebtitle.Text = ety.Get<string>("CL_SeoTitle"); txtwebkeyword.Text = ety.Get<string>("CL_Keywords"); txtwebdescription.Text = ety.Get<string>("CL_Description"); if (action == "view") Button1.Visible = false; } } }
protected void btnSubmit_Click(object sender, EventArgs e) { bool rs = false; string url = "List_Channel.aspx"; ety = new EmptyTable(); ety.TableCondition().TableName = "SYS_channel"; ety.Set("CL_Name", txtName.Text.Trim()); ety.Set("CL_Title", txtTitle.Text.Trim()); ety.Set("CL_TypeID", ddlModelId.SelectedValue); ety.Set("CL_Sort", txtSortId.Text.Trim()); ety.Set("CL_SeoTitle", txtwebtitle.Text); ety.Set("CL_Keywords", txtwebkeyword.Text); ety.Set("CL_Description", txtwebdescription.Text); if (txtObjid.Value != string.Empty) { base.ChkAdminLevel("sys_channel", "edit"); ety.TableCondition().Where = "CL_ID=" + txtObjid.Value; rs = bll.Update(ety) > 0; } else { base.ChkAdminLevel("sys_channel", "add"); rs = bll.Insert(ety) > 0; } Web9long.Web.Clew.Alert("操作" + (rs ? "成功" : "失败") + "!", url); }
protected void btnSubmit_Click(object sender, EventArgs e) { bool rs = false; string url = "Advertising_List.aspx"; ety = new EmptyTable(); ety.TableCondition().TableName = "Advertising"; ety.Set("DN_adTitle", txtadTitle.Text); ety.Set("DN_AdType", rblAdType.SelectedValue); ety.Set("DN_AdRemark", txtAdRemark.Text); ety.Set("DN_AdNum", txtAdNum.Text); ety.Set("DN_AdPrice", txtAdPrice.Text); ety.Set("DN_AdWidth", txtAdWidth.Text); ety.Set("DN_AdHeight", txtAdHeight.Text); ety.Set("DN_AdTarget", rblAdTarget.SelectedValue); if (txt_Objid.Value != "") { base.ChkAdminLevel("plugins_Ad", "edit"); ety.TableCondition().Where = "DN_ID=" + txt_Objid.Value; rs = bll.Update(ety) > 0; } else { base.ChkAdminLevel("plugins_Ad", "add"); rs = bll.Insert(ety) > 0; } Web9long.Web.Clew.Alert("操作" + (rs ? "成功" : "失败") + "!", url); }
protected void Page_Load(object sender, EventArgs e) { string action = Web9long.Web.Util.Query("action"); int objid; if (action == "edit"||action=="view") { if (!int.TryParse(Web9long.Web.Util.Query("id"), out objid)) Web9long.Web.Clew.AlertBack("参数错误"); ety = bll.GetOnlyRow<EmptyTable>("select * from Com_InnerLink where YN_ID=" + objid); if (ety == null) Web9long.Web.Clew.AlertBack("信息不存在或已被删除!"); txt_Objid.Value = objid.ToString(); } if (!IsPostBack) { if (action == "edit" || action == "view") { txtLinkTitle.Text = ety.Get<string>("YN_LinkTitle"); txtFLSiteURL.Text = ety.Get<string>("YN_FLSiteURL"); txtLinkDesc.Text = ety.Get<string>("YN_LinkDesc"); txtYNState.SelectedValue = ety.Get<string>("YN_State"); if (action == "view") this.btnSubmit.Visible = false; } } }
protected void btnSubmit_Click(object sender, EventArgs e) { bool rs = false; string url = "Adbanner_List.aspx?avid=" + txtavid.Value; ety = new EmptyTable(); ety.TableCondition().TableName = "Adbanner"; ety.Set("DE_AdvID", txtavid.Value.Trim()); ety.Set("DE_AbTitle", txtAbTitle.Text); ety.Set("DE_StartTime", txtStartTime.Text); ety.Set("DE_EndTime", txtEndTime.Text); ety.Set("DE_AdUrl", txtAdUrl.Text); ety.Set("DE_LinkUrl", txtLinkUrl.Text); ety.Set("DE_AbRemark", txtAbRemark.Text); ety.Set("DE_SortId", txtSortId.Text); ety.Set("DE_IsLock", rblIsLock.SelectedValue); if (txt_Objid.Value != "") { ety.TableCondition().Where = "DE_ID=" + txt_Objid.Value; rs = bll.Update(ety) > 0; } else { rs = bll.Insert(ety) > 0; } Web9long.Web.Clew.Alert("操作" + (rs ? "成功" : "失败") + "!", url); }
protected void btnSubmit_Click(object sender, EventArgs e) { bool rs = false; string url = "FrendLink_List.aspx"; ety = new EmptyTable(); ety.TableCondition().TableName = "Com_FrendLink"; ety.Set("YN_FLSiteName", txtFLSiteName.Text); ety.Set("YN_FLSiteURL", txtFLSiteURL.Text); ety.Set("YN_FLstationMaster", txtFLstationMaster.Text); ety.Set("YN_FLTelephone", txtFLTelephone.Text); ety.Set("YN_FlSortNumber", txtFlSortNumber.Text); ety.Set("YN_State", txtYNState.SelectedValue); if (txt_Objid.Value != "") { base.ChkAdminLevel("plugins_Link", "edit"); ety.TableCondition().Where = "YN_ID=" + txt_Objid.Value; rs = bll.Update(ety) > 0; } else { base.ChkAdminLevel("plugins_Link", "Add"); rs = bll.Insert(ety) > 0; } Web9long.Web.Clew.Alert("操作" + (rs ? "成功" : "失败") + "!", url); }
protected void Page_Load(object sender, EventArgs e) { string action = Web9long.Web.Util.Form("action"); switch (action) { case "checklogin": string username = Web9long.Web.Util.Form("username"); string pwd = Web9long.Web.Util.Form("password"); string code = Web9long.Web.Util.Form("verifycode").Trim(); string ExpiresDate = Web9long.Web.Util.Form("ExpiresDate"); string rs=string.Empty; if (code.ToLower() != Session["VerCode"].ToString().ToLower().Trim()) { rs = "验证码错误"; } else { bool rember = ExpiresDate.Trim() == "1"; SYS_ManageInfo ety = ManageDAL.ManageTryLogin(username, pwd, rember, out rs); EmptyTable et = new EmptyTable(); et.TableCondition().TableName = "Sys_Managelog"; et.Set("user_name", username); et.Set("login_ip", Web9long.Web.Util.AgentIp()); et.Set("note",rs==string.Empty?"成功登录":rs); using (SiteBLL bll = new SiteBLL()) { bll.Insert(et); } } Response.Write(rs); Response.End(); break; } }
protected void Page_Load(object sender, EventArgs e) { int objid; if (!int.TryParse(Web9long.Web.Util.Query("avid"), out objid)) Web9long.Web.Clew.AlertBack("参数错误"); ety = bll.GetOnlyRow<EmptyTable>("select * from Advertising where DN_id=" + objid); if (ety == null) Web9long.Web.Clew.AlertBack("信息不存在或已被删除!"); }
public ObservableCollection <EmptyTable> gettermresult() { string[] names = (from n in Searchlist.Keys select n).ToArray(); List <ClassListLight> clist = new List <ClassListLight>(); ObservableCollection <EmptyTable> t = new ObservableCollection <EmptyTable>(); int[] allweeks = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }; for (int i = 0; i < 7; i++) //星期 { for (int j = 0; j < 6; j++) //时段 { EmptyTable temp = new EmptyTable { Hash_day = i, Hash_lesson = j }; temp.nameweek = new Dictionary <string, int[]>(); foreach (var key in Searchlist.Keys) { IEnumerable <int[]> a = from n in Searchlist[key] where n.Hash_day == i && n.Hash_lesson == j select n.Week; //var b=from x in Searchlist group x.Value by x.Key into g List <int[]> listweek = a.ToList(); List <int> onweeks = new List <int>(); for (int m = 0; m < listweek.Count; m++) { onweeks.AddRange(listweek[m]); } int[] free = allweeks.Except(onweeks.ToArray()).ToArray(); free = free.Distinct().ToArray(); if (listweek.Count == 0)//这个时候我没课 { temp.nameweek.Add(key, allweeks); } else if (free.Length == 18) { //这个时候我一学期都有课 continue; } else//这个时候我有课,找出我没课的周 { temp.nameweek.Add(key, free); } } t.Add(temp); } } return(t); }
protected void btnSubmit_Click(object sender, EventArgs e) { bool rs = false; string url = "state_List.aspx"; ety = new EmptyTable(); ety.TableCondition().TableName = "stateinfo"; ety.Set("TF_staName",txtstaName.Text); ety.Set("TF_staConten",txtstaConten.Value); if (txt_Objid.Value != "") { ety.TableCondition().Where = "TF_ID=" + txt_Objid.Value; rs = bll.Update(ety) > 0; } else { rs = bll.Insert(ety) > 0; } Web9long.Web.Clew.Alert("操作" + (rs ? "成功" : "失败") + "!", url); }
protected void Page_Load(object sender, EventArgs e) { string sql = @" select top 1 CategoryID,title, ArticleID,CateCallIndex,CL_Name,Imgurl,Zhaiyao from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and CategoryID={0} and Imgurl<>'' and Islock<>1 order by Istop desc,Sortid desc,ArticleID desc "; sql = string.Format(sql, ClassID); using (SiteBLL bll = new SiteBLL()) { List<EmptyTable> ls = bll.GetList<EmptyTable>(sql); string ids = string.Empty; if (ls != null && ls.Count > 0) { foreach (EmptyTable et in ls) { ids += et.Get<string>("ArticleID") + ","; } ety=ls[0]; } sql = @" select top 2 CategoryID,title, ArticleID,CateCallIndex,CL_Name from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and CategoryID={0} {1} and Islock<>1 order by Istop desc,Sortid desc,ArticleID desc "; if (!string.IsNullOrEmpty(ids)) { ids = ids.TrimEnd(','); ids = " and ArticleID not in(" + ids + ")"; } sql = string.Format(sql, ClassID, ids); this.rpt_List_News.DataSource = bll.GetList<EmptyTable>(sql); this.Page.DataBind(); } }
public void EmptyTableSerialize() { EmptyTable table = new EmptyTable(); byte[] buffer = new byte[1024]; byte[] expectedData = { 4, 0, 0, 0, 252, 255, 255, 255, 4, 0, 4, 0, }; int bytesWritten = FlatBufferSerializer.Default.Serialize(table, buffer); Assert.True(expectedData.AsSpan().SequenceEqual(buffer.AsSpan().Slice(0, bytesWritten))); int maxSize = FlatBufferSerializer.Default.GetMaxSize(table); Assert.Equal(23, maxSize); }
protected void Page_Load(object sender, EventArgs e) { string action = Web9long.Web.Util.Query("action"); int objid; if (action == "edit") { if (!int.TryParse(Web9long.Web.Util.Query("id"), out objid)) Web9long.Web.Clew.AlertBack("参数错误"); ety = bll.GetOnlyRow<EmptyTable>("select * from stateinfo where TF_id="+objid); if (ety == null) Web9long.Web.Clew.AlertBack("信息不存在或已被删除!"); txt_Objid.Value = objid.ToString(); } if (!IsPostBack) { if (action == "edit") { txtstaName.Text= ety.Get<string>("TF_staName"); txtstaConten.Value= ety.Get<string>("TF_staConten"); } } }
protected void Page_Load(object sender, EventArgs e) { string action = Web9long.Web.Util.Query("action"); int objid; if (action == "edit") { if (!int.TryParse(Web9long.Web.Util.Query("id"), out objid)) Web9long.Web.Clew.AlertBack("参数错误"); ety = bll.GetOnlyRow<EmptyTable>("select * from Com_Payment where ON_id="+objid); if (ety == null) Web9long.Web.Clew.AlertBack("信息不存在或已被删除!"); txt_Objid.Value = objid.ToString(); } if (!IsPostBack) { if (action == "edit") { cbleee.SelectedValue= ety.Get<string>("ON_eee"); rbl222.SelectedValue= ety.Get<string>("ON_222").Trim(); txttitle.Text= ety.Get<string>("ON_title").Trim(); txtpaytype.Text= ety.Get<string>("ON_paytype").Trim(); txtis_lock.Text= ety.Get<string>("ON_is_lock").Trim(); txtsort_id.Text= ety.Get<string>("ON_sort_id").Trim(); txtpoundagetype.Text= ety.Get<string>("ON_poundagetype").Trim(); txtpoundage_amount.Text= ety.Get<string>("ON_poundage_amount").Trim(); txtimg_url.Text= ety.Get<string>("ON_img_url").Trim(); txtremark.Text= ety.Get<string>("ON_remark").Trim(); txtapi_path.Text= ety.Get<string>("ON_api_path").Trim(); } } }
protected void Page_Load(object sender, EventArgs e) { string action = Web9long.Web.Util.Query("action"); int objid; int advid; if (!int.TryParse(Web9long.Web.Util.Query("avid"), out advid)) Web9long.Web.Clew.AlertBack("参数错误"); this.txtavid.Value = advid.ToString(); EmptyTable advety = bll.GetOnlyRow<EmptyTable>("select * from Advertising where DN_id=" + advid); if (advety == null) Web9long.Web.Clew.AlertBack("广告位信息不存在!"); this.txtadvname.Text = "【" + advety.Get<string>("DN_ID") + "】" + advety.Get<string>("DN_adTitle") + "(" + advety.Get<string>("DN_AdType") + ")"; this.txtadvname.Enabled = false; if (action == "edit") { if (!int.TryParse(Web9long.Web.Util.Query("id"), out objid)) Web9long.Web.Clew.AlertBack("参数错误"); ety = bll.GetOnlyRow<EmptyTable>("select * from Adbanner where DE_id=" + objid); if (ety == null) Web9long.Web.Clew.AlertBack("信息不存在或已被删除!"); txt_Objid.Value = objid.ToString(); } if (!IsPostBack) { if (action == "edit") { txtAbTitle.Text = ety.Get<string>("DE_AbTitle"); txtStartTime.Text = ety.Get<DateTime>("DE_StartTime").ToString("yyyy-MM-dd"); txtEndTime.Text = ety.Get<DateTime>("DE_EndTime").ToString("yyyy-MM-dd"); txtAdUrl.Text = ety.Get<string>("DE_AdUrl"); txtLinkUrl.Text = ety.Get<string>("DE_LinkUrl"); txtAbRemark.Text = ety.Get<string>("DE_AbRemark"); txtSortId.Text = ety.Get<string>("DE_SortId"); rblIsLock.SelectedValue = ety.Get<string>("DE_IsLock"); } } }
protected void Page_Load(object sender, EventArgs e) { string tempstr = Web9long.Web.WebCommon.Query("channelid"); if (!int.TryParse(tempstr, out channelid)) Web9long.Web.Clew.AlertBack("频道参数错误!"); string action = Web9long.Web.Util.Query("action"); int objid; if (action == "edit"||action=="view") { if (!int.TryParse(Web9long.Web.Util.Query("id"), out objid)) Web9long.Web.Clew.AlertBack("参数错误"); ety = bll.GetOnlyRow<EmptyTable>("select * from SYS_Content where ArticleID=" + objid); if (ety == null) Web9long.Web.Clew.AlertBack("信息不存在或已被删除!"); txtobjID.Value = objid.ToString(); } if (!IsPostBack) { if (action == "edit"||action=="view") { txtTitle.Text = ety.Get<string>("title"); txtSTitle.Text = ety.Get<string>("SmilTitle"); if (ety.Get<int>("Ismsg") == 1) { cblItem.Items[0].Selected = true; } if (ety.Get<int>("Istop") == 1) { cblItem.Items[1].Selected = true; } if (ety.Get<int>("Isred") == 1) { cblItem.Items[2].Selected = true; } if (ety.Get<int>("Ishot") == 1) { cblItem.Items[3].Selected = true; } if (ety.Get<int>("Isslide") == 1) { cblItem.Items[4].Selected = true; } if (ety.Get<int>("Islock") == 1) { cblItem.Items[5].Selected = true; } txtAuthor.Text = ety.Get<string>("Author"); txtFrom.Text = ety.Get<string>("Source"); txtZhaiyao.Text = ety.Get<string>("Zhaiyao"); txtSortId.Text = ety.Get<string>("Sortid"); txtClick.Text = ety.Get<string>("ClickHits"); txtImgUrl.Text = ety.Get<string>("Imgurl"); txtDiggGood.Text = ety.Get<string>("DiggGood"); txtDiggBad.Text = ety.Get<string>("DiggBad"); txtContent.Value = ety.Get<string>("content"); txtLinkUrl.Text = ety.Get<string>("LinkUrl"); txtSeoTitle.Text = ety.Get<string>("Seotitle"); txtSeoKeywords.Text = ety.Get<string>("Seokeywords"); txtSeoDescription.Text = ety.Get<string>("SeoSdescription"); if (action == "view") btnSubmit.Visible = false; } } }
protected void Page_Load(object sender, EventArgs e) { webconfig = Loneu.BLL.Config.WebSiteConfig.Info(); string sql = string.Empty; string ids = string.Empty; List<EmptyTable> ls = null; using (SiteBLL bll = new SiteBLL()) { #region 今日发布 sql = @" select top 10 CategoryID,title, ArticleID,CateCallIndex,CL_Name,Addtime,Zhaiyao from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and Islock<>1 and title<>'' order by Addtime desc,Sortid desc,ArticleID desc "; ls = bll.GetList<EmptyTable>(sql); if (ls != null && ls.Count > 0) { topNews = ls[0]; ls.Remove(topNews); } this.rpt_New_9NewsList.DataSource = ls; #endregion #region 热点排行 sql = @" select top 10 CategoryID,title, ArticleID,CateCallIndex,CL_Name,Addtime,Zhaiyao,Imgurl from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and Islock<>1 and title<>'' and Imgurl<>'' and Isred=1 order by Sortid desc,ArticleID desc "; ls = new List<EmptyTable>(); ls = bll.GetList<EmptyTable>(sql); if (ls != null && ls.Count > 0) { hotNews = ls[0]; ls.Remove(hotNews); } this.rpt_Hits_NewsList.DataSource = ls; #endregion #region 图文精华 sql = @" select top 10 CategoryID,title, ArticleID,CateCallIndex,CL_Name,Addtime,Zhaiyao,Imgurl from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and Islock<>1 and title<>'' and Imgurl<>'' and Zhaiyao<>'' order by Addtime desc,ArticleID desc "; this.rpt_List_PhotoNews.DataSource = bll.GetList<EmptyTable>(sql); #endregion //夷木百科及纵览 sql = @" select top 10 CategoryID,title, ArticleID,CateCallIndex,CL_Name,Imgurl from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and sys_article.ChannelID=45 and Islock<>1 order by Istop desc,Sortid desc,ArticleID desc"; this.rpt_list_yimu.DataSource = bll.GetList<EmptyTable>(sql); //数据发布纵横 sql = @" select top 8 CategoryID,title, ArticleID,CateCallIndex,CL_Name,Imgurl from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and sys_article.ChannelID=39 and Imgurl<>'' and Islock<>1 order by Istop desc,Sortid desc,ArticleID desc"; rpt_list_PostData.DataSource = bll.GetList<EmptyTable>(sql); //空气净化器纵览 sql = @" select top 2 CategoryID,title, ArticleID,CateCallIndex,CL_Name,Imgurl from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and sys_article.ChannelID=51 and Imgurl<>'' and Islock<>1 order by ArticleID desc "; ls = bll.GetList<EmptyTable>(sql); ids = string.Empty; if (ls != null && ls.Count > 0) { foreach (EmptyTable et in ls) { ids += et.Get<string>("ArticleID") + ","; } } this.rpt_List_Photo_kongqi.DataSource = ls; sql = @" select top 5 CategoryID,title, ArticleID,CateCallIndex,CL_Name from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and sys_article.ChannelID=51 {0} and Islock<>1 order by ArticleID desc "; if (!string.IsNullOrEmpty(ids)) { ids = ids.TrimEnd(','); ids = " and ArticleID not in(" + ids + ")"; } sql = string.Format(sql, ids); this.rpt_List_News_kongqi.DataSource = bll.GetList<EmptyTable>(sql); //甲醛清除纵览 sql = @" select top 10 CategoryID,title, ArticleID,CateCallIndex,CL_Name from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and sys_article.ChannelID=56 and Islock<>1 order by Istop desc,Sortid desc,ArticleID desc"; this.rpt_List_jiaquan.DataSource = bll.GetList<EmptyTable>(sql); #region 社区生活纵览 sql = @" select top 2 CategoryID,title, ArticleID,CateCallIndex,CL_Name,Imgurl from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and sys_article.ChannelID=2 and Imgurl<>'' and Islock<>1 order by Istop desc,Sortid desc,ArticleID desc"; ls = bll.GetList<EmptyTable>(sql); this.rpt_list_shenghuo_Photo.DataSource = ls; ids = string.Empty; if (ls != null && ls.Count > 0) { foreach (EmptyTable et in ls) { ids += et.Get<string>("ArticleID") + ","; } } sql = @" select top 5 CategoryID,title, ArticleID,CateCallIndex,CL_Name from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and sys_article.ChannelID=2 {0} and Islock<>1 order by Istop desc,Sortid desc,ArticleID desc "; if (!string.IsNullOrEmpty(ids)) { ids = ids.TrimEnd(','); ids = " and ArticleID not in(" + ids + ")"; } sql = string.Format(sql, ids); this.rpt_List_shenghuo_news.DataSource = bll.GetList<EmptyTable>(sql); #endregion //热点纵览 sql = @" select top 10 CategoryID,title, ArticleID,CateCallIndex,CL_Name from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and sys_article.ChannelID=63 and Islock<>1 order by Istop desc,Sortid desc,ArticleID desc"; rpt_list_Hot.DataSource = bll.GetList<EmptyTable>(sql); } this.Page.DataBind(); }
//添加数据 public bool InsertDataToDatabase(string weburl) { EmptyTable info = new EmptyTable(); info.TableCondition().TableName = "SYS_Article"; info.Set("CategoryID", this.txt_classid.Text.Trim()); info.Set("ChannelID", this.txt_channelid.Text.Trim()); try { string rs = WebDate.GetWebsitedata(weburl, ""); rs = Regex.Replace(rs, "[\f\n\r\t\v]", ""); rs = Regex.Replace(rs, " {2,}", " "); rs = Regex.Replace(rs, ">[ ]{1}", ">"); string reg = "<div class=\"endContent\"><h1><strong>([\\S\\s]*?)</h1>";//">.+?<strong>.; //"<strong>([^\\s]+)</strong>([^\\s]+)</td>"; string tmpstr = WebDate.NoHTML(WebDate.GetItemValue(rs, reg, 1)); //关键字 reg = "<meta name=\"keywords\" content=\"([\\S\\s]*?)\" />"; tmpstr = WebDate.NoHTML(WebDate.GetItemValue(rs, reg, 1)); info.Set("Seokeywords", tmpstr); //添加日期 reg = "<center>文章添加时间([\\S\\s]*?)最后更新时间([\\S\\s]*?)</center>";//">.+?<strong>.; //"<strong>([^\\s]+)</strong>([^\\s]+)</td>"; tmpstr = WebDate.NoHTML(WebDate.GetItemValue(rs, reg, 1)); //DateTime dt; DateTime sdt=System.DateTime.Now; if (!string.IsNullOrEmpty(tmpstr)) { if (DateTime.TryParse(tmpstr, out sdt)) { info.Set("Addtime", sdt.ToLocalTime()); } // sdt = tmpstr; } DateTime edt = System.DateTime.Now; tmpstr = WebDate.NoHTML(WebDate.GetItemValue(rs, reg, 2)); if (!string.IsNullOrEmpty(tmpstr)) { if (DateTime.TryParse(tmpstr, out edt)) { info.Set("Updatetime", edt.ToLocalTime()); } //edt = tmpstr; } //描述 reg = "<meta name=\"description\" content=\"([\\S\\s]*?)\" />"; tmpstr = WebDate.NoHTML(WebDate.GetItemValue(rs, reg, 1)); info.Set("SeoSdescription", tmpstr); //标题 reg = "class=\"endContent\"><h1>([\\S\\s]*?)</h1>"; tmpstr = WebDate.NoHTML(WebDate.GetItemValue(rs, reg, 1)); info.Set("title", tmpstr); info.Set("SmilTitle", tmpstr); //摘要 reg = "class=\"summary\">([\\S\\s]*?)</div>"; tmpstr = WebDate.NoHTML(WebDate.GetItemValue(rs, reg, 1)).Replace("摘要:", ""); info.Set("Zhaiyao", tmpstr); //内容 reg = "</table>([\\S\\s]*?)<div>([\\S\\s]*?)<div class=\"pages\"></div>"; tmpstr = WebDate.GetItemValue(rs, reg,2); if (!string.IsNullOrEmpty(tmpstr)) { info.Set("content", "<div>" + tmpstr); } //形象图 reg = "name=\"wpic\" value=\"([\\S\\s]*?)\" />"; tmpstr = WebDate.GetItemValue(rs, reg, 1); if (!string.IsNullOrEmpty(tmpstr)) { info.Set("Imgurl", tmpstr); } int st = weburl.LastIndexOf('/')+1; string codes = weburl.Substring(st).Replace(".html", ""); if (!string.IsNullOrEmpty(codes)) info.Set("ArticleID", codes.Trim()); ////产品图片 //string fname = Guid.NewGuid().ToString() + ".jpg"; ; ////获取图片 //rs = WebDate.GetWebsitedata("http://buy.officedepot.com.cn/iframe/showpic.jsp?id=" + id + "", ""); //rs = Regex.Replace(rs, "[\f\n\r\t\v]", ""); //rs = Regex.Replace(rs, " {2,}", " "); //rs = Regex.Replace(rs, ">[ ]{1}", ">"); //reg = "<img id=\"pic\" border=\"0\" src=\"([^<]*)\" width=\"60px\""; //string imgurl = WebDate.GetItemValue(rs, reg, 1); //imgurl = imgurl.Replace("s", "l"); ////创建路径 //string path = Server.MapPath("../upload/product/images/"); //if (!System.IO.Directory.Exists(path)) System.IO.Directory.CreateDirectory(path); //WebDate.GetImgDate(fname, imgurl, path); //WebDate.MakeThumbnail(path + "/" + fname, path + "/s_" + fname, WGBLL.WebSite.GetSiteInfo().ImgW, WebSite.GetSiteInfo().ImgH, WebSite.GetSiteInfo().ImgT); //info.PImgUrl = "s_" + fname; string sql = string.Empty; // sql = "update SYS_Article set Addtime= format('{0}','yyyy-mm-dd hh:MM:ss'),Update=format('{1}','yyyy-mm-dd hh:MM:ss') where ArticleID={2}"; //sql = "update SYS_Article set Addtime= #{0}# where ArticleID={1}"; if (bll.GetScalar("select title from SYS_Article where title='" + info.Get<string>("title") + "'") == null) { if (!string.IsNullOrEmpty(info.Get<string>("content"))) bll.Insert(info); //int id = bll.GetIdentity<int>(); // bll.Execute(string.Format(sql, sdt, id)); // sql = "update SYS_Article set Updatetime= #{0}# where ArticleID={1}"; // bll.Execute(string.Format(sql, edt, id)); } return true; } catch (Exception ex) { return false; } }
public void getfreetime(ObservableCollection <ClassListLight> weekresult, ObservableCollection <EmptyTable> termresult) { //所有人的名字 string[] names = (from n in Searchlist.Keys select n).ToArray(); //星期,时间段,人名数组 List <ClassListLight> clist = new List <ClassListLight>(); if (Weeknum != -100) { foreach (var key in Searchlist.Keys) { //找到该周的所有课程 clist.AddRange((from n in Searchlist[key] where n.Week.Contains(Weeknum) select n).ToList()); } //添加都没课的时间 //day和lesson都没有在clist里出现过就添加一个classlistlight对象 for (int i = 0; i < 7; i++) //一周 { for (int j = 0; j < 6; j++) //一天 { //查时间有没有在集合里出现过 ClassListLight ourfreetime = new ClassListLight() { Hash_day = i, Hash_lesson = j }; if (!clist.Contains(ourfreetime, new ClassListLigthCompare())) { ourfreetime.Name = names; clist.Add(ourfreetime); } } } //clist = clist.OrderBy(x => x.Hash_day).ToList(); //筛选出该周内所有不在同一时间上课的课 var diisclist = from n in clist group n by new { n.Hash_day, n.Hash_lesson } into g where g.Count() < names.Length select g; var ll = diisclist.ToList(); for (int i = 0; i < ll.Count; i++) { var len = ll[i].ToList(); ClassListLight tobeadded = len[0].Clone(); if (len.Count == 1) { tobeadded.Name = len[0].Name; Debug.WriteLine("长度是" + len.Count); } if (len.Count > 1) { string[] haveclassname = new string[len.Count]; //获得一个ClassListLight的深复制 tobeadded.Name = haveclassname; for (int k = 0; k < len.Count; k++) { tobeadded.Name[k] = len[k].Name[0]; } } if (tobeadded.Name.Length != names.Length) { tobeadded.Name = names.Except(tobeadded.Name).ToArray(); } weekresult.Add(tobeadded); } //大家都没课的时间 } else { //todo学期空课表 //我要怎么做呢,怎么做呢,既然要查学期,那么就按课的时间差吧,从星期一第一节到星期天 //查每个人,每个时间段有课情况 //查到所有这个时间段的周:EX :星期一第一二节课, 得到一个周的列表 1,2,3,4,5,6 得到每个人的周列表,2,4,6,8 1,3,5,7 ,找出都没课的周 //怎么找呢 //找出每个人没课的周 7,8,9,10 1,3,4,7,9,10 2,4,5,8,10 //那么就得到了 张三 历史 王五 //那么这个类就应该是 周,时间,姓名[],那几周空[]----周,时间, 键值对(名字,有空的周[]) //前面挖了个坑,这里又要一个类,EmptyTable,不兼容啊卧槽。 int[] allweeks = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }; for (int i = 0; i < 7; i++) //星期 { for (int j = 0; j < 6; j++) //时段 { EmptyTable temp = new EmptyTable { Hash_day = i, Hash_lesson = j }; temp.nameweek = new Dictionary <string, int[]>(); foreach (var key in Searchlist.Keys) { IEnumerable <int[]> a = from n in Searchlist[key] where n.Hash_day == i && n.Hash_lesson == j select n.Week; //var b=from x in Searchlist group x.Value by x.Key into g List <int[]> listweek = a.ToList(); List <int> onweeks = new List <int>(); for (int m = 0; m < listweek.Count; m++) { onweeks.AddRange(listweek[m]); } int[] free = allweeks.Except(onweeks.ToArray()).ToArray(); free = free.Distinct().ToArray(); if (listweek.Count == 0)//这个时候我没课 { temp.nameweek.Add(key, allweeks); } else if (free.Length == 18) { //这个时候我一学期都有课 continue; } else//这个时候我有课,找出我没课的周 { temp.nameweek.Add(key, free); } } termresult.Add(temp); } } } }
/// <summary> /// 给一个课程格子设置颜色,并添加到视图中 /// </summary> /// <param name="setcoloritem"></param> /// <param name="ClassColor"></param> private void SetClassAll(EmptyClassDayLesson setcoloritem, int ClassColor) { Color[] colors = new Color[] { Color.FromArgb(255, 88, 179, 255), //蓝 Color.FromArgb(255, 255, 181, 68), //黄 Color.FromArgb(255, 172, 222, 76), //绿 Color.FromArgb(255, 249, 130, 130), //红 }; int day = setcoloritem.Hash_day; int lesson = setcoloritem.Hash_lesson; TextBlock ClassTextBlock = new TextBlock(); if (setcoloritem is ClassListLight) { ClassListLight item = setcoloritem as ClassListLight; ResultName[day, lesson] = item.Name; foreach (var nameitem in ResultName[day, lesson]) { ClassTextBlock.Text = ClassTextBlock.Text + "\n" + nameitem; } } if (setcoloritem is EmptyTable) { EmptyTable item = setcoloritem as EmptyTable; ResultName[day, lesson] = item.nameweek.Keys.ToArray(); foreach (var nameitem in ResultName[day, lesson]) { if (item.nameweek[nameitem].Length != 0) { ClassTextBlock.Text = ClassTextBlock.Text + "\n" + nameitem + "\r"; ClassTextBlock.Text = ClassTextBlock.Text + WeeknumConverter(item.nameweek[nameitem]); } } } ClassTextBlock.Foreground = new SolidColorBrush(Colors.White); ClassTextBlock.FontSize = 13; ClassTextBlock.TextWrapping = TextWrapping.WrapWholeWords; ClassTextBlock.VerticalAlignment = VerticalAlignment.Center; ClassTextBlock.HorizontalAlignment = HorizontalAlignment.Center; if (Utils.getPhoneWidth() < 333) { ClassTextBlock.Margin = new Thickness(1); } else { ClassTextBlock.Margin = new Thickness(3); } ClassTextBlock.MaxLines = 6; Grid BackGrid = new Grid(); BackGrid.Background = new SolidColorBrush(colors[ClassColor]); BackGrid.SetValue(Grid.RowProperty, System.Int32.Parse(lesson * 2 + "")); BackGrid.SetValue(Grid.ColumnProperty, System.Int32.Parse(day + "")); BackGrid.SetValue(Grid.RowSpanProperty, 2); BackGrid.Margin = new Thickness(0.5); if ((setcoloritem is ClassListLight) && ResultName[day, lesson].Length == muIdList.Count) { TextBlock AllPeopleTextBlock = new TextBlock(); AllPeopleTextBlock.Foreground = new SolidColorBrush(Colors.White); AllPeopleTextBlock.FontSize = 11; AllPeopleTextBlock.Text = "全"; AllPeopleTextBlock.VerticalAlignment = VerticalAlignment.Bottom; AllPeopleTextBlock.HorizontalAlignment = HorizontalAlignment.Right; AllPeopleTextBlock.Margin = new Thickness(1); BackGrid.Children.Add(AllPeopleTextBlock); } BackGrid.Children.Add(ClassTextBlock); BackGrid.Tapped += BackGrid_Tapped; kebiaoGrid.Children.Add(BackGrid); }
protected void Page_Load(object sender, EventArgs e) { bll = new SiteBLL(); EmptyTable ety = new EmptyTable(); string action = Web9long.Web.Util.Form("actype"); string sql = string.Empty; switch (action) { #region 注册个人会员 case"1": //验证用户是否存在 string username = Web9long.Web.Util.Form("txtUserName"); username = Web9long.DB.SQLUtility.Replace(username).Trim(); sql = "select * from US_UserInfo where UI_UserName='******'"; DataTable dt=bll.GetDataTable(sql); if (dt!=null&&dt.Rows.Count>0) Web9long.Web.Clew.AlertBack("注册名已经存在"); ety.TableCondition().TableName = "US_UserInfo"; ety.Set("UI_UserName", username); ety.Set("UI_Mobile", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtMobile"))); ety.Set("UI_UserPwd", Web9long.Encrypt.MD5(Web9long.Web.Util.Form("txtPassword").Trim())); bll.Insert(ety); Response.Redirect("../user/userregok.aspx?username="******"2": username = Web9long.Web.Util.Form("txtUserName"); username = Web9long.DB.SQLUtility.Replace(username).Trim(); string pwd = Web9long.Web.Util.Form("txtPassword").Trim(); bool rember = Web9long.Web.Util.Form("chkRemember")!=""; string result=string.Empty; bool rs = UserDal.UserTryLogin(username, pwd, rember, out result); if (rs) Response.Redirect("../user/index.aspx"); else Web9long.Web.Clew.AlertBack(result); break; #endregion #region 修改密码 case "3": username = Web9long.Web.Util.Form("username"); username = Web9long.DB.SQLUtility.Replace(username).Trim(); pwd = Web9long.Web.Util.Form("txtOldPassword").Trim(); rs = UserDal.UserTryLoin(username, pwd); if (!rs) Web9long.Web.Clew.AlertBack("原密码错误!"); pwd = Web9long.Web.Util.Form("txtPassword").Trim(); rs = UserDal.UpdatePwd(username, pwd); if (rs) Web9long.Web.Clew.Alert("修改密码成功", "../user/changepwd.aspx"); else Web9long.Web.Clew.Alert("修改密码失败", "../user/changepwd.aspx"); break; #endregion #region 注册专家 case "5": username = Web9long.Web.Util.Form("txtUserName"); username = Web9long.DB.SQLUtility.Replace(username).Trim(); sql = "select * from DoctorUserInfo where OF_DocUserName='******'"; dt=bll.GetDataTable(sql); if (dt!=null&&dt.Rows.Count>0) Web9long.Web.Clew.AlertBack("注册名已经存在"); ety.TableCondition().TableName = "DoctorUserInfo"; ety.Set("OF_DocUserName", username); ety.Set("OF_DocMobile", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtMobile"))); ety.Set("OF_DocTrueName", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtTureName"))); ety.Set("OF_DocEmail", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtEmail"))); string tel = Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtquhao")) +"-"+ Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtTelphone")) +"-"+ Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtFenji")); ety.Set("OF_DocTel", tel); ety.Set("OF_DocUserPwd", Web9long.Encrypt.MD5(Web9long.Web.Util.Form("txtPassword").Trim())); bll.Insert(ety); Response.Redirect("../user/RegDoctor2.aspx?username="******"6": ety.TableCondition().TableName = "DoctorUserInfo"; ety.TableCondition().Where = string.Format("OF_DocUserName='******'", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("docUsername"))); ety.Set("OF_DocProvice", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("province"))); ety.Set("OF_DocCity", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("city"))); ety.Set("OF_DocHosptol", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txthospital"))); ety.Set("OF_DocOffice", Web9long.DB.SQLUtility.Replace(Web9long.Web.Util.Form("txtoffice"))); bll.Update(ety); Response.Redirect("../user/RegDoctorOK.aspx?username="******"docUsername")); break; #endregion } }
private bool DoAdd() { try { EmptyTable ety = new EmptyTable(); ety.TableCondition().TableName = "SYS_Category"; ety.Set("ChannelID", this.channel_id); ety.Set("Catetitle", txtTitle.Text.Trim()); ety.Set("CateCallIndex", txtCallIndex.Text.Trim()); ety.Set("CateParentID", ddlParentId.SelectedValue); if (ddlParentId.SelectedValue != "0") ety.Set("CateClassLayer", 2); else ety.Set("CateClassLayer", 1); ety.Set("CateSortID", txtSortId.Text.Trim()); ety.Set("Cateseotitle", txtSeoTitle.Text); ety.Set("Cateseokeywords", txtSeoKeywords.Text); ety.Set("Cateseodescription", txtSeoDescription.Text); ety.Set("CateLinkUrl", txtLinkUrl.Text.Trim()); ety.Set("CateImgUrl", txtImgUrl.Text.Trim()); ety.Set("Catecontent", txtContent.Value); if (bll.Insert(ety) < 1) { return false; } } catch { return false; } return true; }
private bool DoEdit(int _id) { try { EmptyTable ety = new EmptyTable(); ety.TableCondition().TableName = "SYS_Category"; ety.TableCondition().Where = "CateID="+this.id; int parentId = int.Parse(ddlParentId.SelectedValue); //如果选择的父ID不是自己,则更改 if (parentId != this.id) { ety.Set("CateParentID", parentId); } ety.Set("ChannelID", this.channel_id); ety.Set("Catetitle", txtTitle.Text.Trim()); ety.Set("CateCallIndex", txtCallIndex.Text.Trim()); ety.Set("CateParentID", ddlParentId.SelectedValue); ety.Set("CateSortID", txtSortId.Text.Trim()); ety.Set("Cateseotitle", txtSeoTitle.Text); ety.Set("Cateseokeywords", txtSeoKeywords.Text); ety.Set("Cateseodescription", txtSeoDescription.Text); ety.Set("CateLinkUrl", txtLinkUrl.Text.Trim()); ety.Set("CateImgUrl", txtImgUrl.Text.Trim()); ety.Set("Catecontent", txtContent.Value); if (!(bll.Update(ety)>0)) { return false; } } catch { return false; } return true; }
protected void Page_Load(object sender, EventArgs e) { using (SiteBLL bll = new SiteBLL()) { int newid; if (!int.TryParse(Web9long.Web.Util.Query("id"), out newid)) Web9long.Web.Clew.AlertBack("参数错误"); etyInfo = bll.GetOnlyRow<EmptyTable>("select * from SYS_Article where ArticleID=" + newid); etyInfo.Set("content",GetInnerlink(etyInfo.Get<string>("content"))); if (etyInfo == null) Web9long.Web.Clew.AlertBack("查找的信息不存在"); etyChannel = bll.GetOnlyRow<EmptyTable>("select * from SYS_channel where CL_ID=" + etyInfo.Get<string>("ChannelID")); etyClass = bll.GetOnlyRow<EmptyTable>("select * from SYS_Category where CateID=" + etyInfo.Get<string>("CategoryID")); string sql = @" select top 11 CategoryID,title, ArticleID,CateCallIndex,CL_Name,Addtime,Zhaiyao,Catetitle from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and Islock<>1 and Isred=1 order by Addtime desc,Sortid desc,ArticleID desc "; List<EmptyTable> ls = bll.GetList<EmptyTable>(sql); if (ls != null && ls.Count > 0) { topety = ls[0]; ls.Remove(topety); } this.rpt_list_tuijian.DataSource = ls; //频道精华 sql = @" select top 11 CategoryID,title, ArticleID,CateCallIndex,CL_Name,Addtime,Zhaiyao from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and Islock<>1 and Isred=1 {0} order by Sortid desc,Addtime desc,ArticleID desc "; sql = string.Format(sql, " and sys_article.ChannelID=" + etyInfo.Get<string>("ChannelID")); this.rpt_topNew.DataSource = bll.GetList<EmptyTable>(sql); //相关文章 sql = @" select top 6 CategoryID,title, ArticleID,CateCallIndex,CL_Name,Addtime,Zhaiyao,Imgurl,Seokeywords from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and Islock<>1 and Imgurl<>'' {0} order by Sortid desc,Addtime desc,ArticleID desc "; StringBuilder sb = new StringBuilder(); string keywwords=etyInfo.Get<string>("Seokeywords"); if(string.IsNullOrEmpty(keywwords)) { string[] a = keywwords.Split(','); if (a.Length > 0) { sb.Append(" and ("); int i = 0; foreach (string s in a) { if(i==0) sb.Append(" Seokeywords like '%" + s + ",'"); else sb.Append(" or Seokeywords like '%" + s + ",'"); } sb.Append(")"); } } sql = string.Format(sql,sb.ToString()); ls = bll.GetList<EmptyTable>(sql); rpt_list_6More.DataSource = ls; this.Page.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { using (SiteBLL bll = new SiteBLL()) { if (!int.TryParse(Web9long.Web.Util.Query("channelid"), out channelid)) Web9long.Web.Clew.AlertBack("参数错误"); if (!int.TryParse(Web9long.Web.Util.Query("classid"), out categoryid)) categoryid = 0; //绑定频道下的类别 List<EmptyTable> ls = bll.GetList<EmptyTable>("select CateID,CateCallIndex,Catetitle,Cateseotitle,Cateseokeywords,Cateseodescription from SYS_Category where ChannelID=" + this.channelid + " order by CateSortID desc,CateID desc"); if (ls != null && ls.Count > 0) { foreach (EmptyTable et in ls) { if (et.Get<int>("CateID") == categoryid) etyClass = et; break; } } etyChannel = bll.GetOnlyRow<EmptyTable>("select * from SYS_channel where CL_ID=" + channelid); seotitle = etyChannel.Get<string>("CL_SeoTitle"); seokeywords = etyChannel.Get<string>("CL_Keywords"); seodes = etyChannel.Get<string>("CL_Description"); if (categoryid > 0) { etyClass = bll.GetOnlyRow<EmptyTable>("select * from SYS_Category where CateID=" + categoryid); seotitle = etyClass.Get<string>("Cateseotitle"); seokeywords = etyClass.Get<string>("Cateseokeywords"); seodes = etyClass.Get<string>("Cateseodescription"); } Com_Config webconfig = Loneu.BLL.Config.WebSiteConfig.Info(); this.rpt_class.DataSource = ls; this.rpt_class.DataBind(); //内容列表 HtmlPageUrl1.Pagesize = 15; HtmlPageUrl1.Nowpage = int.Parse(Web9long.Web.Util.Query("AsPage")); HtmlPageUrl1.Allcount = int.Parse(Web9long.Web.Util.Query("AsCount")); if (categoryid > 0) { HtmlPageUrl1.Pagename = "List_" + categoryid.ToString(); } else { HtmlPageUrl1.Pagename = "List_" + channelid.ToString(); } Web9long.DB.SqlCreate strsql = new Web9long.DB.MSSQL().GetSqlCreate(); strsql.Table = "(select ArticleID,SYS_Article.ChannelID,CategoryID,title,Sortid,Addtime,Ismsg,Istop,Isred,Ishot,Isslide,Catetitle,CateCallIndex,Zhaiyao from SYS_Article,SYS_Category where CategoryID=CateID ) t"; strsql.Fild = "ArticleID,ChannelID,CategoryID,title,Sortid,Addtime,Ismsg,Istop,Isred,Ishot,Isslide,Catetitle,CateCallIndex,Zhaiyao"; strsql.Order = "order by Istop desc,Sortid desc,ArticleID desc"; strsql.AddAndWhere(" ChannelID=" + this.channelid); if (this.categoryid > 0) strsql.AddAndWhere("CategoryID=" + this.categoryid); if (AsGet2.Count == 0) AsGet2.Count = bll.GetCount(AsGet2.MakeCountSql(strsql.Table, strsql.Where)); AsGet2.Compute(); this.rpt_ContentList.DataSource = bll.GetList<EmptyTable>(AsGet2.MakeSql(strsql.Fild, strsql.Table, strsql.Where, "ArticleID", strsql.Order)); this.rpt_ContentList.DataBind(); string sql = @" select top 10 CategoryID,Catetitle, title, ArticleID,CateCallIndex,CL_Name,Addtime,Zhaiyao from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and Islock<>1 {0} order by ClickHits desc,Sortid desc,ArticleID desc "; if (this.categoryid > 0) { sql = string.Format(sql, " and sys_article.ChannelID=" + this.channelid + " and SYS_Article.CategoryID=" + this.categoryid); } else { sql = string.Format(sql, " and sys_article.ChannelID=" + this.channelid); } this.rpt_list_hot.DataSource = bll.GetList<EmptyTable>(sql); sql = @" select top 11 CategoryID,title, ArticleID,CateCallIndex,CL_Name,Addtime,Zhaiyao,Catetitle from SYS_Article,SYS_Category,SYS_channel where SYS_Article.CategoryID=SYS_Category.CateID and sys_article.ChannelID=SYS_channel.CL_ID and Islock<>1 and Isred=1 order by Addtime desc,Sortid desc,ArticleID desc "; ls = bll.GetList<EmptyTable>(sql); if (ls != null && ls.Count > 0) { topety = ls[0]; ls.Remove(topety); } this.rpt_list_tuijian.DataSource = ls; this.Page.DataBind(); } }
protected void btnSubmit_Click(object sender, EventArgs e) { bool rs = false; string url = "List.aspx?channelid=" + this.channelid; ety = new EmptyTable(); ety.TableCondition().TableName = "SYS_Content"; ety.Set("title", txtTitle.Text.Trim()); ety.Set("SmilTitle", txtSTitle.Text.Trim()); ety.Set("Author", txtAuthor.Text.Trim()); ety.Set("Source", txtFrom.Text.Trim()); ety.Set("Zhaiyao", txtZhaiyao.Text.Trim()); ety.Set("Sortid", txtSortId.Text.Trim()); ety.Set("ClickHits", txtClick.Text.Trim()); ety.Set("Imgurl", txtImgUrl.Text.Trim()); ety.Set("DiggGood", txtDiggGood.Text.Trim()); ety.Set("DiggBad", txtDiggBad.Text.Trim()); ety.Set("content", txtContent.Value.Trim()); ety.Set("LinkUrl", txtLinkUrl.Text.Trim()); ety.Set("Seotitle", txtSeoTitle.Text.Trim()); ety.Set("Seokeywords", txtSeoKeywords.Text.Trim()); ety.Set("SeoSdescription", txtSeoDescription.Text.Trim()); ety.Set("ChannelID", channelid); if (cblItem.Items[0].Selected == true) { ety.Set("Ismsg", 1); } if (cblItem.Items[1].Selected == true) { ety.Set("Istop", 1); } if (cblItem.Items[2].Selected == true) { ety.Set("Isred", 1); } if (cblItem.Items[3].Selected == true) { ety.Set("Ishot", 1); } if (cblItem.Items[4].Selected == true) { ety.Set("Isslide", 1); } if (cblItem.Items[5].Selected == true) { ety.Set("Islock", 1); } if (txtobjID.Value != string.Empty) { base.ChkAdminLevel(this.channelid,"edit"); ety.TableCondition().Where = "ArticleID=" + txtobjID.Value; rs = bll.Update(ety) > 0; } else { base.ChkAdminLevel(this.channelid,"add"); rs = bll.Insert(ety) > 0; } Web9long.Web.Clew.Alert("操作" + (rs ? "成功" : "失败") + "!", url); }