コード例 #1
0
        private void load_data_2_grid()
        {
            DataSet v_ds_hoc_vien = new DataSet();

            TOSApp.SCMServices.SyncData v_ws = new TOSApp.SCMServices.SyncData();
            string v_str_key_search          = HelpUtils.gen_string_call_scm_get_sinh_vien_ws("", m_txt_key_search.Text.Trim(), "", "", "20", m_cbo_truong.Text);

            v_ds_hoc_vien = v_ws.TOS_search_info_hoc_vien(HelpUtils.gen_string_call_scm_get_sinh_vien_ws("", m_txt_key_search.Text.Trim(), "", "", "20", m_cbo_truong.Text));
            m_fg.Redraw   = false;
            CGridUtils.Dataset2C1Grid(v_ds_hoc_vien, m_fg, m_obj_trans);
            m_fg.Sort(SortFlags.Ascending, (int)e_col_Number.MA_TRUONG, (int)e_col_Number.MA_LOP);
            set_tree_on_grid();
            m_fg.Redraw = true;
            make_stt();
            m_fg.Focus();
            if (m_fg.Rows.Count > 3)
            {
                m_fg.Row = 3;
            }
            m_fg.Col = 3;
            if (m_fg.Rows.Count == 1)
            {
                m_lb_thong_bao_ket_qua.Visible = true;
                SizeConverter v_size = new SizeConverter();

                m_lb_thong_bao_ket_qua.Font      = new System.Drawing.Font(new FontFamily("Microsoft Sans Serif"), 12);
                m_lb_thong_bao_ket_qua.ForeColor = Color.FromArgb(129, 12, 21);
            }
            else
            {
                m_lb_thong_bao_ket_qua.Visible = false;
            }
        }
コード例 #2
0
        private void load_data_2_grid()
        {
            string v_str_key_search = "";
            string v_str_ho_ten     = m_txt_key_ten_qlht.Text.Trim();
            string v_str_ma_lop     = m_txt_key_ma_lop.Text.Trim();
            string v_str_ma_truong  = CIPConvert.ToStr(m_cbo_qlht_truong.SelectedValue);

            if (v_str_ma_truong == "ALL")
            {
                v_str_ma_truong = "";
            }
            v_str_key_search = HelpUtils.gen_string_call_scm_get_QLHT_ws("", v_str_ho_ten, v_str_ma_truong, v_str_ma_lop, "20");

            m_ds_dm_qlht_scm = new DS_DM_QLHT_SCM();
            m_scm_ws         = new SCMServices.SyncData();
            m_ds_qlht        = m_scm_ws.TOS_search_thong_tin_qlht_all_T(v_str_key_search);

            dataset_2_ds_qlht();

            m_fg.Redraw = false;
            CGridUtils.Dataset2C1Grid(m_ds_dm_qlht_scm, m_fg, m_obj_trans);
            set_tree_on_grid();
            CGridUtils.MakeSoTT((int)e_col_Number.STT, m_fg);
            m_fg.Redraw = true;
            m_fg.Focus();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        // transfer focus to grid column when a proxy button is activated
        private void _btnClick(object sender, System.EventArgs e)
        {
            Button btn = sender as Button;
            Column col = btn.Tag as Column;

            _flex.Col = col.Index;
            _flex.Focus();
        }
コード例 #5
0
        // handle select combo
        private void cmbSelect_SelectionChangeCommitted(object sender, System.EventArgs e)
        {
            // get current row//s node
            Node nd = flex.Rows[flex.Row].Node;

            // get relative node selected by the user
            nd = nd.GetNode((NodeTypeEnum)cmbSelect.SelectedIndex);

            // if failed, show message
            if (nd == null)
            {
                MessageBox.Show("Can//t find " + cmbSelect.Text + " for this node.");
                return;
            }

            // select node and make sure it//s visible
            nd.Select();
            nd.EnsureVisible();
            flex.Focus();
        }
コード例 #6
0
 // when the user clicks a point on the chart, select the data on the grid
 private void _chart_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         int        series         = -1;
         int        point          = -1;
         int        distance       = -1;
         ChartGroup grp            = _chart.ChartGroups[0];
         bool       foundDataPoint = grp.CoordToDataIndex(e.X, e.Y, CoordinateFocusEnum.XandYCoord, ref series, ref point, ref distance);
         if (foundDataPoint && distance < 10)
         {
             _flex.Select(point + _flex.Rows.Fixed, series + _flex.Cols.Fixed + 1);
             _flex.Focus();
         }
     }
 }
