private void auto_suggest_text()
        {
            DS_V_DM_NHAN_SU_DU_AN v_ds_dm_ns_da = new DS_V_DM_NHAN_SU_DU_AN();
            US_V_DM_NHAN_SU_DU_AN v_us_dm_ns_da = new US_V_DM_NHAN_SU_DU_AN();

            v_us_dm_ns_da.FillDatasetTuNgayDenNgay(
                v_ds_dm_ns_da,
                "",
                DateTime.Parse(m_dat_tu_ngay.Value.ToShortDateString()),
                DateTime.Parse(m_dat_den_ngay.Value.ToShortDateString()),
                0,
                CAppContext_201.getCurrentIDPhapnhan());
            var v_acsc_search = new AutoCompleteStringCollection();

            foreach (DataRow dr in v_ds_dm_ns_da.V_DM_NHAN_SU_DU_AN)
            {
                v_acsc_search.Add(dr[V_DM_NHAN_SU_DU_AN.HO_DEM] + " " + dr[V_DM_NHAN_SU_DU_AN.TEN]);
                v_acsc_search.Add(dr[V_DM_NHAN_SU_DU_AN.TEN].ToString());
                v_acsc_search.Add(dr[V_DM_NHAN_SU_DU_AN.HO_DEM].ToString());
                v_acsc_search.Add(dr[V_DM_NHAN_SU_DU_AN.MA_DU_AN].ToString());
                v_acsc_search.Add(dr[V_DM_NHAN_SU_DU_AN.TEN_DU_AN].ToString());
                v_acsc_search.Add(dr[V_DM_NHAN_SU_DU_AN.VI_TRI].ToString());
            }
            m_txt_tim_kiem.AutoCompleteCustomSource = v_acsc_search;
        }
        private void load_data_2_grid()
        {
            decimal v_kiem_nhiem;

            if (m_ckb_kiem_nhiem.Checked)
            {
                v_kiem_nhiem = -1;
            }
            else
            {
                v_kiem_nhiem = 650;
            }
            m_ds = new DS_V_GD_QUA_TRINH_LAM_VIEC_2();
            var v_dat_thoi_diem = DateTime.Now;

            if (m_dtp_thoidiem.Checked)
            {
                v_dat_thoi_diem = m_dtp_thoidiem.Value;
            }
            m_us.FillDatase_NhanSu_TheoPhongBan(m_ds, v_str_search, v_dat_thoi_diem, CAppContext_201.getCurrentIDPhapnhan(), v_kiem_nhiem);
            m_fg.Redraw = false;
            CGridUtils.Dataset2C1Grid(m_ds, m_fg, m_obj_trans);
            m_fg.Redraw = true;
            decimal count = 0;

            m_us.count_nhan_vien_theo_phong_ban(m_ds, v_str_search, v_dat_thoi_diem, ref count, CAppContext_201.getCurrentIDPhapnhan(), v_kiem_nhiem);
            m_lbl_so_luong_ban_ghi.Text = CIPConvert.ToStr(count);
            // m_lbl_thong_bao.Text = m_fg.ColumnInfo;
        }
        private void load_data_2_grid()
        {
            m_ds        = new DS_V_GD_CONG_TAC();
            m_fg.Redraw = false;
            var v_id_phap_nhan = CAppContext_201.getCurrentIDPhapnhan();
            var v_str_search   = m_txt_tim_kiem.Text.Trim();

            if (v_str_search == m_str_suggest)
            {
                v_str_search = "";
            }

            m_us.FillDatasetSearch(m_ds,
                                   v_str_search,
                                   m_dat_tu_ngay.Value,
                                   m_dat_den_ngay.Value,
                                   m_cbo_tim_kiem_theo.SelectedIndex,
                                   v_id_phap_nhan);

            CGridUtils.Dataset2C1Grid(m_ds, m_fg, m_obj_trans);
            m_fg.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.Count // chỗ này dùng hàm count tức là để đếm, có thể dùng các hàm khác thay thế
                          , 0
                          , (int)e_col_Number.MA_QUYET_DINH     // chỗ này là tên trường mà mình nhóm
                          , (int)e_col_Number.MA_NV             // chỗ này là tên trường mà mình Count
                          , "{0}"
                          );
            m_lbl_total_record.Text = string.Format("Có {0} bản ghi", m_ds.V_GD_CONG_TAC.Rows.Count);
            m_fg.Focus();
            m_fg.Redraw = true;

            auto_suggest_text();
        }
        private void form_2_us_object()
        {
            m_us.strMA_HOP_DONG         = m_txt_ma_hop_dong.Text.Trim();
            m_us.dcID_LOAI_HOP_DONG     = (decimal)m_cbo_loai_hop_dong.SelectedValue;
            m_us.dcID_PHAP_NHAN         = CAppContext_201.getCurrentIDPhapnhan();
            m_us.datNGAY_CO_HIEU_LUC    = m_dat_ngay_co_hieu_luc.Value;
            m_us.strTRANG_THAI_HOP_DONG = m_cbo_trang_thai.SelectedIndex.Equals(0) ? "Y" : "N";
            m_us.strNGUOI_KY            = m_txt_nguoi_ky.Text.Trim();
            m_us.strCHUC_VU_NGUOI_KY    = m_txt_chuc_vu_nguoi_ky.Text.Trim();
            m_us.datNGAY_KY_HOP_DONG    = m_dat_ngay_ky_hop_dong.Value;

            if (m_us_dm_nhan_su.dcID == -1)
            {
                DS_DM_NHAN_SU m_ds_dm_nhan_su = new DS_DM_NHAN_SU();
                m_us_dm_nhan_su.FillDataset_search_by_ma_nv(m_ds_dm_nhan_su, m_lbl_ma_nhan_vien.Text);
                m_us.dcID_NHAN_SU = (decimal)m_ds_dm_nhan_su.Tables[0].Rows[0].ItemArray[0];
            }
            else
            {
                m_us.dcID_NHAN_SU = m_us_dm_nhan_su.dcID;
            }


            if (m_dat_ngay_het_han.Checked == false)
            {
                m_us.SetNGAY_HET_HANNull();
            }
            else
            {
                m_us.datNGAY_HET_HAN = m_dat_ngay_het_han.Value;
            }

            m_us.strLINK = m_lbl_file_name.Text;
        }
        private void load_data_2_grid()
        {
            m_ds = new DS_V_DM_NHAN_SU_DU_AN();
            var v_str_search = m_txt_tim_kiem.Text.Trim();

            if (v_str_search == M_STR_SUGGESTION)
            {
                v_str_search = "";
            }

            m_us.FillDatasetTuNgayDenNgay(
                m_ds,
                v_str_search,
                DateTime.Parse(m_dat_tu_ngay.Value.ToShortDateString()),
                DateTime.Parse(m_dat_den_ngay.Value.ToShortDateString()),
                m_cbo_tim_kiem_theo_ngay.SelectedIndex,
                CAppContext_201.getCurrentIDPhapnhan());

            m_fg.Redraw = false;
            CGridUtils.Dataset2C1Grid(m_ds, m_fg, m_obj_trans);
            m_fg.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.Count // chỗ này dùng hàm count tức là để đếm, có thể dùng các hàm khác thay thế
                          , 0
                          , (int)e_col_Number.MA_DU_AN          // chỗ này là tên trường mà mình nhóm
                          , (int)e_col_Number.TEN               // chỗ này là tên trường mà mình Count
                          , "{0}"
                          );
            m_fg.Cols[(int)e_col_Number.MA_DU_AN].Visible = false;
            m_fg.Redraw             = true;
            m_lbl_count_record.Text = string.Format("Có {0} bản ghi", m_ds.Tables[0].Rows.Count);
        }
