Exemplo n.º 1
0
        private void dgv_Content_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1)
            {
                switch (e.ColumnIndex)
                {
                case 0:
                    edt_Ten.Enabled = edt_DiaChi.Enabled = edt_Dienthoai.Enabled = edt_Mail.Enabled
                                                                                       = cbb_LoaiTK.Enabled = swh_Status.Enabled = true;
                    this.btn_Update.Enabled = this.btn_Cancel.Enabled = btn_ResetPass.Enabled = true;
                    Set_EditAccount(TaiKhoan_Data.Get_TaiKhoan(dgv_Content.Rows[e.RowIndex].Cells[2].Value.ToString()));
                    break;

                case 1:
                    DialogResult result = MessageBox.Show("Do you want to delete this?", "Note", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                    if (result == DialogResult.Yes)
                    {
                        Data_Entity.NhaCC_Data.Delete_NhaCc(this.dgv_Content.Rows[e.RowIndex].Cells[2].Value.ToString());
                        RefeshForm();
                    }
                    break;
                }
            }
        }
Exemplo n.º 2
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);
 }