コード例 #7
0
 private void load_data_2_grid()
 {
     m_ds_cau_hoi = new DS_V_DM_CAU_HOI();
     m_us_cau_hoi.search_dm_cau_hoi(m_txt_key_cau_hoi.Text.Trim()
                                    , CIPConvert.ToDecimal(m_cbo_don_vi_lien_quan.SelectedValue)
                                    , CIPConvert.ToDecimal(m_cbo_loai_cau_hoi_tren.SelectedValue)
                                    , m_ds_cau_hoi);
     m_fg.Redraw = false;
     CGridUtils.Dataset2C1Grid(m_ds_cau_hoi, m_fg, m_obj_trans);
     set_tree_on_grid();
     m_fg.Redraw = true;
     m_fg.Focus();
     if (m_fg.Rows.Count > 3)
     {
         m_fg.Select(3, 3, true);
     }
 }
コード例 #8
0
 private void _frz_AfterScroll(object sender, C1.Win.C1FlexGrid.RangeEventArgs e)
 {
     // if the frozen grid has the focus and the user selects non-frozen
     // cells, scroll main grid up.
     if (_frz.Focused)
     {
         int row = Math.Min(_frz.Row, _frz.RowSel);
         int bot = _main.Rows[row].Bottom + _main.ScrollPosition.Y;
         if (bot > Top)
         {
             // unless this is a mouse selection, give focus to main grid
             if (!_frz.Capture)
             {
                 _main.Focus();
             }
             _main.TopRow = _main.Row;
         }
     }
     SynchScrollPosition(true);
 }
コード例 #9
0
        private void load_data_2_grid()
        {
            m_ds = new DS_V_GD_HOP_DONG_LAO_DONG();
            var v_dc_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 = "";
            }

            if (m_cbo_loai_hop_dong.SelectedValue == null)
            {
                return;
            }
            if (m_cbo_trang_thai_hop_dong.SelectedValue == null)
            {
                return;
            }

            var v_str_trang_thai_hop_dong = "";

            if (m_cbo_trang_thai_hop_dong.SelectedIndex == 1)
            {
                v_str_trang_thai_hop_dong = "Y";
            }
            if (m_cbo_trang_thai_hop_dong.SelectedIndex == 2)
            {
                v_str_trang_thai_hop_dong = "N";
            }

            if (m_cbo_tim_kiem_theo.SelectedIndex == 0)
            {
                m_us.FillDatasetSearchAll(m_ds,
                                          v_str_search,
                                          decimal.Parse(m_cbo_loai_hop_dong.SelectedValue.ToString()),
                                          v_str_trang_thai_hop_dong,
                                          DateTime.Parse(m_dat_tu_ngay.Value.ToShortDateString()),
                                          DateTime.Parse(m_dat_den_ngay.Value.ToShortDateString()),
                                          0,
                                          v_dc_id_phap_nhan);
            }
            if (m_cbo_tim_kiem_theo.SelectedIndex == 1)
            {
                m_us.FillDatasetSearchAll(m_ds,
                                          v_str_search,
                                          decimal.Parse(m_cbo_loai_hop_dong.SelectedValue.ToString()),
                                          v_str_trang_thai_hop_dong,
                                          DateTime.Parse(m_dat_tu_ngay.Value.ToShortDateString()),
                                          DateTime.Parse(m_dat_den_ngay.Value.ToShortDateString()),
                                          1,
                                          v_dc_id_phap_nhan);
            }
            if (m_cbo_tim_kiem_theo.SelectedIndex == 2)
            {
                m_us.FillDatasetSearchAll(m_ds,
                                          v_str_search,
                                          decimal.Parse(m_cbo_loai_hop_dong.SelectedValue.ToString()),
                                          v_str_trang_thai_hop_dong,
                                          DateTime.Parse(m_dat_tu_ngay.Value.ToShortDateString()),
                                          DateTime.Parse(m_dat_den_ngay.Value.ToShortDateString()),
                                          2,
                                          v_dc_id_phap_nhan);
            }
            if (m_cbo_tim_kiem_theo.SelectedIndex == 3)
            {
                m_us.FillDatasetSearchAll(m_ds,
                                          v_str_search,
                                          decimal.Parse(m_cbo_loai_hop_dong.SelectedValue.ToString()),
                                          v_str_trang_thai_hop_dong,
                                          DateTime.Parse(m_dat_tu_ngay.Value.ToShortDateString()),
                                          DateTime.Parse(m_dat_den_ngay.Value.ToShortDateString()),
                                          3,
                                          v_dc_id_phap_nhan);
            }

            m_lbl_count_record.Text = string.Format("Có {0} Hợp Đồng Lao Động.", m_ds.Tables[0].Rows.Count);
            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_NV             // chỗ này là tên trường mà mình nhóm
                          , (int)e_col_Number.MA_HOP_DONG       // chỗ này là tên trường mà mình Count
                          , "{0}"
                          );

            m_fg.Redraw = true;
            m_fg.Focus();
            auto_suggest_text();
        }