Example #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string userid = context.Request.QueryString["userId"];

            rr2.BLL.userInfo blluser = new rr2.BLL.userInfo();
            blluser.Delete(int.Parse(userid));
            context.Response.Redirect("userList.aspx?ts=delsucess");
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string userName = Request.Form["txtName"];
            string userPass = Request.Form["txtPassword"];

            rr2.BLL.userInfo blluser = new rr2.BLL.userInfo();
            if (blluser.Exists(userName, userPass))
            {
                Response.Redirect("Aindex.aspx");
            }
            else
            {
                Response.Write("<script>alert('请检查用户名和密码是否正确');window.location.href='getDemo.aspx'</script>");
            }
        }
Example #3
0
 private void ShowInfo(int userId)
 {
     rr2.BLL.userInfo   bll   = new rr2.BLL.userInfo();
     rr2.Model.userInfo model = bll.GetModel(userId);
     this.lbluserId.Text        = model.userId.ToString();
     this.txtuserLoginName.Text = model.userLoginName;
     this.txtuserTrueName.Text  = model.userTrueName;
     this.txtuserPass.Text      = model.userPass;
     this.txtuserEmail.Text     = model.userEmail;
     this.txtuserTel.Text       = model.userTel;
     this.txtflag.Text          = model.flag.ToString();
     this.txtext1.Text          = model.ext1;
     this.txtext2.Text          = model.ext2;
     this.txtext3.Text          = model.ext3;
 }
Example #4
0
        public void ProcessRequest(HttpContext context) /*在ProcessRequest下面写功能代码,区别于一般的处理程序*/
        {
            context.Response.ContentType = "text/plain";
            string userName = context.Request.Form["txtName"];
            string userPass = context.Request.Form["txtPassword"];

            rr2.BLL.userInfo blluser = new rr2.BLL.userInfo();
            if (blluser.Exists(userName, userPass))
            {
                context.Response.Redirect("Aindex.aspx");
            }
            else
            {
                context.Response.Write("<script>alert('请检查用户名或者密码!');window.location.href='getDemo.aspx';</script>");
            }
        }
Example #5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            rr2.Model.userInfo curuser = new rr2.Model.userInfo();
            curuser.userLoginName = TBusername.Text;
            curuser.userTrueName  = TBuserTrue.Text;
            curuser.userPass      = TBuserpwd.Text;
            curuser.userEmail     = TBuserEmail.Text;
            curuser.userTel       = TBuserTel.Text;
            curuser.flag          = int.Parse(DropDownList1.SelectedValue);
            int jg = new rr2.BLL.userInfo().Add(curuser);

            if (jg == 0)
            {
                LblTishi.Text = "注册失败,请检查数据完整性";
            }
            else
            {
                LblTishi.Text = "注册成功!!";
            }
        }
Example #6
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtuserLoginName.Text.Trim().Length == 0)
            {
                strErr += "userLoginName不能为空!\\n";
            }
            if (this.txtuserTrueName.Text.Trim().Length == 0)
            {
                strErr += "userTrueName不能为空!\\n";
            }
            if (this.txtuserPass.Text.Trim().Length == 0)
            {
                strErr += "userPass不能为空!\\n";
            }
            if (this.txtuserEmail.Text.Trim().Length == 0)
            {
                strErr += "userEmail不能为空!\\n";
            }
            if (this.txtuserTel.Text.Trim().Length == 0)
            {
                strErr += "userTel不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtflag.Text))
            {
                strErr += "flag格式错误!\\n";
            }
            if (this.txtext1.Text.Trim().Length == 0)
            {
                strErr += "ext1不能为空!\\n";
            }
            if (this.txtext2.Text.Trim().Length == 0)
            {
                strErr += "ext2不能为空!\\n";
            }
            if (this.txtext3.Text.Trim().Length == 0)
            {
                strErr += "ext3不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    userId        = int.Parse(this.lbluserId.Text);
            string userLoginName = this.txtuserLoginName.Text;
            string userTrueName  = this.txtuserTrueName.Text;
            string userPass      = this.txtuserPass.Text;
            string userEmail     = this.txtuserEmail.Text;
            string userTel       = this.txtuserTel.Text;
            int    flag          = int.Parse(this.txtflag.Text);
            string ext1          = this.txtext1.Text;
            string ext2          = this.txtext2.Text;
            string ext3          = this.txtext3.Text;


            rr2.Model.userInfo model = new rr2.Model.userInfo();
            model.userId        = userId;
            model.userLoginName = userLoginName;
            model.userTrueName  = userTrueName;
            model.userPass      = userPass;
            model.userEmail     = userEmail;
            model.userTel       = userTel;
            model.flag          = flag;
            model.ext1          = ext1;
            model.ext2          = ext2;
            model.ext3          = ext3;

            rr2.BLL.userInfo bll = new rr2.BLL.userInfo();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }