protected void btnChangePassword_Click(object sender, EventArgs e)
 {
     SysCom.LoginInfo info = new SysCom.LoginInfo();
     info.Password = tbNewPassword.Text;
     info.Username = Session["IdentifyNumber"].ToString();
     if (SysCom.Login.ChangePassword(info))
     {
         Response.Write("<script>alert('!');</script>");
     }
 }
 protected void grvLoginInformation_RowUpdating(object sender, GridViewUpdateEventArgs e)
 {
     SysCom.LoginInfo i = new SysCom.LoginInfo();
     i.Username        = ((Label)grvLoginInformation.Rows[e.RowIndex].Cells[0].FindControl("lbAccountID")).Text.ToString();
     i.Password        = ((TextBox)grvLoginInformation.Rows[e.RowIndex].Cells[0].FindControl("tbPassword")).Text.ToString();
     i.Accoutstate     = ((DropDownList)grvLoginInformation.Rows[e.RowIndex].Cells[0].FindControl("ddlAccountState")).SelectedValue.ToString();
     i.Emailaddress    = ((TextBox)grvLoginInformation.Rows[e.RowIndex].Cells[0].FindControl("tbSafetyEmail")).Text.ToString();
     i.Emailvalidation = Convert.ToInt16(((CheckBox)grvLoginInformation.Rows[e.RowIndex].Cells[0].FindControl("cbEmailValidation")).Checked);
     SysCom.Login.Update(i);
     this.grvLoginInformation.EditIndex = -1;
     setbind();
 }
Example #3
0
 protected void btnInsert_Click(object sender, EventArgs e)
 {
     SysCom.LoginInfo i = new SysCom.LoginInfo();
     i.Username        = tbAccount.Text;
     i.Password        = tbPassword.Text;
     i.Accoutstate     = ddlAccountState.SelectedValue.ToString();
     i.Emailaddress    = tbSafetyEmail.Text;
     i.Emailvalidation = Convert.ToInt16(cbEmailValidation.Checked);
     if (SysCom.Login.Insert(i))
     {
         Response.Write("<script>alert('添加成功')</script>");
     }
 }
Example #4
0
 protected void btnOk_Click(object sender, EventArgs e)
 {
     SysCom.LoginInfo info = SysCom.Login.FindPassWord(tbAccountId.Text.ToString());
     if (info != null)
     {
         SysCom.LoginMail.FindPasswordMail(info.Emailaddress, info.Password);
         Response.Write("<script>alert('邮件已发出请注意查收');location.href='" + "http://" +
                        HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath + "/Default.aspx'</script>");
     }
     else
     {
         Response.Write("<script>alert('用户名不存在');</script>");
     }
 }
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < this.grvLoginInformation.Rows.Count; i++)
     {
         CheckBox ckBox = (CheckBox)this.grvLoginInformation.Rows[i].Cells[0].FindControl("cbDelete");
         if (ckBox.Checked)
         {
             SysCom.LoginInfo infotest = new SysCom.LoginInfo();
             infotest.Username = grvLoginInformation.DataKeys[i][0].ToString();
             SysCom.Login.Delete(infotest);
         }
     }
     //this.chkSelectAll.Checked = false;
     this.grvLoginInformation.EditIndex = -1;
     setbind();
 }
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        SysCom.LoginInfo li = new SysCom.LoginInfo();
        li.Username = tbUserName.Text;
        li.Password = tbPassWord.Text;
        //SysCom.Login.CheckInfo(li,true)
        switch (SysCom.Login.CheckInfo(li, true))
        {
        case SysCom.LoginType.Succeed:
            Session["IdentifyNumber"] = li.Username;
            Session["LoginPassword"]  = li.Password;

            if (SysCom.Login.CheckAuthority(li))
            {
                Session["Authority"] = "Admin";
            }
            else
            {
                Session["Authority"] = "Student";
            }
            pLogin.Visible   = false;
            pSucceed.Visible = true;
            String toUrl;
            if (Request.QueryString["toURL"] != null)
            {
                toUrl = Request.QueryString["toURL"];
            }
            else
            {
                toUrl = "http://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath;
                if (!toUrl.EndsWith("/"))
                {
                    toUrl += "/";
                }
                toUrl += "Default.aspx";
            }
            hlToUrl.NavigateUrl = toUrl;
            hlToUrl.Text        = toUrl;
            AutoRedirect("showurl", 3, toUrl);
            break;

        case SysCom.LoginType.PsError:
            lbErrorMessage.Text = "密码错误";
            break;

        case SysCom.LoginType.Frozen:
            lbErrorMessage.Text = "帐号已被冻结";
            break;

        case SysCom.LoginType.Nouser:
            lbErrorMessage.Text = "没有此帐号";
            break;

        case SysCom.LoginType.NotSure:
            Response.Redirect("LoginMailCommit.aspx?AccountId=" + li.Username);
            break;

        default:
            break;
        }
    }
Example #7
0
 /// <summary>
 /// 用户修改自己的密码
 /// </summary>
 /// <param name="ToCheck">新密码</param>
 /// <returns></returns>
 #region 修改密码
 public static bool ChangePassword(LoginInfo ToCheck)
 {
     Ops.OpLoginExecute op = new Ops.OpLoginExecute("Account", new sqlChangePassword(ToCheck));
     op.Do();
     return(op.ExecuteResult);
 }
Example #8
0
 /// <summary>
 /// 后台修改用户信息
 /// </summary>
 /// <param name="ToCheck"></param>
 /// <returns></returns>
 public static bool Update(LoginInfo ToCheck)
 {
     Ops.OpLoginExecute op = new Ops.OpLoginExecute("Account", new sqlLoginUpdate(ToCheck));
     op.Do();
     return(op.ExecuteResult);
 }