private void load_data_2_grid() { m_ds = new DS_DM_NHAN_SU(); m_us.FillDataset(m_ds); m_fg.Redraw = false; CGridUtils.Dataset2C1Grid(m_ds, m_fg, m_obj_trans); m_fg.Redraw = true; }
private void save_data() { var v_count_left = m_lbox_nhan_vien_left.Items.Count; var v_count_right = m_lbox_nhan_vien_right.Items.Count; var v_id_don_vi_left = m_cbo_don_vi_left.SelectedValue; var v_id_don_vi_right = m_cbo_don_vi_right.SelectedValue; var v_us_dm_du_lieu_nhan_vien = new US_V_DM_DU_LIEU_NHAN_VIEN(); var v_ds_dm_du_lieu_nhan_vien = new DS_V_DM_DU_LIEU_NHAN_VIEN(); var v_us_dm_nhan_su = new US_DM_NHAN_SU(); var v_ds_dm_nhan_su = new DS_DM_NHAN_SU(); var v_danh_sach_nhan_vien_left_new = new collection(1); var v_danh_sach_nhan_vien_left_old = new collection(1); var v_danh_sach_nhan_vien_left_insert = new collection(1); var v_danh_sach_nhan_vien_left_delete = new collection(1); var v_danh_sach_nhan_vien_right_new = new collection(1); var v_danh_sach_nhan_vien_right_old = new collection(1); var v_danh_sach_nhan_vien_right_insert = new collection(1); var v_danh_sach_nhan_vien_right_delete = new collection(1); v_us_dm_nhan_su.FillDataset(v_ds_dm_nhan_su); v_us_dm_du_lieu_nhan_vien.FillDatasetByIdDonVi(v_ds_dm_du_lieu_nhan_vien, CIPConvert.ToDecimal(v_id_don_vi_left)); ////-- Lưu nhân sự đơn vị LEFT //+ Danh sách nhân viên mới trong ListBox if (v_count_left > 0) { v_danh_sach_nhan_vien_left_new = new collection(v_count_left); foreach (var v_item in m_lbox_nhan_vien_left.Items) { var v_ma_nhan_vien = get_ma_nhan_vien(v_item.ToString()); var v_nhan_vien = (DS_DM_NHAN_SU.DM_NHAN_SURow)(v_ds_dm_nhan_su.DM_NHAN_SU.Select("MA_NV = " + v_ma_nhan_vien)[0]); v_danh_sach_nhan_vien_left_new.insert(v_nhan_vien.ID.ToString()); } //+ Danh sách nhân viên cũ trước khi thay đổi ListBox var v_count_nhan_vien = v_ds_dm_du_lieu_nhan_vien.V_DM_DU_LIEU_NHAN_VIEN.Count; if (v_count_nhan_vien > 0) { var v_nhan_vien = (v_ds_dm_du_lieu_nhan_vien.V_DM_DU_LIEU_NHAN_VIEN.Rows); v_danh_sach_nhan_vien_left_old = new collection(v_count_nhan_vien); foreach (DS_V_DM_DU_LIEU_NHAN_VIEN.V_DM_DU_LIEU_NHAN_VIENRow v_item in v_nhan_vien) { v_danh_sach_nhan_vien_left_old.insert(v_item.ID.ToString()); } } //+ Danh sách nhân viên thêm mới v_danh_sach_nhan_vien_left_insert = new collection(v_danh_sach_nhan_vien_left_new.countInANotInB(v_danh_sach_nhan_vien_left_old)); v_danh_sach_nhan_vien_left_insert = v_danh_sach_nhan_vien_left_new.InANotInB(v_danh_sach_nhan_vien_left_old); for (int i = 0; i < v_danh_sach_nhan_vien_left_insert.getIndex(); i++) { decimal v_id = CIPConvert.ToDecimal(v_danh_sach_nhan_vien_left_insert.s[i]); v_us_dm_du_lieu_nhan_vien.FillDatasetByIdDonVi(v_ds_dm_du_lieu_nhan_vien, v_id); } } //+ Danh sách nhân viên sẽ bị xoá v_danh_sach_nhan_vien_left_delete = v_danh_sach_nhan_vien_left_old.InANotInB(v_danh_sach_nhan_vien_left_new); }
private void load_data_2_custom_source_ma_nhan_vien() { US_DM_NHAN_SU v_us = new US_DM_NHAN_SU(); DS_DM_NHAN_SU v_ds = new DS_DM_NHAN_SU(); v_us.FillDataset(v_ds); for (int i = 0; i < v_ds.Tables[0].Rows.Count; i++) { DataRow dr = v_ds.Tables[0].Rows[i]; m_txt_ma_ns.AutoCompleteCustomSource.Add(dr["MA_NV"].ToString()); } }
private void load_custom_source_2_m_txt_tim_kiem() { DS_DM_NHAN_SU v_ds = new DS_DM_NHAN_SU(); US_DM_NHAN_SU v_us = new US_DM_NHAN_SU(); v_us.FillDataset(v_ds); int count = v_ds.Tables["DM_NHAN_SU"].Rows.Count; AutoCompleteStringCollection v_acsc_search = new AutoCompleteStringCollection(); foreach (DataRow dr in v_ds.DM_NHAN_SU) { v_acsc_search.Add(dr[DM_NHAN_SU.MA_NV].ToString()); } m_txt_ma_nv.AutoCompleteCustomSource = v_acsc_search; }
private void auto_suggest_text() { US_DM_NHAN_SU us_dm_nhan_su = new US_DM_NHAN_SU(); DS_DM_NHAN_SU ds_dm_nhan_su = new DS_DM_NHAN_SU(); us_dm_nhan_su.FillDataset(ds_dm_nhan_su); var v_acsc_search = new AutoCompleteStringCollection(); foreach (var v_rows in ds_dm_nhan_su.DM_NHAN_SU) { v_acsc_search.Add(v_rows[DM_NHAN_SU.HO_DEM] + " - " + v_rows[DM_NHAN_SU.TEN] + " - " + v_rows[DM_NHAN_SU.MA_NV]); v_acsc_search.Add(v_rows[DM_NHAN_SU.TEN] + " - " + v_rows[DM_NHAN_SU.HO_DEM] + " " + v_rows[DM_NHAN_SU.TEN] + " - " + v_rows[DM_NHAN_SU.MA_NV]); v_acsc_search.Add(v_rows[DM_NHAN_SU.MA_NV] + " - " + v_rows[DM_NHAN_SU.HO_DEM] + " " + v_rows[DM_NHAN_SU.TEN] + " - " + v_rows[DM_NHAN_SU.MA_NV]); } m_txt_tim_kiem_nhan_vien.AutoCompleteCustomSource = v_acsc_search; }
private void load_custom_source_2_m_txt_tim_kiem() { DS_DM_NHAN_SU m_ds_ns = new DS_DM_NHAN_SU(); US_DM_NHAN_SU m_us_ns = new US_DM_NHAN_SU(); m_us_ns.FillDataset(m_ds_ns); // int count = m_ds_qua_trinh_lam_viec.Tables["V_GD_QUA_TRINH_LAM_VIEC"].Rows.Count; AutoCompleteStringCollection v_acsc_search = new AutoCompleteStringCollection(); foreach (DataRow dr in m_ds_ns.DM_NHAN_SU) { v_acsc_search.Add(dr[DM_NHAN_SU.MA_NV].ToString()); v_acsc_search.Add(dr[DM_NHAN_SU.HO_DEM].ToString() + " " + dr[DM_NHAN_SU.TEN].ToString()); v_acsc_search.Add(dr[DM_NHAN_SU.TEN].ToString()); } m_txt_tim_kiem.AutoCompleteCustomSource = v_acsc_search; }
private void us_object_to_form() { m_txt_ma_nv.Text = m_us.strMA_NV; DS_DM_NHAN_SU m_ds_nhan_su = new DS_DM_NHAN_SU(); US_DM_NHAN_SU m_us_nhan_su = new US_DM_NHAN_SU(); m_us_nhan_su.FillDataset(m_ds_nhan_su, "WHERE MA_NV = N'" + m_txt_ma_nv.Text.ToString() + "'"); id_nhan_su = decimal.Parse(m_ds_nhan_su.DM_NHAN_SU.Rows[0][0].ToString()); m_txt_ho_ten.Text = m_us.strHO_DEM + " " + m_us.strTEN; m_txt_ma_nv.BackColor = SystemColors.Info; m_txt_ma_nv.ReadOnly = true; m_txt_ho_ten.BackColor = SystemColors.Info; m_txt_ho_ten.ReadOnly = true; BKI_HRM.DS.DS_CM_DM_TU_DIEN v_ds_loai_quyet_dinh = new BKI_HRM.DS.DS_CM_DM_TU_DIEN(); BKI_HRM.US.US_CM_DM_TU_DIEN v_us_loai_quyet_dinh = new BKI_HRM.US.US_CM_DM_TU_DIEN(); v_us_loai_quyet_dinh.FillDataset_load_loai_quyet_dinh(v_ds_loai_quyet_dinh, "Tất cả", "N"); m_cbo_loai_quyet_dinh.DataSource = v_ds_loai_quyet_dinh.CM_DM_TU_DIEN; m_cbo_loai_quyet_dinh.DisplayMember = CM_DM_TU_DIEN.TEN; m_cbo_loai_quyet_dinh.ValueMember = CM_DM_TU_DIEN.ID; }