示例#6
0
        private static void set_control_visible(Control v_c, String str_findControl, bool TU_visible, bool TE_visible, bool TEG_visible)
        {
            int i_id_phap_nhan = (int)CAppContext_201.getCurrentIDPhapnhan();

            if (v_c.Name == str_findControl)
            {
                switch (i_id_phap_nhan)
                {
                case (int)PHAP_NHAN.TU:
                    v_c.Visible = TU_visible;

                    break;

                case (int)PHAP_NHAN.TE:
                    v_c.Visible = TE_visible;
                    break;

                case (int)PHAP_NHAN.TEG:
                    v_c.Visible = TEG_visible;
                    break;

                default:
                    break;
                }
            }
            else
            {
                foreach (Control subC in v_c.Controls)
                {
                    set_control_visible(subC, str_findControl, TU_visible, TE_visible, TEG_visible);
                }
            }
        }
        private void load_data_2_grid()
        {
            m_ds = new DS_V_GD_QUYET_DINH();
            if (m_txt_tim_kiem.Text.Trim() == m_str_tim_kiem || m_txt_tim_kiem.Text.Trim() == "")
            {
                m_us.FillDatasetSearch(m_ds, "",
                                       CIPConvert.ToDecimal(m_cbo_loai_quyet_dinh.SelectedValue.ToString()),
                                       CIPConvert.ToDecimal(m_cbo_tim_kiem_theo.SelectedValue.ToString()),
                                       m_dat_tu_ngay.Value,
                                       m_dat_den_ngay.Value,
                                       CAppContext_201.getCurrentIDPhapnhan());
            }
            else
            {
                m_us.FillDatasetSearch(m_ds, m_txt_tim_kiem.Text.Trim(),
                                       CIPConvert.ToDecimal(m_cbo_loai_quyet_dinh.SelectedValue.ToString()),
                                       CIPConvert.ToDecimal(m_cbo_tim_kiem_theo.SelectedValue.ToString()),
                                       m_dat_tu_ngay.Value,
                                       m_dat_den_ngay.Value,
                                       CAppContext_201.getCurrentIDPhapnhan());
            }
            // m_us.FillDataset(m_ds);
            m_fg.Redraw = false;
            CGridUtils.Dataset2C1Grid(m_ds, m_fg, m_obj_trans);
            m_fg.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.Count // chỗ này dùng hàm count tức là để đếm, có thể dùng các hàm khác thay thế
                          , 0
                          , (int)e_col_Number.LOAI_QUYET_DINH   // chỗ này là tên trường mà mình nhóm
                          , (int)e_col_Number.MA_QUYET_DINH     // chỗ này là tên trường mà mình Count
                          , "{0}"
                          );

            m_fg.Redraw             = true;
            m_lbl_total_record.Text = string.Format("Có {0} bản ghi", m_ds.V_GD_QUYET_DINH.Rows.Count);
            load_custom_source_2_m_txt_tim_kiem();
        }
