コード例 #1
0
 private void btn_ResetPass_Click(object sender, EventArgs e)
 {
     TaiKhoan_Data.Update_TaiKhoanPass(edt_Ma.Text.Trim(), MD5_Hash.MD5Hash(this.pass_Default));
     MessageBox.Show("The password is reseted to " + this.pass_Default + "!", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }
コード例 #2
0
 private void btn_Update_Click(object sender, EventArgs e)
 {
     if (this.status)
     {
         if (edt_Ten.Text.Trim() != "" && edt_Dienthoai.Text.Trim() != "" &&
             edt_DiaChi.Text.Trim() != "" && edt_Mail.Text.Trim() != "" && edt_Ma.Text != "")
         {
             Data_Entity.TaiKhoan_Data.Add_TaiKhoan(
                 new TaiKhoan
             {
                 user_Acc  = this.edt_Ma.Text.Trim(),
                 pass_Acc  = MD5_Hash.MD5Hash(this.pass_Default),
                 status    = this.swh_Status.Checked,
                 id_LoaiTK = this.cbb_LoaiTK.SelectedValue.ToString()
             },
                 new TT_TaiKhoan
             {
                 user_Acc     = this.edt_Ma.Text.Trim(),
                 name_User    = this.edt_Ten.Text,
                 email_User   = this.edt_Mail.Text,
                 phone_User   = this.edt_Dienthoai.Text,
                 address_User = this.edt_DiaChi.Text
             }
                 );
             MessageBox.Show("Add is success with the password: "******"!", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information);
             RefeshForm();
         }
         else
         {
             MessageBox.Show("The values of the columns is'nt NULL", "Note", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else
     {
         if (edt_Ten.Text.Trim() != "" && edt_Dienthoai.Text.Trim() != "" &&
             edt_DiaChi.Text.Trim() != "" && edt_Mail.Text.Trim() != "" && edt_Ma.Text != "")
         {
             Data_Entity.TaiKhoan_Data.Edit_TaiKhoan(
                 new TaiKhoan
             {
                 user_Acc  = this.edt_Ma.Text.Trim(),
                 status    = this.swh_Status.Checked,
                 id_LoaiTK = this.cbb_LoaiTK.SelectedValue.ToString()
             },
                 new TT_TaiKhoan
             {
                 user_Acc     = this.edt_Ma.Text.Trim(),
                 name_User    = this.edt_Ten.Text,
                 email_User   = this.edt_Mail.Text,
                 phone_User   = this.edt_Dienthoai.Text,
                 address_User = this.edt_DiaChi.Text
             }
                 );
             MessageBox.Show("Edit is success!", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information);
             RefeshForm();
         }
         else
         {
             MessageBox.Show("The values of the columns is'nt NULL", "Note", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
 }