您目前尚未登陆,请选择【登陆】或【注册
首页->博客论坛->WO@BIZ第一季1.2版源码>>admin/Tags.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:WO@BIZ第一季1.2版源码
当前文件:文件类型 WOBIZ/admin/Tags.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11using WoNextDll.commen; 12using WoNextDll.component; 13using WoNextDll.Handler; 14using WoNextDll.Data; 15 16public partial class admin_Tags : System.Web.UI.Page 17{ 18 protected string tagtype; 19 protected string s; 20 protected string str; 21 22 protected void Page_Load(object sender, EventArgs e) 23 { 24 if (Session["_AdminID"] == null) 25 { 26 Response.Write("<script>top.location.href='admin_login.aspx';</script>"); 27 } 28 else 29 { 30 if (Request.QueryString["s"] != null) 31 { 32 s = Request.QueryString["s"].ToString(); 33 if (s == "1") //群组标签 34 { 35 tagtype = "群组标签"; 36 Dlist.Visible = true; 37 Dlist2.Visible = false; 38 Dlist3.Visible = false; 39 if (!IsPostBack) 40 { 41 str = "select * from WO_GroupTags"; 42 bind(str, "Dlist"); 43 } 44 } 45 if (s == "2") //宝贝标签 46 { 47 tagtype = "宝贝标签"; 48 Dlist2.Visible = true; 49 Dlist.Visible = false; 50 Dlist3.Visible = false; 51 if (!IsPostBack) 52 { 53 str = "select * from WO_ProTags"; 54 bind(str, "Dlist2"); 55 } 56 } 57 if (s == "3") //文章标签 58 { 59 tagtype = "文章标签"; 60 Dlist3.Visible = true; 61 Dlist2.Visible = false; 62 Dlist.Visible = false; 63 if (!IsPostBack) 64 { 65 str = "select * from WO_TopicTags"; 66 bind(str, "Dlist3"); 67 } 68 } 69 } 70 else 71 { 72 Response.Write("参数错误!"); 73 Response.End(); 74 } 75 } 76 } 77 78 protected void bind(string sql, string jcontrol) 79 { 80 Jpage1.JDataType = "2"; 81 Jpage1.Jconnstr = MyDB.GetMsSqlConnStr(); 82 Jpage1.Jselect = sql; // 查询语句 83 Jpage1.Jsortfield = "id desc";//排序方式 84 Jpage1.JControl = jcontrol; 85 Jpage1.DataBind();//绑定数据 86 } 87 88 protected void Dlist_RowDataBound(object sender, GridViewRowEventArgs e) 89 { 90 if (e.Row.RowType == DataControlRowType.DataRow) 91 { 92 string gid = e.Row.Cells[1].Text; 93 Han_Group han = new Han_Group(); 94 string gname = han.GetGroupName(int.Parse(gid)); 95 e.Row.Cells[1].Text = "<a href='../Group-" + gid + ".htm' target='_blank'>" + gname + "</a>"; 96 } 97 } 98 protected void Dlist2_RowDataBound(object sender, GridViewRowEventArgs e) 99 { 100 if (e.Row.RowType == DataControlRowType.DataRow) 101 { 102 string gid = e.Row.Cells[1].Text; 103 Han_ProInfo han = new Han_ProInfo(); 104 string gname = han.GetProName(int.Parse(gid)); 105 e.Row.Cells[1].Text = "<a href='../Goods-" + gid + ".htm' target='_blank'>" + gname + "</a>"; 106 } 107 } 108 protected void Dlist3_RowDataBound(object sender, GridViewRowEventArgs e) 109 { 110 if (e.Row.RowType == DataControlRowType.DataRow) 111 { 112 string tid = e.Row.Cells[1].Text; 113 Han_Topic han = new Han_Topic(); 114 string ttitle = han.GetTitle(int.Parse(tid)); 115 e.Row.Cells[1].Text = "<a href='../ShowPost-" + tid + ".htm' target='_blank'>" + ttitle + "</a>"; 116 } 117 } 118 protected void Button2_Click(object sender, EventArgs e) 119 { 120 bool b = false; 121 int a = 0; 122 if (s == "1") 123 { 124 Han_GroupTags han = new Han_GroupTags(); 125 for (int i = 0; i < Dlist.Rows.Count; i++) 126 { 127 CheckBox cbSelect = (CheckBox)Dlist.Rows[i].FindControl("chk_groupID"); 128 if (cbSelect.Checked) //说明选中 129 { 130 b = han.DelTag(int.Parse(Dlist.Rows[i].Cells[0].Text)); 131 if (!b) 132 a = a + 1; 133 } 134 } 135 } 136 else if (s == "2") 137 { 138 Han_ProTags han = new Han_ProTags(); 139 for (int i = 0; i < Dlist2.Rows.Count; i++) 140 { 141 CheckBox cbSelect = (CheckBox)Dlist2.Rows[i].FindControl("chk_proID"); 142 if (cbSelect.Checked) //说明选中 143 { 144 b = han.DelTag(int.Parse(Dlist2.Rows[i].Cells[0].Text)); 145 if (!b) 146 a = a + 1; 147 } 148 } 149 } 150 else if (s == "3") 151 { 152 Han_TopicTags han = new Han_TopicTags(); 153 for (int i = 0; i < Dlist3.Rows.Count; i++) 154 { 155 CheckBox cbSelect = (CheckBox)Dlist3.Rows[i].FindControl("chk_topicID"); 156 if (cbSelect.Checked) //说明选中 157 { 158 b = han.DelTag(int.Parse(Dlist3.Rows[i].Cells[0].Text)); 159 if (!b) 160 a = a + 1; 161 } 162 } 163 } 164 if (a == 0) 165 { 166 Response.Write(Function.msgbox("您选中的标签全部删除成功!", "Tags.aspx?s=" + s, 1, 0)); 167 Response.End(); 168 } 169 else 170 { 171 Response.Write(Function.msgbox("删除有出现错误,请重新删除!", "Tags.aspx?s=" + s, 1, 0)); 172 Response.End(); 173 } 174 } 175} 176
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:WO@BIZ第一季1.2版源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号