示例#8
0
        private void load_data_2_grid()
        {
            m_ds = new DS_V_GD_BAO_CAO_DU_AN_2();

            var v_str_search = m_txt_tim_kiem.Text.Trim();

            if (v_str_search == m_str_suggest)
            {
                v_str_search = "";
            }

            if (m_cbo_tim_kiem_theo_ngay.SelectedIndex == -1)
            {
                m_us.FillDataset(m_ds);
                m_fg.Redraw = false;
                CGridUtils.Dataset2C1Grid(m_ds, m_fg, m_obj_trans);
                m_fg.Redraw = true;
                m_lbl_total_record_grid1.Text = string.Format("Có {0} dự án", m_ds.Tables[0].Rows.Count);
                return;
            }
            m_us.FillDatasetSearch(m_ds,
                                   v_str_search,
                                   m_dat_tu_ngay.Value,
                                   m_dat_den_ngay.Value,
                                   decimal.Parse(m_cbo_trang_thai.SelectedValue.ToString()),
                                   decimal.Parse(m_cbo_loai_du_an.SelectedValue.ToString()),
                                   decimal.Parse(m_cbo_co_che.SelectedValue.ToString()),
                                   m_cbo_tim_kiem_theo_ngay.SelectedIndex,
                                   CAppContext_201.getCurrentIDPhapnhan());

            m_fg.Redraw = false;
            CGridUtils.Dataset2C1Grid(m_ds, m_fg, m_obj_trans);
            m_fg.Redraw = true;
            m_lbl_total_record_grid1.Text = string.Format("Có {0} dự án", m_ds.Tables[0].Rows.Count);
        }
示例#9
0
        private void load_data_2_grid()
        {
            m_v_ds = new DS_V_DM_QUYET_DINH();
            if (m_txt_tim_kiem.Text.Trim() == m_str_tim_kiem || m_txt_tim_kiem.Text.Trim() == "")
            {
                m_v_us.FillDatasetSearch(m_v_ds, "", m_dc_loai_quyet_dinh, CAppContext_201.getCurrentIDPhapnhan());
            }
            else
            {
                m_v_us.FillDatasetSearch(m_v_ds, m_txt_tim_kiem.Text.Trim(), m_dc_loai_quyet_dinh, CAppContext_201.getCurrentIDPhapnhan());
            }
            //m_us.FillDataset(m_ds);
            var v_str_search = m_txt_tim_kiem.Text.Trim();

            if (v_str_search.Equals(m_str_tim_kiem))
            {
                v_str_search = "";
            }
            m_grv_dm_quyet_dinh.Redraw = false;
            CGridUtils.Dataset2C1Grid(m_v_ds, m_grv_dm_quyet_dinh, m_obj_trans);
            m_grv_dm_quyet_dinh.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.Count // chỗ này dùng hàm count tức là để đếm, có thể dùng các hàm khác thay thế
                                         , 0
                                         , (int)e_col_Number.TEN               // chỗ này là tên trường mà mình nhóm
                                         , (int)e_col_Number.MA_QUYET_DINH     // chỗ này là tên trường mà mình Count
                                         , "{0}"
                                         );

            m_grv_dm_quyet_dinh.Redraw = true;
            set_search_format_before();
        }
 private void load_data_2_grid()
 {
     m_ds = new DS_RPT_NHAN_SU_PERFECT();
     m_us.FillDataset(m_ds, CAppContext_201.getCurrentIDPhapnhan(), m_dat_thoi_diem.Value.Date);
     m_fg.Redraw = false;
     CGridUtils.Dataset2C1Grid(m_ds, m_fg, m_obj_trans);
     m_fg.Redraw = true;
 }
