码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2015-12-26 23:27:48      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:

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

 

审核:

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");
    }
}

 

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

标签:

原文地址:http://www.cnblogs.com/mn-b/p/5079196.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!