20151223:Web:审核:审核和取消

审核和取消不需要设计页面,只需写后台代码

 

审核:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ShenHe : System.Web.UI.Page
{
    private UsersDataContext context = new UsersDataContext();
    protected void Page_Load(object sender, EventArgs e)
    {
        string uid = Request["uid"].ToString();
        users data = context.users.Where(p => p.UserName == uid).First();
        data.State = 1;
        context.SubmitChanges();
        Response.Redirect("Main.aspx");
    }
}

 

取消:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class QuXiao : System.Web.UI.Page
{
    private UsersDataContext context = new UsersDataContext();
    protected void Page_Load(object sender, EventArgs e)
    {
        string uid = Request["uid"].ToString();
        users data = context.users.Where(p => p.UserName == uid).First();
        data.State = 2;
        context.SubmitChanges();
        Response.Redirect("Main.aspx");
    }
}

 

posted @ 2015-12-26 22:25  m-n  阅读(281)  评论(0编辑  收藏  举报