Ejemplo n.º 1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            string asd = UserProc.EncryptDES(txtWy.txt.Text, "12345678");

            if (asd != ClsLogUser.PassWord)
            {
                int num = (int)MessageBox.Show(this, "原密码不对!");
                this.txtWy.txt.Focus();
            }
            else if (this.txtWn1.txt.Text != this.txtWn2.txt.Text)
            {
                int num = (int)MessageBox.Show(this, "两次新密码不一致!请正确操作!");
                this.txtWn1.txt.Focus();
            }
            else
            {
                var all = db.Queryable <T_Base>()
                          .Where(it => it.SN == ClsLogUser.SNuser)
                          .ToList();
                if (all.Count > 0)
                {
                    var sad = all[0];
                    sad.item0 = UserProc.EncryptDES(txtWn1.txt.Text, "12345678");
                    //sad.item0 = txtWn1.txt.Text;
                    db.Updateable <T_Base>(sad).ExecuteCommand();
                    MessageBox.Show(this, "修改成功!");
                }
                else
                {
                    MessageBox.Show(this, "修改失败,关闭后重试!");
                }
            }
        }
Ejemplo n.º 2
0
 private void Login()
 {
     try
     {
         T_Base t_Base = db.Queryable <T_Base>()
                         .Where(it => (it.itemName == textBox1.Text || it.bianhao == textBox1.Text) && it.item0 == UserProc.EncryptDES(textBox2.Text, "123456789") && it.leibie == "用户登录")
                         .Single();
         if (t_Base == null)
         {
             MessageBox.Show("用户名或者密码错误");
             return;
         }
         Settings.Default.islogin = t_Base.SN + "";
         Settings.Default.Save();
         this.DialogResult = DialogResult.OK;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }