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 form_2_us_obj()
 {
     m_us.dcID_NGUOI_ADD           = CAppContext_201.getCurrentUserID();
     m_us.strHO_TEN_CHU_DIEN_THOAI = m_txt_ten_chu_dien_thoai.Text.Trim();
     m_us.strSO_DIEN_THOAI         = m_txt_so_dien_thoai.Text.Trim();
     m_us.strGHI_CHU_LY_DO         = m_txt_ghi_chu_ly_do.Text.Trim();
 }
        private void insert_cau_hoi_moi()
        {
            m_us_cau_hoi = new US_GD_CAU_HOI_HOC_VIEN();
            m_us_cau_hoi.strGHI_CHU_LICH_HEN    = m_txt_ghi_chu_hen.Text;
            m_us_cau_hoi.strGHI_CHU_Y_KIEN_KHAC = m_txt_y_kien_khac.Text;
            m_us_cau_hoi.strNOI_DUNG_CAU_HOI    = m_txt_cau_hoi.Text;
            m_us_cau_hoi.strNOI_DUNG_TRA_LOI    = m_rtb_cau_tra_loi.Text;
            if (CValidateTextBox.IsValid(m_dat_ngay_hen_goi_lai, DataType.DateType, allowNull.YES) &&
                m_dat_ngay_hen_goi_lai.Text.Trim() != "")
            {
                m_us_cau_hoi.datTHOI_DIEM_HEN_GOI_LAI = CIPConvert.ToDatetime(m_dat_ngay_hen_goi_lai.Value);
            }
            m_us_cau_hoi.dcID_CAU_HOI       = m_us_v_cau_hoi.dcID;
            m_us_cau_hoi.dcID_DANH_GIA      = CIPConvert.ToDecimal(m_cbo_danh_gia_tra_loi.SelectedValue);
            m_us_cau_hoi.dcID_LOAI_CAU_HOI  = CIPConvert.ToDecimal(m_cbo_loai_cau_hoi_duoi.SelectedValue);
            m_us_cau_hoi.dcID_NGUOI_TRA_LOI = CAppContext_201.getCurrentUserID();
            m_us_cau_hoi.dcID_TRANG_THAI    = CIPConvert.ToDecimal(m_cbo_trang_thai_cau_hoi.SelectedValue);
            m_us_cau_hoi.dcID_YEU_CAU       = m_us_cuoc_goi.dcID;
            //

            m_us_cau_hoi.Insert();

            //
            if (CIPConvert.ToDecimal(m_cbo_trang_thai_cau_hoi.SelectedValue) == TU_DIEN_TRANG_THAI_GD_CAU_HOI_SV.CHO_TRA_LOI)
            {
                m_dc_id_trang_thai_cuoc_goi = TU_DIEN_TRANG_THAI_DON_HANG.DANG_CHO_GQ;
            }
            m_bl_luu_cau_hoi = true;
            BaseMessages.MsgBox_Infor("Đã lưu câu hỏi trên thành công. Nếu không còn câu hỏi nào nữa, hãy bấm \"End Call\"");
        }
        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()
        {
            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 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();
        }
        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 remove_v_dm_black_list()
        {
            if (!HelpUtils.is_validated_edit_grid_row(m_fg.Row, m_fg))
            {
                return;
            }
            if (!BaseMessages.MsgBox_Confirm(THONG_BAO.CF_REMOVE_BLACKLIST))
            {
                return;
            }
            US_V_DM_BLACK_LIST v_us = new US_V_DM_BLACK_LIST();

            grid2us_object(v_us, m_fg.Row);
            try {
                v_us.BeginTransaction();
                CAddRemoveBlackListData v_add_bl_data = new CAddRemoveBlackListData();
                v_add_bl_data = CallCenterUtils.add_remove_blacklist(v_us.strSO_DIEN_THOAI, 20);
                if (v_add_bl_data.Status == TRANG_THAI_GOI_WS.THAT_BAI)
                {
                    BaseMessages.MsgBox_Infor(THONG_BAO.ER_REMOVE_BLACKLIST_KO_THANH_CONG);
                    HelpUtils.ghi_log_he_thong(LOG_TRUY_CAP.REMOVE_BLACKLIST, "BLACK_LIST", "Remove blacklist: " + m_us.strSO_DIEN_THOAI, "Error");
                    return;
                }
                v_us.dcID_NGUOI_REMOVE = CAppContext_201.getCurrentUserID();
                v_us.Update();
                HelpUtils.ghi_log_he_thong(LOG_TRUY_CAP.REMOVE_BLACKLIST, "BLACK_LIST", "Remove blacklist: " + m_us.strSO_DIEN_THOAI, "Remove");
                BaseMessages.MsgBox_Infor(THONG_BAO.SC_REMOVE_BLACKLIST_THANH_CONG);
                v_us.CommitTransaction();
                load_data_2_grid();
            }
            catch (Exception v_e) {
                v_us.Rollback();
                CSystemLog_100.ExceptionHandle(v_e);
            }
        }
        private void update_info_cuoc_goi()
        {
            CallInfor v_call_info = new CallInfor();

            v_call_info = HelpUtils.get_call_infor(m_us_cuoc_goi.strCALL_ID
                                                   , m_txt_dien_thoai.Text
                                                   , f002_main_form.m_str_stationId
                                                   , CAppContext_201.getCurrentUserName());
            m_us_cuoc_goi.strERROR_CODE = v_call_info.error_code;
            m_us_cuoc_goi.strERROR_DESC = v_call_info.error_desc;
            //m_us_cuoc_goi.strNOI_DUNG_TRAO_DOI = ???
            m_us_cuoc_goi.strSTATUS           = v_call_info.status;
            m_us_cuoc_goi.strVOICE_CALL_LINK  = v_call_info.link_down_record;
            m_us_cuoc_goi.datDATETIME_RESPOND = HelpUtils.string_2_datetime(v_call_info.datetime_response);
            m_us_cuoc_goi.datEND_TIME         = HelpUtils.string_2_datetime(v_call_info.end_time);
            m_us_cuoc_goi.datSTART_TIME       = HelpUtils.string_2_datetime(v_call_info.start_time);
            m_us_cuoc_goi.dcDURATION          = CIPConvert.ToDecimal(v_call_info.duration);
            m_us_cuoc_goi.dcRINGTIME          = CIPConvert.ToDecimal(v_call_info.ringtime);

            m_us_cuoc_goi.BeginTransaction();
            m_us_cuoc_goi.Update();
            m_us_cuoc_goi.CommitTransaction();

            BaseMessages.MsgBox_Infor("Đã lưu thông tin cuộc gọi thành công");
        }
        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);
        }
