private void load_data_2_cbo_dich_vu() { US_DM_LOAI_YEU_CAU v_us_dich_vu = new US_DM_LOAI_YEU_CAU(); DS_DM_LOAI_YEU_CAU v_ds_dich_vu = new DS_DM_LOAI_YEU_CAU(); decimal v_dc_id_loai_dich_vu = CIPConvert.ToDecimal(m_cbo_loai_dich_vu.SelectedValue); v_us_dich_vu.load_ds_dich_vu_by_loai(v_dc_id_loai_dich_vu, v_ds_dich_vu); DataRow v_dr = v_ds_dich_vu.DM_LOAI_YEU_CAU.NewDM_LOAI_YEU_CAURow(); v_dr[DM_LOAI_YEU_CAU.ID] = 0; if (v_ds_dich_vu.DM_LOAI_YEU_CAU.Rows.Count == 0) { v_dr[DM_LOAI_YEU_CAU.TEN_YEU_CAU] = "- Không có dịch vụ con -"; m_cbo_dich_vu.Enabled = false; } else { v_dr[DM_LOAI_YEU_CAU.TEN_YEU_CAU] = "- Chọn một dịch vụ -"; m_cbo_dich_vu.Enabled = true; } v_ds_dich_vu.EnforceConstraints = false; v_ds_dich_vu.DM_LOAI_YEU_CAU.Rows.InsertAt(v_dr, 0); m_cbo_dich_vu.DataSource = v_ds_dich_vu.DM_LOAI_YEU_CAU; m_cbo_dich_vu.DisplayMember = DM_LOAI_YEU_CAU.TEN_YEU_CAU; m_cbo_dich_vu.ValueMember = DM_LOAI_YEU_CAU.ID; }
private void insert_dich_vu() { US_DM_LOAI_YEU_CAU v_us = new US_DM_LOAI_YEU_CAU(); v_us.dcID_CHA = CIPConvert.ToDecimal(cbo_nhom_dich_vu.SelectedValue.ToString()); v_us.strTEN_YEU_CAU = txt_dich_vu.Text; if (m_txt_diem_khoi_luong.Text != "") { v_us.dcDIEM_KHOI_LUONG = CIPConvert.ToDecimal(m_txt_diem_khoi_luong.Text); } else { v_us.SetDIEM_KHOI_LUONGNull(); } if (m_cbox_thoi_gian_xu_ly.Checked && m_cbox_thoi_gian_xly.SelectedValue != null) { v_us.dcID_THOI_GIAN_XU_LY = CIPConvert.ToDecimal(m_cbox_thoi_gian_xly.SelectedValue.ToString()); } else { v_us.SetID_THOI_GIAN_XU_LYNull(); } v_us.strTRANG_THAI_HSD = "N"; v_us.Insert(); m_us_dich_vu = v_us; }
internal void displayupdate(US_DM_LOAI_YEU_CAU v_us1, US_DM_LOAI_YEU_CAU v_us2) { m_e_form_mode = DataEntryFormMode.UpdateDataState; m_us = v_us1; us_to_form(v_us1, v_us2); this.ShowDialog(); }
internal void displayUpdate(US_DM_LOAI_YEU_CAU v_us_dich_vu) { m_e_form_mode = DataEntryFormMode.UpdateDataState; load_data_to_form(); m_us_dich_vu = v_us_dich_vu; us_to_form(v_us_dich_vu); this.ShowDialog(); }
private void us_to_form(US_DM_LOAI_YEU_CAU v_us_dich_vu) { US_DM_LOAI_YEU_CAU v_us = new US_DM_LOAI_YEU_CAU(v_us_dich_vu.dcID_CHA); cbo_loai_dich_vu.SelectedValue = v_us.dcID_CHA; cbo_nhom_dich_vu.SelectedValue = v_us_dich_vu.dcID_CHA; txt_dich_vu.Text = v_us_dich_vu.strTEN_YEU_CAU; m_cbox_thoi_gian_xly.SelectedValue = v_us_dich_vu.dcID_THOI_GIAN_XU_LY; if (v_us_dich_vu.dcDIEM_KHOI_LUONG.ToString() != "0") { m_txt_diem_khoi_luong.Text = v_us_dich_vu.dcDIEM_KHOI_LUONG.ToString(); } load_data_to_grv_ds_nv_update(2, v_us_dich_vu.dcID); load_data_to_grv_ds_nv_update(3, v_us_dich_vu.dcID); load_data_to_grv_ds_nv_update(5, v_us_dich_vu.dcID); }
private void simpbtn_xoa_Click(object sender, EventArgs e) { try { DataRow v_dr = m_grv_dm_loai_yeu_cau.GetDataRow(m_grv_dm_loai_yeu_cau.FocusedRowHandle); decimal v_id = CIPConvert.ToDecimal(v_dr[DM_LOAI_YEU_CAU.ID].ToString()); US_DM_LOAI_YEU_CAU v_us = new US_DM_LOAI_YEU_CAU(v_id); v_us.strTRANG_THAI_HSD = "Y"; v_us.Update(); MessageBox.Show("Xóa thành công " + v_dr[DM_LOAI_YEU_CAU.ID].ToString()); load_data_griv(); } catch (Exception v_e) { CSystemLog_301.ExceptionHandle(v_e); } }
private void m_cmd_xoa_Click(object sender, EventArgs e) { try { US_DM_LOAI_YEU_CAU v_us = new US_DM_LOAI_YEU_CAU(CIPConvert.ToDecimal(m_us_dich_vu.dcID.ToString())); v_us.strTRANG_THAI_HSD = "Y"; v_us.Update(); delete_ht_bo_dich_vu(grv_danh_sach_bo, 2); delete_ht_bo_dich_vu(grv_danh_sach_pm, 3); delete_ht_bo_dich_vu(grv_danh_sach_td, 5); MessageBox.Show("thành công"); this.Close(); } catch (Exception v_e) { CSystemLog_100.ExceptionHandle(v_e); } }
private void load_data_2_cbo_loai_dich_vu() { US_DM_LOAI_YEU_CAU v_us_loai_dich_vu = new US_DM_LOAI_YEU_CAU(); DS_DM_LOAI_YEU_CAU v_ds_loai_dich_vu = new DS_DM_LOAI_YEU_CAU(); v_us_loai_dich_vu.load_ds_loai_dich_vu(v_ds_loai_dich_vu); DataRow v_dr = v_ds_loai_dich_vu.DM_LOAI_YEU_CAU.NewDM_LOAI_YEU_CAURow(); v_dr[DM_LOAI_YEU_CAU.ID] = 0; v_dr[DM_LOAI_YEU_CAU.TEN_YEU_CAU] = "- Chọn một loại dịch vụ -"; v_ds_loai_dich_vu.EnforceConstraints = false; v_ds_loai_dich_vu.DM_LOAI_YEU_CAU.Rows.InsertAt(v_dr, 0); m_cbo_loai_dich_vu.DataSource = v_ds_loai_dich_vu.DM_LOAI_YEU_CAU; m_cbo_loai_dich_vu.DisplayMember = DM_LOAI_YEU_CAU.TEN_YEU_CAU; m_cbo_loai_dich_vu.ValueMember = DM_LOAI_YEU_CAU.ID; m_e_cbo_trang_thai_loai_dich_vu = e_cbo_state.DA_FILL_DATA_XONG; }
private void DoRowDoubleClick(GridView view, Point pt) { GridHitInfo info = view.CalcHitInfo(pt); if (info.InRow || info.InRowCell) { DataRow v_dr_grv = m_grv_ht_bo_pm_td_dich_vu.GetDataRow(m_grv_ht_bo_pm_td_dich_vu.FocusedRowHandle); if (v_dr_grv == null) { try { f999_ht_bo_pm_td_dich_vu_de v_f = new f999_ht_bo_pm_td_dich_vu_de(); v_f.WindowState = FormWindowState.Maximized; v_f.displayInsert(); load_data_to_grv(); } catch (Exception v_e) { CSystemLog_100.ExceptionHandle(v_e); } } else { try { decimal v_id = CIPConvert.ToDecimal(v_dr_grv["ID"].ToString()); US_DM_LOAI_YEU_CAU v_us = new US_DM_LOAI_YEU_CAU(v_id); f999_ht_bo_pm_td_dich_vu_de v_f = new f999_ht_bo_pm_td_dich_vu_de(); v_f.WindowState = FormWindowState.Maximized; v_f.displayUpdate(v_us); load_data_to_grv(); } catch (Exception v_e) { CSystemLog_100.ExceptionHandle(v_e); } } } }
private void us_to_form(US_DM_LOAI_YEU_CAU v_us1, US_DM_LOAI_YEU_CAU v_us2) { load_data_combobox(); cbo_loai_dich_vu.SelectedValue = v_us2.dcID_CHA; cbo_nhom_dich_vu.SelectedValue = v_us1.dcID_CHA; txt_dich_vu.Text = v_us1.strTEN_YEU_CAU; if (CIPConvert.ToDecimal(v_us1.dcDIEM_KHOI_LUONG.ToString()) != 0) { txt_diem_khoi_luong.Text = v_us1.dcDIEM_KHOI_LUONG.ToString(); } if (CIPConvert.ToDecimal(v_us1.dcID_THOI_GIAN_XU_LY.ToString()) == 0) { m_cbox_thoi_gian_xu_ly.Checked = false; cbo_thoi_gian_xu_ly.Enabled = false; } else { m_cbox_thoi_gian_xu_ly.Checked = true; cbo_thoi_gian_xu_ly.Enabled = true; cbo_thoi_gian_xu_ly.SelectedValue = v_us1.dcID_THOI_GIAN_XU_LY; } }
private void DoRowDoubleClick(GridView view, Point pt) { GridHitInfo info = view.CalcHitInfo(pt); if (info.InRow || info.InRowCell) { DataRow v_dr_grv = m_grv_dm_loai_yeu_cau.GetDataRow(m_grv_dm_loai_yeu_cau.FocusedRowHandle); if (v_dr_grv == null) { try { f102_dm_loai_yeu_cau_de v_f = new f102_dm_loai_yeu_cau_de(); v_f.displayinsert(); load_data_griv(); } catch (Exception v_e) { CSystemLog_301.ExceptionHandle(v_e); } } else { try { DataRow v_dr = m_grv_dm_loai_yeu_cau.GetDataRow(m_grv_dm_loai_yeu_cau.FocusedRowHandle); US_DM_LOAI_YEU_CAU v_us1 = new US_DM_LOAI_YEU_CAU(CIPConvert.ToDecimal(v_dr[DM_LOAI_YEU_CAU.ID].ToString())); US_DM_LOAI_YEU_CAU v_us2 = new US_DM_LOAI_YEU_CAU(CIPConvert.ToDecimal(v_dr[DM_LOAI_YEU_CAU.ID_CHA].ToString())); f102_dm_loai_yeu_cau_de v_f = new f102_dm_loai_yeu_cau_de(); v_f.displayupdate(v_us1, v_us2); load_data_griv(); } catch (Exception v_e) { CSystemLog_301.ExceptionHandle(v_e); } } } }
private void update_dich_vu() { US_DM_LOAI_YEU_CAU v_us = new US_DM_LOAI_YEU_CAU(CIPConvert.ToDecimal(m_us_dich_vu.dcID.ToString())); v_us.strTEN_YEU_CAU = txt_dich_vu.Text; if (m_txt_diem_khoi_luong.Text != "") { v_us.dcDIEM_KHOI_LUONG = CIPConvert.ToDecimal(m_txt_diem_khoi_luong.Text); } else { v_us.SetDIEM_KHOI_LUONGNull(); } if (m_cbox_thoi_gian_xu_ly.Checked && m_cbox_thoi_gian_xly.SelectedValue != null) { v_us.dcID_THOI_GIAN_XU_LY = CIPConvert.ToDecimal(m_cbox_thoi_gian_xly.SelectedValue.ToString()); } else { v_us.SetID_THOI_GIAN_XU_LYNull(); } v_us.Update(); }