Ejemplo n.º 1
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            IUserDAO dao = new Dao.UserDAO();

            Model.User user = dao.GetUser((string)e.CommandArgument);
            switch (e.CommandName)
            {
            case "Select":
                Session["username"] = user.Username;
                Response.Redirect("Home.aspx");
                break;

            case "Edit":
                Label2.Text    = user.Username;
                TextBox1.Text  = user.MaxQuota + "";
                Label2.Visible = true;
                break;

            case "Delete":
                dao.DeleteUser(user.Username);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            string username = context.Request.Form["username"];
            string password = context.Request.Form["password"];

            Interface.IUserDAO dAO = new Dao.UserDAO();
            System.Diagnostics.Debug.WriteLine(username + "" + password);
            context.Response.Write(dAO.CheckUser(username, password).ToString());
        }