Esempio n. 11
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();
        }
Esempio n. 12
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);
        }
Esempio n. 13
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_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;
 }
Esempio n. 15
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];
                }
            }
        }
Esempio n. 17
0
        private void show_change_password()
        {
            string v_str_ten_truy_cap = CAppContext_201.getCurrentUserName();
            US_HT_NGUOI_SU_DUNG v_us_ht_nguoi_dung = new US_HT_NGUOI_SU_DUNG();

            v_us_ht_nguoi_dung.InitByTenTruyCap(v_str_ten_truy_cap);
            f998_ht_nguoi_su_dung_de v_f998_change_password = new f998_ht_nguoi_su_dung_de();

            v_f998_change_password.change_password(v_us_ht_nguoi_dung, "Y", "Y");
        }
Esempio n. 18
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;
        }
Esempio n. 20
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;
        }
Esempio n. 21
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);
        }
Esempio n. 22
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;
        }
Esempio n. 24
0
 private void set_inital_form_load()
 {
     load_cbo_truong();
     load_cbo_truong_sinh_vien();
     load_data_2_cbo_don_vi_noi_bo();
     load_data_2_cbo_nguoi_dai_dien();
     load_thong_tin_cau_hoi();
     m_obj_trans             = get_trans_object(m_fg);
     m_obj_trans_tab1_assign = get_trans_object_tab1_assign(m_fg_tab1_assign);
     load_data_2_grid();
     load_data_2_grid_tab1_assign();
     m_str_stationcode = m_us_dm_user_station.get_station_id_by_user(CAppContext_201.getCurrentUserID());
     m_txt_email_qlht.AutoCompleteCustomSource = load_thong_tin_email_qlht_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);
        }
