示例#1
0
 public ChamCongUser()
 {
     dtJob   = new DB.UserJobDataTable();
     adtJob  = new DBTableAdapters.UserJobTableAdapter();
     dtUser  = new DB.tblUserDataTable();
     adtUser = new DBTableAdapters.tblUserTableAdapter();
     adtUser.Connection.ConnectionString = QT.Entities.Server.ConnectionString;
     adtJob.Connection.ConnectionString  = QT.Entities.Server.ConnectionString;
 }
示例#2
0
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     if (_changePass)
     {
         DB.tblUserDataTable dt = new DB.tblUserDataTable();
         DBTableAdapters.tblUserTableAdapter adt = new DBTableAdapters.tblUserTableAdapter();
         adt.Connection.ConnectionString = QT.Entities.Server.ConnectionString;
         adt.FillBy_UserPass(dt, User.UserName, CryptoWSS.Encrypt(txtPassOld.Text.Trim()));
         if (dt.Rows.Count > 0)
         {
             if (txtPassNewsRe.Text.Trim() == this.txtPassNews.Text.Trim())
             {
                 adt.UpdateQuery_Pass(CryptoWSS.Encrypt(txtPassNewsRe.Text.Trim()), QT.Entities.Common.Obj2Int(dt.Rows[0]["ID"].ToString()));
                 this.Close();
             }
             else
             {
                 MessageBox.Show("Mật khẩu không đúng, nhập lại");
                 txtPassNewsRe.Text = "";
                 txtPassNews.Text   = "";
             }
         }
         else
         {
             MessageBox.Show("Mật khẩu không đúng");
             txtPassOld.Focus();
         }
         adt.Dispose();
         dt.Dispose();
     }
     else
     {
         if (txtPassNewsRe.Text.Trim() == this.txtPassNews.Text.Trim())
         {
             DialogResult = DialogResult.OK;
             this.Close();
         }
         else
         {
             MessageBox.Show("Mật khẩu không đúng, nhập lại");
             txtPassNewsRe.Text = "";
             txtPassNews.Text   = "";
         }
     }
 }