示例#11
0
        private void load_data_2_cbo_don_vi_cap_tren()
        {
            var v_ds = new DS_V_DM_DON_VI();
            var v_us = new US_V_DM_DON_VI();

            v_us.FillDatasetByCapDonVi(v_ds, 0, CAppContext_201.getCurrentIDPhapnhan());
            m_cbo_ten_don_vi_cap_tren.DisplayMember = DM_DON_VI.MA_DON_VI;
            m_cbo_ten_don_vi_cap_tren.ValueMember   = DM_DON_VI.ID;
            m_cbo_ten_don_vi_cap_tren.DataSource    = v_ds.V_DM_DON_VI;
            var v_row = v_ds.V_DM_DON_VI.NewRow();

            v_row[V_DM_DON_VI.ID]                            = -1;
            v_row[V_DM_DON_VI.ID_CAP_DON_VI]                 = 0;
            v_row[V_DM_DON_VI.ID_DON_VI_CAP_TREN]            = -1;
            v_row[V_DM_DON_VI.ID_LOAI_DON_VI]                = -1;
            v_row[V_DM_DON_VI.MA_DON_VI]                     = "KHONG_CO";
            v_row[V_DM_DON_VI.TEN_DON_VI]                    = "Không có đơn vị cấp trên";
            v_row[V_DM_DON_VI.TEN_TIENG_ANH]                 = "NULL";
            v_row[V_DM_DON_VI.TRANG_THAI]                    = "Y";
            v_row[V_DM_DON_VI.TU_NGAY]                       = "1/1/1800";
            v_row[V_DM_DON_VI.DIA_BAN]                       = "NULL";
            v_row[V_DM_DON_VI.LOAI_DON_VI]                   = "NULL";
            v_row[V_DM_DON_VI.MA_DON_VI_CAP_TREN]            = "NULL";
            v_row[V_DM_DON_VI.TEN_TIENG_ANH_DON_VI_CAP_TREN] = "NULL";
            v_row[V_DM_DON_VI.CAP_DON_VI]                    = "NULL";
            v_ds.V_DM_DON_VI.Rows.InsertAt(v_row, 0);

            switch (m_cbo_cap_don_vi.SelectedIndex)
            {
            case 0:     // Tổ Hợp
                m_cbo_ten_don_vi_cap_tren.SelectedIndex = 0;
                m_cbo_ten_don_vi_cap_tren.Enabled       = false;
                v_us.FillDatasetByCapDonVi(v_ds, 0, CAppContext_201.getCurrentIDPhapnhan());
                break;

            case 1:     // Công ty
                v_us.FillDatasetByCapDonVi(v_ds, 1, CAppContext_201.getCurrentIDPhapnhan());
                m_cbo_ten_don_vi_cap_tren.Enabled = true;
                break;

            case 2:     // Khối
                v_us.FillDatasetByCapDonVi(v_ds, 2, CAppContext_201.getCurrentIDPhapnhan());
                m_cbo_ten_don_vi_cap_tren.Enabled = true;
                break;

            case 3:     // Trung Tâm
                v_us.FillDatasetByCapDonVi(v_ds, 3, CAppContext_201.getCurrentIDPhapnhan());
                m_cbo_ten_don_vi_cap_tren.Enabled = true;
                break;

            default:
                v_us.FillDatasetByCapDonVi(v_ds, 4, CAppContext_201.getCurrentIDPhapnhan());
                m_cbo_ten_don_vi_cap_tren.Enabled = true;
                break;
            }
        }
        private void load_data_2_grid()
        {
            //1.tạo danh sách cột chức vụ
            m_fg.Cols.Count    = m_dat_thoidiem.Value.Month + 1;
            m_fg.Cols[0].Width = 200;
            //m_fg.Cols[1].Caption = "Trạng thái/Chức vụ";
            m_fg.Cols[0].Caption  = "Loại nhân viên";
            m_fg.Cols[0].UserData = 0;
            //m_fg.Cols[1].Style.ForeColor = Color.Black;
            for (int i = 1; i < m_fg.Cols.Count; i++)
            {
                m_fg.Cols[i].Caption  = "Tháng " + i.ToString();
                m_fg.Cols[i].UserData = i;
            }
            //2. tạo danh sách dòng trạng thái
            m_fg.Rows.Count = 5;
            //m_fg.Rows[1][0] = "Tổng";
            //m_fg.Rows[1].UserData = 0;

            m_fg.Rows[1][0]       = "Nhân viên chính thức chưa đủ 6 tháng";
            m_fg.Rows[1].UserData = 1;
            m_fg.Rows[2][0]       = "Nhân viên chính thức đủ 6 tháng";
            m_fg.Rows[2].UserData = 2;
            m_fg.Rows[3][0]       = "Nhân viên thử việc";
            m_fg.Rows[3].UserData = 3;
            m_fg.Rows[4][0]       = "Nhân viên đang nghỉ";
            m_fg.Rows[4].UserData = 4;
            //3.Đưa dữ liệu lên lưới
            m_ds_rpt = new DS_RPT_SO_LUONG_NV_THEO_LOAI();
            m_us_rpt.FillDatasetByProc(m_ds_rpt, m_dat_thoidiem.Value, CAppContext_201.getCurrentIDPhapnhan());


            for (int v_i_cur_col = m_fg.Cols.Fixed; v_i_cur_col < m_fg.Cols.Count; v_i_cur_col++)
            {
                //if((int.Parse(row[1].ToString())) == (int.Parse(m_fg.Cols[u].UserData.ToString())))
                for (int v_i_cur_row = m_fg.Rows.Fixed; v_i_cur_row < m_fg.Rows.Count; v_i_cur_row++)
                {
                    string v_str_thang      = m_fg.Cols[v_i_cur_col].UserData.ToString();
                    string v_str_id_loai_nv = m_fg.Rows[v_i_cur_row].UserData.ToString();


                    DataRow[] v_arr_dr
                        = m_ds_rpt.RPT_SO_LUONG_NV_THEO_LOAI.Select(
                              RPT_SO_LUONG_NV_THEO_LOAI.THANG + "="
                              + v_str_thang
                              + " AND "
                              + RPT_SO_LUONG_NV_THEO_LOAI.LOAI_NV + "="
                              + v_str_id_loai_nv);
                    if (v_arr_dr.Length == 0)
                    {
                        continue;
                    }
                    m_fg[v_i_cur_row, v_i_cur_col] = v_arr_dr[0][RPT_SO_LUONG_NV_THEO_LOAI.SO_LUONG];
                }
            }
        }
示例#13
0
        private void load_data_2_cbo_don_vi_cap_tren()
        {
            var v_ds = new DS_V_DM_DON_VI();
            var v_us = new US_V_DM_DON_VI();

            v_us.Filldataset_by_ID_phap_nhan(v_ds, CAppContext_201.getCurrentIDPhapnhan());
            m_cbo_don_vi.DisplayMember = DM_DON_VI.MA_DON_VI;
            m_cbo_don_vi.ValueMember   = DM_DON_VI.ID;
            m_cbo_don_vi.DataSource    = v_ds.V_DM_DON_VI;
        }
        private void load_data_2_grid()
        {
            m_ds = new DS_RPT_LUONG_DON_VI_THEO_KY();
            m_us.FillDatasetByMaKy(m_ds, m_cbo_ma_ky.Text, CAppContext_201.getCurrentIDPhapnhan());
            m_fg.Redraw = false;
            CGridUtils.Dataset2C1Grid(m_ds, m_fg, m_obj_trans);

            // ComboBox được load có thứ tự index y như DataTable
            update_captions(m_fg, (DataTable)m_cbo_ma_ky.DataSource, m_cbo_ma_ky.SelectedIndex);

            m_fg.Redraw = true;
        }
