private void save_data()
{
//Buoc 1: Check validate du lieu khong duoc de trong
if(!check_validate_data_is_ok())
return;
//Buoc 2: Check mat khau cu co dung voi ten tai khoan khong?
//Khong dung thi hien thong bao
US_HT_NGUOI_SU_DUNG v_us_ht_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG(CIPConvert.ToDecimal(m_cbo_tai_khoan.SelectedValue));
if(CIPConvert.Deciphering(v_us_ht_nguoi_su_dung.strMAT_KHAU) != m_txt_mat_khau_cu.Text) {
CHRM_BaseMessages.MsgBox_Error(CONST_ID_MSGBOX.ERROR_NHAP_SAI_MAT_KHAU_CU);
return;
}
//Buoc 3: Check mat khau cu va moi co trung nhau hay khong?
if(m_txt_mat_khau_moi.Text != m_txt_nhap_lai_mat_khau_moi.Text) {
CHRM_BaseMessages.MsgBox_Error(CONST_ID_MSGBOX.ERROR_NHAP_LAI_MAT_KHAU_MOI_BI_SAI);
return;
}
//Buoc 4: Luu
try
{
v_us_ht_nguoi_su_dung.strMAT_KHAU = CIPConvert.Encoding(m_txt_mat_khau_moi.Text);
v_us_ht_nguoi_su_dung.Update();
}
catch (System.Exception v_e)
{
CSystemLog_301.ExceptionHandle(v_e);
}
//Buoc 5: Hien thong bao
CHRM_BaseMessages.MsgBox_Infor(CONST_ID_MSGBOX.INFOR_DOI_MAT_KHAU_THANH_CONG);
this.Close();
}