private void insert_nguoi_xu_ly_cap(GridView v_grv, decimal v_cap_sd) { for (int i = 0; i < v_grv.RowCount; i++) { US_HT_BO_DICH_VU v_us_bo_dv = new US_HT_BO_DICH_VU(); v_us_bo_dv.dcID_DICH_VU = m_us_dich_vu.dcID; v_us_bo_dv.dcID_NGUOI_SU_DUNG = CIPConvert.ToDecimal(v_grv.GetDataRow(i)["ID_NGUOI_SU_DUNG"].ToString()); v_us_bo_dv.dcCAP_SU_DUNG = v_cap_sd; v_us_bo_dv.strTRANG_THAI_HSD = "N"; v_us_bo_dv.Insert(); } }
private void m_cmd_luu_Click(object sender, EventArgs e) { try { if (kiemtradulieu()) { //insert vào HT_NGUOI_SU_DUNG m_us.strTEN_TRUY_CAP = m_txt_ten_truy_cap.Text; m_us.strTEN = m_txt_ho_ten.Text; m_us.strMAT_KHAU = us_user.GetMD5(m_txt_mat_khau.Text); m_us.datNGAY_TAO = System.DateTime.Now; m_us.strEMAIL = m_txt_email.Text; m_us.strNGUOI_TAO = us_user.strTEN_TRUY_CAP; m_us.Insert(); //insert vào HT_NGUOI_SU_DUNG_NHOM_CHI_NHANH m_us_nguoi_sd_nhom_cn.dcID_NGUOI_SU_DUNG = m_us.dcID; m_us_nguoi_sd_nhom_cn.dcID_NHOM = CIPConvert.ToDecimal(m_cbo_cap_xu_ly.SelectedValue.ToString()); m_us_nguoi_sd_nhom_cn.dcID_CHI_NHANH = us_user.dcCHI_NHANH; m_us_nguoi_sd_nhom_cn.Insert(); //insert htbo dịch vụ for (int i = 0; i < m_list_dich_vu.Count; i++) { m_us_ht_bo_dich_vu.dcID_DICH_VU = m_list_dich_vu[i]; m_us_ht_bo_dich_vu.dcID_NGUOI_SU_DUNG = m_us.dcID; if (CIPConvert.ToDecimal(m_cbo_cap_xu_ly.SelectedValue.ToString()) == 7) { m_us_ht_bo_dich_vu.dcCAP_SU_DUNG = 2; } else { m_us_ht_bo_dich_vu.dcCAP_SU_DUNG = CIPConvert.ToDecimal(m_cbo_cap_xu_ly.SelectedValue.ToString()); } m_us_ht_bo_dich_vu.strTRANG_THAI_HSD = "N"; m_us_ht_bo_dich_vu.Insert(); } m_list_dich_vu.Clear(); MessageBox.Show("Thành công!"); this.Close(); } } catch (Exception v_e) { CSystemLog_100.ExceptionHandle(v_e); } }