示例#15
0
        //private const String m_str_goi_y_tim_kiem = "Nhập Mã đơn vị, Họ tên, Mã nhân viên...";
        #endregion

        #region Private Methods

        private void format_controls()
        {
            CControlFormat.setFormStyle(this, new CAppContext_201());
            CControlFormat.setC1FlexFormat(m_fg);
            CGridUtils.AddSave_Excel_Handlers(m_fg);
            CGridUtils.AddSearch_Handlers(m_fg);
            m_fg.Tree.Column     = (int)e_col_Number.MA_DON_VI;
            m_fg.Tree.Style      = TreeStyleFlags.SimpleLeaf;
            m_txt_phap_nhan.Text = CAppContext_201.getCurrentIDPhapnhan().ToString();
            set_define_events();
            KeyPreview = true;
        }
示例#16
0
        private bool trung_ma_don_vi(string ip_str_ma_don_vi)
        {
            var v_ds = new DS_V_DM_DON_VI();
            var v_us = new US_V_DM_DON_VI();

            v_us.FillDatasetByKeyWord(v_ds, ip_str_ma_don_vi, -1, -1, "", CAppContext_201.getCurrentIDPhapnhan());
            decimal v_count = v_ds.V_DM_DON_VI.Count;

            if (v_count > 0)
            {
                return(true);
            }
            return(false);
        }
示例#17
0
        private void load_custom_source_2_m_txt_tim_kiem()
        {
            m_us.FillDataset(m_ds, "WHERE ID_PHAP_NHAN =" + CAppContext_201.getCurrentIDPhapnhan().ToString());
            int count = m_ds.Tables["V_DM_DU_LIEU_NHAN_VIEN"].Rows.Count;
            AutoCompleteStringCollection v_acsc_search = new AutoCompleteStringCollection();

            foreach (DataRow dr in m_ds.V_DM_DU_LIEU_NHAN_VIEN)
            {
                v_acsc_search.Add(dr[V_DM_DU_LIEU_NHAN_VIEN.MA_DON_VI].ToString());
                v_acsc_search.Add(dr[V_DM_DU_LIEU_NHAN_VIEN.HO_DEM].ToString() + " " + dr[V_DM_DU_LIEU_NHAN_VIEN.TEN].ToString());
                v_acsc_search.Add(dr[V_DM_DU_LIEU_NHAN_VIEN.MA_NV].ToString());
            }
            m_txt_tim_kiem.AutoCompleteCustomSource = v_acsc_search;
        }
        private void load_custom_source_2_m_txt_tim_kiem()
        {
            m_us.FillDataset(m_ds, "WHERE ID_PHAP_NHAN =" + CAppContext_201.getCurrentIDPhapnhan().ToString());
            int count = m_ds.Tables["V_GD_QUA_TRINH_LAM_VIEC"].Rows.Count;
            AutoCompleteStringCollection v_acsc_search = new AutoCompleteStringCollection();

            foreach (DataRow dr in m_ds.V_GD_QUA_TRINH_LAM_VIEC)
            {
                v_acsc_search.Add(dr[V_GD_QUA_TRINH_LAM_VIEC.MA_DON_VI].ToString());
                v_acsc_search.Add(dr[V_GD_QUA_TRINH_LAM_VIEC.TEN_DON_VI].ToString());
                //v_acsc_search.Add(dr[V_GD_QUA_TRINH_LAM_VIEC.MA_CV].ToString());
            }
            m_txt_tim_kiem.AutoCompleteCustomSource = v_acsc_search;
        }
        private void load_data_2_grid_search()
        {
            m_ds = new DS_V_GD_TRANG_THAI_LAO_DONG();
            m_us.FillDataset_Search(m_ds, m_txt_tim_kiem.Text.Trim(), CAppContext_201.getCurrentIDPhapnhan());
            m_grv_trang_thai_ld.Redraw = false;
            CGridUtils.Dataset2C1Grid(m_ds, m_grv_trang_thai_ld, m_obj_trans);
            m_grv_trang_thai_ld.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.Count   // chỗ này dùng hàm count tức là để đếm, có thể dùng các hàm khác thay thế
                                         , 0
                                         , (int)e_col_Number.MA_NV               // chỗ này là tên trường mà mình nhóm
                                         , (int)e_col_Number.TRANG_THAI_LAO_DONG // chỗ này là tên trường mà mình Count
                                         , "{0}"
                                         );

            m_grv_trang_thai_ld.Redraw = true;
        }
        private void load_data_2_grid()
        {
            //Lay ngay dau nam
            string   v_str_dau_nam = "01/01/" + m_dat_nam.Value.Year;
            DateTime v_dat         = CIPConvert.ToDatetime(v_str_dau_nam);

            m_ds = new DS_RPT_LUONG_THEO_QD();
            m_us.FillDatasetByProc(m_ds, v_dat, CAppContext_201.getCurrentIDPhapnhan());
            m_fg.Redraw = false;
            CGridUtils.Dataset2C1Grid(m_ds, m_fg, m_obj_trans);
            m_fg.Redraw = true;

            wrap_text_all_cells();
            CGridUtils.MakeSoTT(0, m_fg);
        }
        private void load_data_2_us_gd_luong_theo_qd()
        {
            m_us_v_gd_luong_theo_qd.dcLUONG              = m_num_luong.Value;
            m_us_v_gd_luong_theo_qd.datNGAY_AP_DUNG      = m_dat_ngay_ap_dung.Value.Date;
            m_us_v_gd_luong_theo_qd.dcTHANG_AP_DUNG      = m_dat_ngay_ap_dung.Value.Month;
            m_us_v_gd_luong_theo_qd.dcNAM_AP_DUNG        = m_dat_ngay_ap_dung.Value.Year;
            m_us_v_gd_luong_theo_qd.strLUONG_HIEN_TAI_YN = m_ckb_luong_hien_tai.Checked ? "Y" : "N";

            m_us_v_gd_luong_theo_qd.strMA_KY = m_txt_ky.Text;
            m_us_v_gd_luong_theo_qd.strMA_NV = get_ma_nv_from(m_txt_nhan_vien.Text, '-');


            m_us_v_gd_luong_theo_qd.strMA_QD = m_txt_ma_quyet_dinh.Text;

            m_us_v_gd_luong_theo_qd.dcID_PHAP_NHAN = CAppContext_201.getCurrentIDPhapnhan();
        }
