Ejemplo n.º 1
0
 private void pageLode()
 {
     if (Request.QueryString["action"] != null)
     {
         if ((userType == 0 || userType == 1))
         {
             if (Request.QueryString["action"].Equals("delete") && Request.QueryString["id"] != null)
             {
                 B_Links b = new B_Links();
                 if (b.deleteByLinksID(Convert.ToInt32(Request.QueryString["id"])))
                 {
                     Response.Redirect("Links.aspx");
                 }
                 else
                 {
                     Response.Write("<script>alert('删除失败')</script>");
                 }
             }
         }
         else
         {
             Response.Write("<script>alert('权限不足不能删除!')</script>");
         }
     }
     bindUserData();
 }
Ejemplo n.º 2
0
 private void AddLinks(R_Links r)
 {
     B_Links b = new B_Links();
     _Links_Name.Text = "";
     if (b.addLinks(r))
     {
         Response.Redirect("Links.aspx");
     }
     else
     {
         ll_ts.Text = "添加失败!";
     }
 }
Ejemplo n.º 3
0
 private void bindUserData()
 {
     AspNetPager1.PageSize = Convert.ToInt32(page_rows.SelectedValue);
     B_Links b = new B_Links();
     DataSet ds = b.getLinks();
     PagedDataSource ps = new PagedDataSource();
     ps.DataSource = ds.Tables[0].DefaultView;
     AspNetPager1.RecordCount = ps.Count;
     ps.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
     ps.AllowPaging = true;
     ps.PageSize = AspNetPager1.PageSize;
     R_User.DataSource = ps;
     R_User.DataBind();
 }
Ejemplo n.º 4
0
 private void editLinks(R_Links r)
 {
     B_Links b = new B_Links();
     r.ID = id;
     _Links_Name.Text = "";
     if (b.editLinks(r))
     {
         Response.Redirect("Links.aspx");
     }
     else
     {
         ll_ts.Text = "修改失败";
     }
 }
Ejemplo n.º 5
0
 private void getDataByID(int id)
 {
     B_Links b = new B_Links();
     DataTable dt = b.selLinksByID(id);
     Links_Name.Text = dt.Rows[0]["Links_Name"].ToString() ;
     Links_Url.Text = dt.Rows[0]["Links_Url"].ToString();
 }