Esempio n. 27
0
        private void form_2_usobject()
        {
            switch (m_e_form_mode)
            {
            // thêm câu hỏi bắt buộc phải thêm câu trả lời
            case e_form_mode.THEM_CAU_HOI:
                m_us_dm_cau_hoi.dcID_TO_CHUC                = CIPConvert.ToDecimal(m_cbo_don_vi_truong.SelectedValue);
                m_us_dm_cau_hoi.dcID_NHOM_CAU_HOI           = CIPConvert.ToDecimal(m_cbo_nhom_cau_hoi.SelectedValue);
                m_us_dm_cau_hoi.strNOI_DUNG_CAU_HOI         = m_txt_noi_dung_cau_hoi.Text.Trim();
                m_us_dm_cau_hoi.strCAU_TRA_LOI              = m_txt_cau_tra_loi.Text;
                m_us_dm_cau_hoi.datNGAY_TAO                 = m_dat_ngay_tao.Value;
                m_us_dm_cau_hoi.dcNGUOI_TAO                 = CAppContext_201.getCurrentUserID();
                m_us_dm_cau_hoi.dcID_TRANG_THAI_CAU_TRA_LOI = CIPConvert.ToDecimal(m_cbo_trang_thai_cau_tra_loi.SelectedValue);
                if (m_txt_link_tai_lieu.Text.Trim() != "")
                {
                    m_us_dm_cau_hoi.strLINK_TL_THAM_KHAO = m_txt_link_tai_lieu.Text.Trim();
                }
                else
                {
                    m_us_dm_cau_hoi.SetLINK_TL_THAM_KHAONull();
                }
                break;

            // Sửa câu hỏi, ko cho sửa câu trả lời
            case e_form_mode.SUA_CAU_HOI:
                m_us_dm_cau_hoi.dcID_TO_CHUC          = CIPConvert.ToDecimal(m_cbo_don_vi_truong.SelectedValue);
                m_us_dm_cau_hoi.dcID_NHOM_CAU_HOI     = CIPConvert.ToDecimal(m_cbo_nhom_cau_hoi.SelectedValue);
                m_us_dm_cau_hoi.strNOI_DUNG_CAU_HOI   = m_txt_noi_dung_cau_hoi.Text.Trim();
                m_us_dm_cau_hoi.dcNGUOI_CAP_NHAT_CUOI = CAppContext_201.getCurrentUserID();
                m_us_dm_cau_hoi.datNGAY_CAP_NHAP_CUOI = DateTime.Today;
                break;

            // ko thay đổi câu hỏi
            case e_form_mode.DUYET_CAU_TRA_LOI:
                m_us_dm_cau_tra_loi.strCAU_TRA_LOI       = m_txt_cau_tra_loi.Text.Trim();
                m_us_dm_cau_tra_loi.strLINK_TL_THAM_KHAO = m_txt_link_tai_lieu.Text.Trim();
                m_us_dm_cau_tra_loi.dcID_TRANG_THAI      = CIPConvert.ToDecimal(m_cbo_trang_thai_cau_tra_loi.SelectedValue);
                break;

            // ko thay đổi câu hỏi; dùng  procedure riêng để thêm câu trả lời cho câu hỏi
            case e_form_mode.THEM_CAU_TRA_LOI:
                m_us_dm_cau_hoi.strCAU_TRA_LOI       = m_txt_cau_tra_loi.Text.Trim();
                m_us_dm_cau_hoi.datNGAY_TAO          = DateTime.Now;
                m_us_dm_cau_hoi.dcNGUOI_TAO          = CAppContext_201.getCurrentUserID();
                m_us_dm_cau_hoi.strLINK_TL_THAM_KHAO = m_txt_link_tai_lieu.Text.Trim();
                break;
            }
        }
        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();
        }
Esempio n. 29
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;
        }