示例#22
0
        private void load_data_2_grid_ds(eDetailMode ip_e_detail_mode)
        {
            var     v_str_search = m_fg.Rows[m_fg.Row][(int)e_col_Number.NGACH].ToString();
            decimal v_dc_id_ttld = decimal.Parse(m_fg.Rows[m_fg.Row][(int)e_col_Number.ID_TTLD].ToString());
            decimal v_dc_id_cv   = decimal.Parse(m_fg.Rows[m_fg.Row][(int)e_col_Number.ID_CV].ToString());

            m_ds_ds = new DS_V_DM_DU_LIEU_NHAN_VIEN();

            switch (ip_e_detail_mode)
            {
            case eDetailMode.TANG:
                m_us_ds.FillDatasetNVNghiviec(
                    m_ds_ds
                    , v_str_search
                    , m_dat_tu_ngay.Value.Date
                    , m_dat_den_ngay.Value.Date
                    , v_dc_id_ttld
                    , CAppContext_201.getCurrentIDPhapnhan()
                    , decimal.Parse(m_cbo_don_vi.SelectedValue.ToString())
                    , v_dc_id_cv);

                break;

            case eDetailMode.GIAM:
                m_us_ds.FillDatasetNVNghiviec_2(
                    m_ds_ds
                    , v_str_search
                    , m_dat_tu_ngay.Value.Date
                    , m_dat_den_ngay.Value.Date
                    , v_dc_id_ttld
                    , CAppContext_201.getCurrentIDPhapnhan()
                    , decimal.Parse(m_cbo_don_vi.SelectedValue.ToString())
                    , v_dc_id_cv);

                break;

            default:
                break;
            }


            m_fg_danh_sach.Redraw = false;
            CGridUtils.Dataset2C1Grid(m_ds_ds, m_fg_danh_sach, m_obj_trans_ds);
            m_fg_danh_sach.Redraw = true;
            m_lbl_soluongns.Text  = m_ds_ds.V_DM_DU_LIEU_NHAN_VIEN.Count.ToString();
            //m_fg_danh_sach.Subtotal(AggregateEnum.Count, 0, -1, (int)e_col_Number_ds.MA_CV);
        }
        private void load_custom_source_2_m_txt_don_vi()
        {
            //  int count = m_ds_qua_trinh_lam_viec.Tables["V_GD_QUA_TRINH_LAM_VIEC"].Rows.Count;
            AutoCompleteStringCollection v_acsc_search = new AutoCompleteStringCollection();
            US_V_DM_DON_VI v_us = new US_V_DM_DON_VI();
            DS_V_DM_DON_VI v_ds = new DS_V_DM_DON_VI();

            v_us.Filldataset_by_ID_phap_nhan(v_ds, CAppContext_201.getCurrentIDPhapnhan());
            foreach (DataRow dr in v_ds.V_DM_DON_VI)
            {
                v_acsc_search.Add(dr[V_DM_DON_VI.MA_DON_VI].ToString());
            }

            m_txt_don_vi_moi.AutoCompleteMode         = AutoCompleteMode.Suggest;
            m_txt_don_vi_moi.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            m_txt_don_vi_moi.AutoCompleteCustomSource = v_acsc_search;
        }
        private void tao_dong_don_vi_grid_don_vi()
        {
            DS_V_DM_DON_VI v_ds_v_dm_don_vi = new DS_V_DM_DON_VI();
            US_V_DM_DON_VI v_us_v_dm_don_vi = new US_V_DM_DON_VI();

            v_us_v_dm_don_vi.FillDatasetByKeyWord(v_ds_v_dm_don_vi, "Y", CAppContext_201.getCurrentIDPhapnhan());
            int v_minID_LEVEL = int.Parse(v_ds_v_dm_don_vi.V_DM_DON_VI.Compute("Min(ID_LEVEL)", "").ToString());

            DataRow[] v_dr = v_ds_v_dm_don_vi.V_DM_DON_VI.Select(V_DM_DON_VI.ID_LEVEL + "=" + v_minID_LEVEL.ToString());
            if (v_dr.Length == 0)
            {
                return;
            }
            CGridUtils.ClearDataInGrid(m_fg_donvi);
            v_us_v_dm_don_vi.DataRow2Me(v_dr[0]);
            m_fg_donvi.Rows.Count += 1;
            int v_i_root_row = m_fg_donvi.Rows.Count - 1;

            //m_fg.Rows.Count = m_ds_1.V_DM_DON_VI.Rows.Count + 1;
            //int v_i_root_row = 1;
            m_fg_donvi.Rows[v_i_root_row].IsNode     = true;
            m_fg_donvi.Rows[v_i_root_row].Node.Level = int.Parse(v_us_v_dm_don_vi.dcID_LEVEL.ToString());
            switch (m_fg_donvi.Rows[v_i_root_row].Node.Level)
            {
            case 0:
                m_fg_donvi.Rows[v_i_root_row].Style = m_fg_donvi.Styles[CellStyleEnum.Subtotal0];
                break;

            case 1:
                m_fg_donvi.Rows[v_i_root_row].Style = m_fg_donvi.Styles[CellStyleEnum.Subtotal1];
                break;

            case 2:
                m_fg_donvi.Rows[v_i_root_row].Style = m_fg_donvi.Styles[CellStyleEnum.Subtotal2];
                break;

            case 3:
                m_fg_donvi.Rows[v_i_root_row].Style = m_fg_donvi.Styles[CellStyleEnum.Subtotal3];
                break;
            }
            m_fg_donvi.Rows[1][1]       = v_us_v_dm_don_vi.strMA_DON_VI_CAP_TREN;
            m_fg_donvi.Rows[1][2]       = v_us_v_dm_don_vi.strMA_DON_VI;
            m_fg_donvi.Rows[1].UserData = v_us_v_dm_don_vi.dcID;
            insert_all_child_of_node(v_i_root_row, v_ds_v_dm_don_vi);
        }
