/// <summary> /// Create custom source for autocomplete from DM_KY /// </summary> /// <returns>Custom source</returns> public static AutoCompleteStringCollection create_csac_ky() { // Initialize US_DM_KY v_us_dm_ky = new US_DM_KY(); DS_DM_KY v_ds_dm_ky = new DS_DM_KY(); AutoCompleteStringCollection v_acsc = new AutoCompleteStringCollection(); try { // Fill dataset v_us_dm_ky.FillDataset(v_ds_dm_ky); // Create custom source foreach (var v_rows in v_ds_dm_ky.DM_KY) { v_acsc.Add((String)v_rows[DM_KY.MA_KY]); } } catch (Exception v_e) { CSystemLog_301.ExceptionHandle(v_e); return(null); } return(v_acsc); }
/// <summary> /// Tạo datasource mã kỳ /// </summary> /// <returns>DataSet làm DataSource</returns> public static DataSet create_datasrc_ma_ky() { // Initialize US_DM_KY v_us = new US_DM_KY(); DS_DM_KY v_ds = new DS_DM_KY(); v_us.FillDataset(v_ds); return(v_ds); }
/// <summary> /// Hàm setup các properties của members /// </summary> private void init_members() { // m_cmd_xuat_exel m_cmd_xuat_excel.Visible = false; // m_ds_tong_luong_n m_ds_tong_luong_n = new Dictionary <string, DS_RPT_TONG_LUONG>(); // Init US_DM_KY v_us_ky = new US_DM_KY(); DS_DM_KY v_ds_ky = new DS_DM_KY(); // Fill DS v_us_ky.FillDataset(v_ds_ky); // m_fg m_fg.AllowEditing = false; Column v_col; // Add column mã tổng lương v_col = m_fg.Cols.Add(); v_col.Name = "MA_TONG_LUONG"; v_col.Caption = "Mã tổng lương"; v_col.DataType = typeof(string); // Add các column mã kỳ foreach (DataRow v_row in v_ds_ky.DM_KY.Rows) { string v_ma_ky = (String)v_row[DM_KY.MA_KY]; v_col = m_fg.Cols.Add(); v_col.Name = v_ma_ky; v_col.Caption = v_ma_ky; v_col.DataType = typeof(Decimal); v_col.Format = "#,###"; } }
private void load_data_2_cbo() { // Cbo ma ky US_DM_KY v_us_dm_ky = new US_DM_KY(); DS_DM_KY v_ds_dm_ky = new DS_DM_KY(); v_us_dm_ky.FillDataset(v_ds_dm_ky); DataTable v_dt = v_ds_dm_ky.Tables[0]; DataRow v_dr = v_dt.NewRow(); v_dr[DM_KY.ID] = -1; v_dr[DM_KY.MA_KY] = "Tất cả"; v_dt.Rows.InsertAt(v_dr, 0); m_cbo_ky.DataSource = v_dt; m_cbo_ky.ValueMember = DM_KY.ID; m_cbo_ky.DisplayMember = DM_KY.MA_KY; // Cbo loai luong CUtils.load_datasource_loai_quyet_dinh(m_cbo_loai_luong, 1, true); }