コード例 #1
0
 protected void btn_Find_Click(object sender, EventArgs e)
 {
     if (tb_Name.Text.Trim() == "" || tb_Number.Text.Trim() == "")
     {
         webclass.Show(this, "请填写完整信息");
     }
     else
     {
         BLL.B_AdminInfo b_admin = new BLL.B_AdminInfo();
         Model.AdminInfo model   = new Model.AdminInfo();
         try
         {
             model = b_admin.GetAdminInfo(tb_Name.Text, Convert.ToInt32(tb_Number.Text).ToString());
         }
         catch (Exception err)
         {
             webclass.Show(this, err.Message);
         }
         if (model != null)
         {
             webclass.Show(this, "您的密码是:" + model.PWD);
         }
         else
         {
             webclass.Show(this, "未找到该管理员信息");
         }
     }
 }
コード例 #2
0
        protected void btn_Change_Click(object sender, EventArgs e)
        {
            BLL.B_AdminInfo b_admin = new BLL.B_AdminInfo();

            Model.AdminInfo ainfo = b_admin.GetAdminInfo((int)Session["UID"]);
            if (ainfo != null)
            {
                if (ainfo.PWD == tb_old.Text)
                {
                    if (tb_p1.Text.Trim() == tb_p1.Text.Trim())
                    {
                        bool result = b_admin.ChangePWD(tb_p1.Text.Trim(), (int)Session["UID"]);
                        if (result == true)
                        {
                            webclass.Show(this, "修改成功");
                        }
                        else
                        {
                            webclass.Show(this, "修改失败");
                        }
                    }
                    else
                    {
                        webclass.Show(this, "密码不一致");
                    }
                }
                else
                {
                    webclass.Show(this, "密码错误");
                }
            }
            else
            {
                webclass.Show(this, "用户信息不存在,请重新登陆");
            }
        }