示例#25
0
        private void load_data_2_grid()
        {
            m_ds_qua_trinh_lam_viec = new DS_V_GD_QUA_TRINH_LAM_VIEC();
            m_us_qua_trinh_lam_viec.FillDataset_search(m_ds_qua_trinh_lam_viec, "", CAppContext_201.getCurrentIDPhapnhan());
            m_grv_qua_trinh_lam_viec.Redraw = false;

            CGridUtils.Dataset2C1Grid(m_ds_qua_trinh_lam_viec, m_grv_qua_trinh_lam_viec, m_obj_trans);
            m_grv_qua_trinh_lam_viec.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.None // chỗ này dùng hàm count tức là để đếm, có thể dùng các hàm khác thay thế
                                              , 0
                                              , (int)e_col_Number.MA_NV            // chỗ này là tên trường mà mình nhóm
                                              , (int)e_col_Number.TEN_CV           // chỗ này là tên trường mà mình Count
                                              , "{0}"
                                              );
            m_grv_qua_trinh_lam_viec.Redraw = true;

            m_us_qua_trinh_lam_viec.Count_Nhan_vien(ref tong_so, ref hien_tai);
            m_lbl_so_nhan_vien.Text = hien_tai.ToString() + "/" + tong_so.ToString();
        }
        private void text_changed()
        {
            US_V_DM_DON_VI v_us = new US_V_DM_DON_VI();
            DS_V_DM_DON_VI v_ds = new DS_V_DM_DON_VI();

            v_us.FillDataset_search_by_ma_dv(v_ds, m_txt_don_vi_moi.Text.Trim(), CAppContext_201.getCurrentIDPhapnhan());
            if (v_ds.V_DM_DON_VI.Count == 0)
            {
                //  BaseMessages.MsgBox_Error("Mã đơn vị không hợp lệ.");
            }
            else
            {
                if (v_ds.V_DM_DON_VI.Count == 1)
                {
                    v_us.DataRow2Me((DataRow)v_ds.V_DM_DON_VI.Rows[0]);
                    m_us_dm_don_vi = new US_DM_DON_VI(v_us.dcID);
                    m_txt_ma_don_vi_cap_tren.Text = v_us.strMA_DON_VI_CAP_TREN;
                }
            }
        }
示例#27
0
        private void form_to_us_object_v_trang_thai_ld()
        {
            //m_us_trang_thai_ld.dcID = m_us_v_trang_thai_ld.dcID;
            //m_us_trang_thai_ld.dcID_NHAN_SU = m_us_v_trang_thai_ld.dcID_NHAN_SU;
            if (m_us_v_trang_thai_ld.dcID == 0)
            {
                DS_DM_NHAN_SU v_ds_dm_nhan_su = new DS_DM_NHAN_SU();
                US_DM_NHAN_SU v_us_dm_nhan_su = new US_DM_NHAN_SU();
                v_us_dm_nhan_su.FillDataset_search_by_ma_nv(v_ds_dm_nhan_su, m_txt_ma_nv.Text);
                m_us_v_trang_thai_ld.dcID_NHAN_SU = (decimal)v_ds_dm_nhan_su.Tables[0].Rows[0].ItemArray[0];
            }
            m_us_v_trang_thai_ld.dcID_PHAP_NHAN      = CAppContext_201.getCurrentIDPhapnhan();
            m_us_v_trang_thai_ld.dcID_TRANG_LAO_DONG = CIPConvert.ToDecimal(m_cbo_trang_thai_moi.SelectedValue);
            if (m_txt_ma_quyet_dinh.Text.Trim() != "")
            {
                m_us_v_trang_thai_ld.dcID_QUYET_DINH = m_us_quyet_dinh.dcID;
            }
            else
            {
                m_us_v_trang_thai_ld.SetID_QUYET_DINHNull();
            }
            m_us_v_trang_thai_ld.datNGAY_CO_HIEU_LUC = m_dat_ngay_co_hieu_luc.Value;

            if (m_dat_ngay_het_hieu_luc.Checked)
            {
                m_us_v_trang_thai_ld.datNGAY_HET_HIEU_LUC = m_dat_ngay_het_hieu_luc.Value;
            }
            else
            {
                m_us_v_trang_thai_ld.SetNGAY_HET_HIEU_LUCNull();
            }
            if (m_ckb_trang_thai_hien_tai_yn.Checked == true)
            {
                m_us_v_trang_thai_ld.strTRANG_THAI_HIEN_TAI = "Y";
            }
            else
            {
                m_us_v_trang_thai_ld.strTRANG_THAI_HIEN_TAI = "N";
            }
        }
示例#28
0
        public int count_record_du_an_sap_ket_thuc()
        {
            int result = 0;
            DS_V_DM_DU_AN_QUYET_DINH_TU_DIEN v_ds = new DS_V_DM_DU_AN_QUYET_DINH_TU_DIEN();
            US_V_DM_DU_AN_QUYET_DINH_TU_DIEN v_us = new US_V_DM_DU_AN_QUYET_DINH_TU_DIEN();

            v_us.FillDatasetSearch(v_ds,
                                   1,
                                   "",
                                   m_dat_tu_ngay.Value,
                                   DateTime.Now,
                                   -1,
                                   -1,
                                   -1,
                                   0,
                                   CAppContext_201.getCurrentIDPhapnhan(),
                                   (decimal)e_tu_dien.QĐ_THANH_LAP_DU_AN);
            if (v_ds.Tables[0].Rows.Count > 0)
            {
                result = v_ds.Tables[0].Rows.Count;
            }
            return(result);
        }
示例#29
0
        private void load_custom_source_2_m_txt_don_vi()
        {
            m_txt_don_vi.AutoCompleteMode   = AutoCompleteMode.Suggest;
            m_txt_don_vi.AutoCompleteSource = AutoCompleteSource.CustomSource;
            var v_coll = new AutoCompleteStringCollection();

            m_us_don_vi.FillDataset(m_ds_don_vi, "WHERE ID_PHAP_NHAN =" + CAppContext_201.getCurrentIDPhapnhan().ToString());
            var v_rows = m_ds_don_vi.Tables[0].Rows;

            for (var i = 0; i < v_rows.Count - 1; i++)
            {
                //v_coll.Add(v_rows[i][V_GD_QUA_TRINH_LAM_VIEC_2.HO_DEM] + " " + v_rows[i][V_GD_QUA_TRINH_LAM_VIEC_2.TEN]);
                //v_coll.Add(v_rows[i][V_GD_QUA_TRINH_LAM_VIEC_2.TEN] + "");
                v_coll.Add(v_rows[i][V_DM_DON_VI.MA_DON_VI] + "");
                //v_coll.Add(v_rows[i][V_GD_QUA_TRINH_LAM_VIEC_2.MA_NV] + "");
                //v_coll.Add(v_rows[i][V_GD_QUA_TRINH_LAM_VIEC_2.MA_DON_VI] + " - " + v_rows[i][V_GD_QUA_TRINH_LAM_VIEC_2.TEN_DON_VI]);
                //v_coll.Add(v_rows[i][V_GD_QUA_TRINH_LAM_VIEC_2.TEN_DON_VI]+" - "+v_rows[i][V_GD_QUA_TRINH_LAM_VIEC_2.MA_DON_VI]);
                //v_coll.Add(v_rows[i][V_GD_QUA_TRINH_LAM_VIEC_2.TEN_CV] + "");
                //v_coll.Add(v_rows[i][V_GD_QUA_TRINH_LAM_VIEC_2.LOAI_DON_VI] + "");
            }

            m_txt_don_vi.AutoCompleteCustomSource = v_coll;
        }
示例#30
0
        public static void setFormat_theo_phap_nhan(Form ip_f)
        {
            int i_id_phap_nhan = (int)CAppContext_201.getCurrentIDPhapnhan();

            switch (ip_f.Name)
            {
            case "f002_main_form":
                #region "f400_Main"
                foreach (Control v_c in ip_f.Controls)
                {
                    // item cua menu strip chua lam duoc
//                         set_control_visible(v_c, "m_menuitem_hopdong", true, true, false);
//                         set_control_visible(v_c, "m_menuitem_bao_cao_hop_dong", true, true, false);
                    set_control_visible(v_c, "panel5", false, false, true);
                    set_control_visible(v_c, "panel4", true, true, false);
                    set_control_visible(v_c, "panel3", true, true, false);
                }
                #endregion
                break;

            case "f201_dm_nhan_su":
                #region "f201_dm_nhan_su"
                foreach (Control v_c in ip_f.Controls)
                {
                    set_control_visible(v_c, "m_cmd_insert", false, false, true);
                    set_control_visible(v_c, "m_cmd_update", false, false, true);
                    set_control_visible(v_c, "m_cmd_delete", false, false, true);
                    set_control_visible(v_c, "m_cmd_chon_phap_nhan", false, false, true);
                    set_control_visible(v_c, "panel5", false, false, false);
                }
                #endregion
                break;

            default:
                break;
            }
        }