// Load loại giảng viên
    private void load_loai_giang_vien()
    {
        try
        {
            US_CM_DM_TU_DIEN       v_cm_dm_tu_dien       = new US_CM_DM_TU_DIEN();
            DS_CM_DM_TU_DIEN       v_ds_cm_dm_tu_dien    = new DS_CM_DM_TU_DIEN();
            string                 m_str_loai_giang_vien = "";
            US_DM_HO_SO_GIANG_VIEN v_us_gd_ho_so_gv      = new US_DM_HO_SO_GIANG_VIEN(CIPConvert.ToDecimal(Request.QueryString["id_hs"]));
            if (!v_us_gd_ho_so_gv.IsIDNull())
            {
                m_str_loai_giang_vien = get_mapping_loai_giang_vien(v_us_gd_ho_so_gv.dcID_GIANG_VIEN);
                if (m_str_loai_giang_vien == "NY" || m_str_loai_giang_vien == "YY")
                {
                    m_lbl_loai_giang_vien.Text = "Giảng viên chuyên môn";
                    v_cm_dm_tu_dien.FillDataset(v_ds_cm_dm_tu_dien, " WHERE ID_LOAI_TU_DIEN = " + (int)e_loai_tu_dien.LOAI_HO_SO_GV_CM);
                }
                else
                {
                    m_lbl_loai_giang_vien.Text = "Giảng viên hướng dẫn";
                    v_cm_dm_tu_dien.FillDataset(v_ds_cm_dm_tu_dien, " WHERE ID_LOAI_TU_DIEN = " + (int)e_loai_tu_dien.LOAI_HO_SO_GV_HD);
                }
                m_cbo_loai_ho_so.DataTextField  = CM_DM_TU_DIEN.TEN;
                m_cbo_loai_ho_so.DataValueField = CM_DM_TU_DIEN.ID;

                m_cbo_loai_ho_so.DataSource = v_ds_cm_dm_tu_dien.CM_DM_TU_DIEN;
                m_cbo_loai_ho_so.DataBind();
            }
        }
        catch (Exception v_e)
        {
            CSystemLog_301.ExceptionHandle(this, v_e);
        }
    }
    private void load_2_cbo_giang_trang_thai()
    {
        try
        {
            m_ds_cm_dm_tu_dien.CM_DM_TU_DIEN.Clear();
            // Đổ dữ liệu vào DS
            m_us_cm_dm_tu_dien.FillDataset(m_ds_cm_dm_tu_dien, " WHERE ID_LOAI_TU_DIEN = " + (int)e_loai_tu_dien.TRANG_THAI_HO_SO_GV); // Đây là lấy theo điều kiện

            //TReo dữ liệu vào Dropdownlist loại hợp đồng
            // dây là giá trị hiển thị
            m_cbo_trang_thai.DataTextField = CM_DM_TU_DIEN.TEN;
            // Đây là giá trị thực
            m_cbo_trang_thai.DataValueField = CM_DM_TU_DIEN.ID;

            m_cbo_trang_thai.DataSource = m_ds_cm_dm_tu_dien.CM_DM_TU_DIEN;
            m_cbo_trang_thai.DataBind();
            //Load len bo loc de search
            m_cbo_loc_trang_thai.DataTextField  = CM_DM_TU_DIEN.TEN;
            m_cbo_loc_trang_thai.DataValueField = CM_DM_TU_DIEN.ID;
            m_cbo_loc_trang_thai.DataSource     = m_ds_cm_dm_tu_dien.CM_DM_TU_DIEN;
            m_cbo_loc_trang_thai.DataBind();
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
    private void load_data_2_trang_thai_hop_dong()
    {
        try
        {
            DS_CM_DM_TU_DIEN v_ds_cm_tu_dien = new DS_CM_DM_TU_DIEN();
            US_CM_DM_TU_DIEN v_us_cm_tu_dien = new US_CM_DM_TU_DIEN();
            //v_ds_cm_tu_dien.Clear();
            //DataRow v_dr_all_trang_thai_hdong = m_ds_cm_dm_tu_dien.CM_DM_TU_DIEN.NewCM_DM_TU_DIENRow();

            ////add item Tat Ca
            //v_dr_all_trang_thai_hdong[CM_DM_TU_DIEN.ID] = 0;
            //v_dr_all_trang_thai_hdong[CM_DM_TU_DIEN.TEN] = "Tất cả";

            //v_ds_cm_tu_dien.EnforceConstraints = false;
            //v_ds_cm_tu_dien.CM_DM_TU_DIEN.Rows.InsertAt(v_dr_all_trang_thai_hdong, 0);

            // Đổ dữ liệu vào DS
            v_us_cm_tu_dien.FillDataset(v_ds_cm_tu_dien, " WHERE ID_LOAI_TU_DIEN = "
                                        + (int)e_loai_tu_dien.TRANG_THAI_HOP_DONG_KHUNG);         // Đây là lấy theo điều kiện
            m_cbo_trang_thai_hop_dong_search.Items.Add(new ListItem("Tất cả", "0"));
            for (int i = 0; i < v_ds_cm_tu_dien.CM_DM_TU_DIEN.Rows.Count; i++)
            {
                m_cbo_trang_thai_hop_dong_search.Items.Add(new ListItem(v_ds_cm_tu_dien.CM_DM_TU_DIEN[i][CM_DM_TU_DIEN.TEN].ToString(), v_ds_cm_tu_dien.CM_DM_TU_DIEN[i][CM_DM_TU_DIEN.ID].ToString()));
            }
            //m_cbo_trang_thai_hop_dong_search.DataValueField = CM_DM_TU_DIEN.ID;
            //m_cbo_trang_thai_hop_dong_search.DataTextField = CM_DM_TU_DIEN.TEN;

            //m_cbo_trang_thai_hop_dong_search.DataSource = v_ds_cm_tu_dien.CM_DM_TU_DIEN;
            //m_cbo_trang_thai_hop_dong_search.DataBind();
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
    private void load_2_cbo_don_vi_quan_ly()
    {
        try
        {
            DS_CM_DM_TU_DIEN v_ds_cm_tu_dien = new DS_CM_DM_TU_DIEN();
            US_CM_DM_TU_DIEN v_us_cm_tu_dien = new US_CM_DM_TU_DIEN();
            //v_ds_cm_tu_dien.Clear();
            //DataRow v_dr_all_dv_quan_ly = m_ds_cm_dm_tu_dien.CM_DM_TU_DIEN.NewCM_DM_TU_DIENRow();

            ////add item Tat Ca
            //v_dr_all_dv_quan_ly[CM_DM_TU_DIEN.ID] = 0;
            //v_dr_all_dv_quan_ly[CM_DM_TU_DIEN.TEN] = "Tất cả";

            //v_ds_cm_tu_dien.EnforceConstraints = false;
            //v_ds_cm_tu_dien.CM_DM_TU_DIEN.Rows.InsertAt(v_dr_all_dv_quan_ly, 0);

            // Đổ dữ liệu vào DS
            v_us_cm_tu_dien.FillDataset(v_ds_cm_tu_dien, " WHERE ID_LOAI_TU_DIEN = "
                                        + (int)e_loai_tu_dien.DON_VI_QUAN_LY_CHINH);         // Đây là lấy theo điều kiện
            m_cbo_don_vi_quan_ly_search.Items.Add(new ListItem("Tất cả", "0"));
            for (int i = 0; i < v_ds_cm_tu_dien.CM_DM_TU_DIEN.Rows.Count; i++)
            {
                m_cbo_don_vi_quan_ly_search.Items.Add(new ListItem(v_ds_cm_tu_dien.CM_DM_TU_DIEN[i][CM_DM_TU_DIEN.TEN].ToString(), v_ds_cm_tu_dien.CM_DM_TU_DIEN[i][CM_DM_TU_DIEN.ID].ToString()));
            }

            //for (int i = 0; i < v_ds_cm_tu_dien.CM_DM_TU_DIEN.Rows.Count; i++)
            //{
            //    m_cbo_don_vi_q_ly.Items.Add(new ListItem(v_ds_cm_tu_dien.CM_DM_TU_DIEN[i][CM_DM_TU_DIEN.TEN].ToString(), v_ds_cm_tu_dien.CM_DM_TU_DIEN[i][CM_DM_TU_DIEN.ID].ToString()));
            //}
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
Exemple #5
0
    //
    // Region for search
    //
    private void load_2_cbo_trang_thai_giang_vien()
    {
        try
        {
            DS_CM_DM_TU_DIEN v_ds_cm_tu_dien = new DS_CM_DM_TU_DIEN();
            US_CM_DM_TU_DIEN v_us_cm_tu_dien = new US_CM_DM_TU_DIEN();
            // DataRow v_dr_all = m_ds_cm_dm_tu_dien.CM_DM_TU_DIEN.NewCM_DM_TU_DIENRow();
            // Đổ dữ liệu vào DS
            v_us_cm_tu_dien.FillDataset(v_ds_cm_tu_dien, " WHERE ID_LOAI_TU_DIEN = " + (int)e_loai_tu_dien.TRANG_THAI_GIANG_VIEN);  // Đây là lấy theo điều kiện

            //m_cbo_trang_thai_g_vien.DataValueField = CM_DM_TU_DIEN.ID;
            //m_cbo_trang_thai_g_vien.DataTextField = CM_DM_TU_DIEN.TEN;

            //m_cbo_trang_thai_g_vien.DataSource = v_ds_cm_tu_dien.CM_DM_TU_DIEN;
            //m_cbo_trang_thai_g_vien.DataBind();

            m_cbo_trang_thai_g_vien.Items.Add(new ListItem("Tất cả", "0"));
            for (int i = 0; i < v_ds_cm_tu_dien.CM_DM_TU_DIEN.Rows.Count; i++)
            {
                m_cbo_trang_thai_g_vien.Items.Add(new ListItem(v_ds_cm_tu_dien.CM_DM_TU_DIEN[i][CM_DM_TU_DIEN.TEN].ToString(), v_ds_cm_tu_dien.CM_DM_TU_DIEN[i][CM_DM_TU_DIEN.ID].ToString()));
            }
        }

        catch (Exception v_e)
        {
            throw v_e;
        }
    }
    private void load_data_2_cbo_trang_thai_dot_tt()
    {
        try
        {
            // Đổ dữ liệu vào DS
            m_us_cm_dm_tu_dien.FillDataset(m_ds_cm_dm_tu_dien, " WHERE ID_LOAI_TU_DIEN = " + (int)e_loai_tu_dien.TRANG_THAI_DOT_THANH_TOAN); // Đây là lấy theo điều kiện

            //TReo dữ liệu vào Dropdownlist loại hợp đồng
            // dây là giá trị hiển thị
            m_cbo_dm_trang_thai_dot_thanh_toan.DataTextField        = CM_DM_TU_DIEN.TEN;
            m_cbo_dm_trang_thai_dot_thanh_toan_search.DataTextField = CM_DM_TU_DIEN.TEN;
            // Đây là giá trị thực
            m_cbo_dm_trang_thai_dot_thanh_toan.DataValueField        = CM_DM_TU_DIEN.ID;
            m_cbo_dm_trang_thai_dot_thanh_toan_search.DataValueField = CM_DM_TU_DIEN.ID;

            m_cbo_dm_trang_thai_dot_thanh_toan.DataSource = m_ds_cm_dm_tu_dien.CM_DM_TU_DIEN;
            m_cbo_dm_trang_thai_dot_thanh_toan.DataBind();

            m_cbo_dm_trang_thai_dot_thanh_toan_search.DataSource = m_ds_cm_dm_tu_dien.CM_DM_TU_DIEN;
            m_cbo_dm_trang_thai_dot_thanh_toan_search.DataBind();
            m_cbo_dm_trang_thai_dot_thanh_toan.SelectedIndex = 0;
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
    private void load_data_2_cbo_trang_thai_thanh_toan_search()
    {
        m_us_cm_tu_dien.FillDataset(m_ds_cm_tu_dien, " WHERE ID_LOAI_TU_DIEN= " + (int)e_loai_tu_dien.TRANG_THAI_THANH_TOAN);
        DataRow v_dr = m_ds_cm_tu_dien.CM_DM_TU_DIEN.NewCM_DM_TU_DIENRow();

        v_dr[CM_DM_TU_DIEN.ID]              = 0;
        v_dr[CM_DM_TU_DIEN.MA_TU_DIEN]      = "All";
        v_dr[CM_DM_TU_DIEN.TEN]             = "Tất cả";
        v_dr[CM_DM_TU_DIEN.TEN_NGAN]        = "Tất cả";
        v_dr[CM_DM_TU_DIEN.ID_LOAI_TU_DIEN] = HANG_SO_UNG_TEXT.TAT_CA;
        m_ds_cm_tu_dien.CM_DM_TU_DIEN.Rows.InsertAt(v_dr, 0);

        m_cbo_trang_thai_tt_search.DataTextField  = CM_DM_TU_DIEN.TEN;
        m_cbo_trang_thai_tt_search.DataValueField = CM_DM_TU_DIEN.ID;
        m_cbo_trang_thai_tt_search.DataSource     = m_ds_cm_tu_dien.CM_DM_TU_DIEN;
        m_cbo_trang_thai_tt_search.DataBind();
    }
    private void load_data_2_cbo_trang_thai_thanh_toan()
    {
        m_us_cm_tu_dien.FillDataset(m_ds_cm_tu_dien, " WHERE ID_LOAI_TU_DIEN= " + (int)e_loai_tu_dien.TRANG_THAI_THANH_TOAN);

        m_cbo_trang_thai_thanh_toan.DataTextField  = CM_DM_TU_DIEN.TEN;
        m_cbo_trang_thai_thanh_toan.DataValueField = CM_DM_TU_DIEN.ID;
        m_cbo_trang_thai_thanh_toan.DataSource     = m_ds_cm_tu_dien.CM_DM_TU_DIEN;
        m_cbo_trang_thai_thanh_toan.DataBind();
    }
    private decimal get_id_trang_thai_da_len_bang_ke()
    {
        US_CM_DM_TU_DIEN v_us_cm_tu_dien = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_tu_dien    = new DS_CM_DM_TU_DIEN();

        v_us_cm_tu_dien.FillDataset(v_ds_tu_dien, " WHERE ID_LOAI_TU_DIEN = 15 AND MA_TU_DIEN LIKE N'%DA_LEN_BANG_KE%'");
        if (v_ds_tu_dien.CM_DM_TU_DIEN.Rows.Count == 0)
        {
            return(511);
        }
        return(CIPConvert.ToDecimal(v_ds_tu_dien.CM_DM_TU_DIEN.Rows[0][CM_DM_TU_DIEN.ID]));
    }
    // Load lên combo
    private void load_cbo_don_vi_quan_ly()
    {
        try
        {
            m_ds_cm_dm_tu_dien.CM_DM_TU_DIEN.Clear();
            // Đổ dữ liệu vào DS
            m_us_cm_dm_tu_dien.FillDataset(m_ds_cm_dm_tu_dien, " WHERE ID_LOAI_TU_DIEN = " + (int)e_loai_tu_dien.DON_VI_QUAN_LY_CHINH); // Đây là lấy theo điều kiện

            //TReo dữ liệu vào Dropdownlist loại hợp đồng
            // dây là giá trị hiển thị
            // Đây là giá trị thực
            m_cbo_dm_don_vi_quan_ly.DataValueField = CM_DM_TU_DIEN.ID;
            m_cbo_dm_don_vi_quan_ly.DataTextField  = CM_DM_TU_DIEN.TEN;
            m_cbo_dm_don_vi_quan_ly.DataSource     = m_ds_cm_dm_tu_dien.CM_DM_TU_DIEN;
            m_cbo_dm_don_vi_quan_ly.DataBind();
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
Exemple #11
0
    private decimal get_id_trang_thai_ngan_hang_chuyen_khoan_thanh_cong()
    {
        US_CM_DM_TU_DIEN v_us_cm_tu_dien = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_tu_dien    = new DS_CM_DM_TU_DIEN();

        v_us_cm_tu_dien.FillDataset(v_ds_tu_dien, " WHERE ID_LOAI_TU_DIEN = 15 AND MA_TU_DIEN LIKE N'%NGAN_HANG_CHUYEN_KHOAN_THANH_CONG%'");
        if (v_ds_tu_dien.CM_DM_TU_DIEN.Rows.Count == 0)
        {
            return(515);
        }
        return(CIPConvert.ToDecimal(v_ds_tu_dien.CM_DM_TU_DIEN.Rows[0][CM_DM_TU_DIEN.ID]));
    }
    private decimal get_id_trang_thai_dot_tt_da_lap_dot()
    {
        US_CM_DM_TU_DIEN v_us_cm_tu_dien = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_tu_dien    = new DS_CM_DM_TU_DIEN();

        v_us_cm_tu_dien.FillDataset(v_ds_tu_dien, " WHERE ID_LOAI_TU_DIEN = 14 AND MA_TU_DIEN LIKE N'%DA_LAP_DOT%'");
        if (v_ds_tu_dien.CM_DM_TU_DIEN.Rows.Count == 0)
        {
            return(503);
        }
        return(CIPConvert.ToDecimal(v_ds_tu_dien.CM_DM_TU_DIEN.Rows[0][CM_DM_TU_DIEN.ID]));
    }
    private decimal get_id_trang_thai_chua_duyet()
    {
        US_CM_DM_TU_DIEN v_us_cm_tu_dien = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_tu_dien    = new DS_CM_DM_TU_DIEN();

        v_us_cm_tu_dien.FillDataset(v_ds_tu_dien, " WHERE ID_LOAI_TU_DIEN = 15 AND MA_TU_DIEN LIKE N'%CHUNG_TU_KHONG_DUOC_DUYET%'");
        if (v_ds_tu_dien.CM_DM_TU_DIEN.Rows.Count == 0)
        {
            return(513);
        }
        return(CIPConvert.ToDecimal(v_ds_tu_dien.CM_DM_TU_DIEN.Rows[0][CM_DM_TU_DIEN.ID]));
    }
Exemple #14
0
    private void load_data_2_cbo_trang_thai_cv_gv()
    {
        US_CM_DM_TU_DIEN v_us_tu_dien = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_tu_dien = new DS_CM_DM_TU_DIEN();

        v_us_tu_dien.FillDataset(v_ds_tu_dien, " WHERE ID_LOAI_TU_DIEN = " + (int)e_loai_tu_dien.TRANG_THAI_CONG_VIEC_GV);
        m_cbo_trang_thai_cv_gv.Items.Add(new ListItem("Tất cả", "0"));
        for (int v_i = 0; v_i < v_ds_tu_dien.CM_DM_TU_DIEN.Rows.Count; v_i++)
        {
            m_cbo_trang_thai_cv_gv.Items.Add(new ListItem(CIPConvert.ToStr(v_ds_tu_dien.CM_DM_TU_DIEN.Rows[v_i][CM_DM_TU_DIEN.TEN]), CIPConvert.ToStr(v_ds_tu_dien.CM_DM_TU_DIEN.Rows[v_i][CM_DM_TU_DIEN.ID])));
        }
    }
Exemple #15
0
    private void load_2_cbo_trang_thai_sk()
    {
        US_CM_DM_TU_DIEN v_us_tu_dien = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_tu_dien = new DS_CM_DM_TU_DIEN();

        v_us_tu_dien.FillDataset(v_ds_tu_dien, "WHERE ID_LOAI_TU_DIEN = " + (int)e_loai_tu_dien.TRANG_THAI_SU_KIEN_GV);

        m_cbo_trang_thai_sk.DataTextField  = CM_DM_TU_DIEN.TEN;
        m_cbo_trang_thai_sk.DataValueField = CM_DM_TU_DIEN.ID;

        m_cbo_trang_thai_sk.DataSource = v_ds_tu_dien.CM_DM_TU_DIEN;
        m_cbo_trang_thai_sk.DataBind();
    }
Exemple #16
0
    private decimal get_id_trang_thai_ngan_hang_chuyen_khoan_khong_thanh_cong()
    {
        US_CM_DM_TU_DIEN v_us_cm_tu_dien = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_tu_dien    = new DS_CM_DM_TU_DIEN();

        v_us_cm_tu_dien.FillDataset(v_ds_tu_dien, " WHERE ID_LOAI_TU_DIEN = 15 AND MA_TU_DIEN LIKE N'%NGAN_HANG_CHUYEN_KHOAN_KHONG_THANH_CONG%'");
        // Nếu ko có giá trị phù hợp, ta dùng id_trang_thai hiện tại của cbo_trang_thai_thanh_toan
        if (v_ds_tu_dien.CM_DM_TU_DIEN.Rows.Count == 0)
        {
            return(CIPConvert.ToDecimal(m_cbo_trang_thai_thanh_toan.SelectedValue));
        }
        return(CIPConvert.ToDecimal(v_ds_tu_dien.CM_DM_TU_DIEN.Rows[0][CM_DM_TU_DIEN.ID]));
    }
Exemple #17
0
    private void load_2_cbo_vai_tro_giang_vien()
    {
        US_CM_DM_TU_DIEN v_us_tu_dien = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_tu_dien = new DS_CM_DM_TU_DIEN();

        v_us_tu_dien.FillDataset(v_ds_tu_dien, " WHERE ID_LOAI_TU_DIEN = " + (int)e_loai_tu_dien.VAI_TRO_GV);

        m_cbo_vai_tro_gv.DataTextField  = CM_DM_TU_DIEN.TEN;
        m_cbo_vai_tro_gv.DataValueField = CM_DM_TU_DIEN.ID;

        m_cbo_vai_tro_gv.DataSource = v_ds_tu_dien.CM_DM_TU_DIEN;
        m_cbo_vai_tro_gv.DataBind();
    }
Exemple #18
0
    private void load_data_2_cbo_loai_su_kien()
    {
        US_CM_DM_TU_DIEN v_us_tu_dien = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_tu_dien = new DS_CM_DM_TU_DIEN();

        v_us_tu_dien.FillDataset(v_ds_tu_dien, " WHERE ID_LOAI_TU_DIEN = " + (int)e_loai_tu_dien.LOAI_SU_KIEN);

        m_cbo_loai_su_kien.DataTextField  = CM_DM_TU_DIEN.TEN;
        m_cbo_loai_su_kien.DataValueField = CM_DM_TU_DIEN.ID;

        m_cbo_loai_su_kien.DataSource = v_ds_tu_dien.CM_DM_TU_DIEN;
        m_cbo_loai_su_kien.DataBind();
    }
Exemple #19
0
    private decimal get_id_trang_thai_da_thanh_toan()
    {
        US_CM_DM_TU_DIEN v_us_cm_tu_dien = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_tu_dien    = new DS_CM_DM_TU_DIEN();

        v_us_cm_tu_dien.FillDataset(v_ds_tu_dien, " WHERE ID_LOAI_TU_DIEN = 14 AND MA_TU_DIEN LIKE N'%DA_THANH_TOAN%'");
        // Nếu ko có giá trị phù hợp, ta dùng id_trang_thai hiện tại của cbo_trang_thai_thanh_toan
        if (v_ds_tu_dien.CM_DM_TU_DIEN.Rows.Count == 0)
        {
            return(CIPConvert.ToDecimal(m_cbo_trang_thai_thanh_toan.SelectedValue));
        }
        return(CIPConvert.ToDecimal(v_ds_tu_dien.CM_DM_TU_DIEN.Rows[0][CM_DM_TU_DIEN.ID]));
    }
    private decimal get_id_trang_thai_chung_tu_da_duoc_duyet()
    {
        US_CM_DM_TU_DIEN v_us_cm_tu_dien = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_tu_dien    = new DS_CM_DM_TU_DIEN();

        v_us_cm_tu_dien.FillDataset(v_ds_tu_dien, " WHERE ID_LOAI_TU_DIEN = 15 AND MA_TU_DIEN LIKE N'%CHUNG_TU_DA_DUOC_DUYET%'");
        // Nếu ko có giá trị phù hợp, ta dùng id_trang_thai hiện tại của cbo_trang_thai_thanh_toan
        if (v_ds_tu_dien.CM_DM_TU_DIEN.Rows.Count == 0)
        {
            return(0);
        }
        return(CIPConvert.ToDecimal(v_ds_tu_dien.CM_DM_TU_DIEN.Rows[0][CM_DM_TU_DIEN.ID]));
    }
    private void load_data_2_cbo_loai_su_kien()
    {
        try
        {
            m_ds_cm_dm_tu_dien.CM_DM_TU_DIEN.Clear();
            // Đổ dữ liệu vào DS
            m_us_cm_dm_tu_dien.FillDataset(m_ds_cm_dm_tu_dien, " WHERE ID_LOAI_TU_DIEN = " + (int)e_loai_tu_dien.LOAI_SU_KIEN); // Đây là lấy theo điều kiện

            //TReo dữ liệu vào Dropdownlist loại hợp đồng
            // dây là giá trị hiển thị
            m_ddl_loai_su_kien.DataTextField = CM_DM_TU_DIEN.TEN;
            // Đây là giá trị thực
            m_ddl_loai_su_kien.DataValueField = CM_DM_TU_DIEN.ID;

            m_ddl_loai_su_kien.DataSource = m_ds_cm_dm_tu_dien.CM_DM_TU_DIEN;
            m_ddl_loai_su_kien.DataBind();
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
    /// <summary>
    /// Hàm lấy mã từ điển (string) dựa vào mã ID
    /// </summary>
    /// <param name="ip_dc_id"></param>
    /// <returns></returns>
    private string load_ma_tu_dien_by_id(decimal ip_dc_id)
    {
        US_CM_DM_TU_DIEN v_us_cm_dm_tu_dien = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_cm_dm_tu_dien = new DS_CM_DM_TU_DIEN();

        v_us_cm_dm_tu_dien.FillDataset(v_ds_cm_dm_tu_dien, " WHERE ID= " + ip_dc_id);
        if (v_ds_cm_dm_tu_dien.CM_DM_TU_DIEN.Rows.Count < 0)
        {
            return("");
        }
        else
        {
            return(v_ds_cm_dm_tu_dien.CM_DM_TU_DIEN.Rows[0][CM_DM_TU_DIEN.MA_TU_DIEN].ToString());
        }
    }
Exemple #23
0
        private void load_data_2_trang_thai_don_hang_de_cap_nhat()
        {
            US_CM_DM_TU_DIEN v_us_tu_dien = new US_CM_DM_TU_DIEN();
            DS_CM_DM_TU_DIEN v_ds_tu_dien = new DS_CM_DM_TU_DIEN();

            v_us_tu_dien.FillDataset(v_ds_tu_dien, " WHERE " + CM_DM_TU_DIEN.ID_LOAI_TU_DIEN + " = "
                                     + LOAI_TU_DIEN_ID.TRANG_THAI_GD_YEU_CAU
                                     + " AND " + CM_DM_TU_DIEN.ID + " <> " + TU_DIEN_TRANG_THAI_DON_HANG.DA_DONG
                                     + " ORDER BY " + CM_DM_TU_DIEN.TEN);

            m_cbo_trang_thai_don_hang.DataSource    = v_ds_tu_dien.CM_DM_TU_DIEN;
            m_cbo_trang_thai_don_hang.DisplayMember = CM_DM_TU_DIEN.TEN;
            m_cbo_trang_thai_don_hang.ValueMember   = CM_DM_TU_DIEN.ID;

            m_e_cbo_trang_thai_don_hang = e_cbo_state.DA_FILL_DATA_XONG;
        }
    private string get_ma_from_id(string ip_dc_id_trang_thai_giang_vien)
    {
        try
        {
            US_CM_DM_TU_DIEN v_us_dm_tu_dien = new US_CM_DM_TU_DIEN();
            DS_CM_DM_TU_DIEN v_ds_dm_tu_dien = new DS_CM_DM_TU_DIEN();

            v_us_dm_tu_dien.FillDataset(v_ds_dm_tu_dien, " WHERE ID = " + ip_dc_id_trang_thai_giang_vien + "");
            return(CIPConvert.ToStr(v_ds_dm_tu_dien.CM_DM_TU_DIEN[0][CM_DM_TU_DIEN.MA_TU_DIEN]));
        }

        catch (Exception v_e)
        {
            throw v_e;
        }
    }
 private void load_cbo_user_group()
 {
     try
     {
         US_CM_DM_TU_DIEN us_cm_tu_dien = new US_CM_DM_TU_DIEN();
         DS_CM_DM_TU_DIEN ds_cm_tu_dien = new DS_CM_DM_TU_DIEN();
         us_cm_tu_dien.FillDataset(ds_cm_tu_dien, " WHERE ID_LOAI_TU_DIEN =7");
         m_cbo_trang_thai.DataSource = ds_cm_tu_dien.CM_DM_TU_DIEN;
         m_cbo_trang_thai.DataTextField = CM_DM_TU_DIEN.TEN_NGAN;
         m_cbo_trang_thai.DataValueField = CM_DM_LOAI_TD.ID;
         m_cbo_trang_thai.DataBind();
     }
     catch (Exception v_e)
     {
         throw v_e;
     }
 }
    private void load_2_cbo_trang_thai_hd()
    {
        US_CM_DM_TU_DIEN v_us_trang_thai_hd = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_trang_thai_hd = new DS_CM_DM_TU_DIEN();

        try
        {
            v_us_trang_thai_hd.FillDataset(v_ds_trang_thai_hd, " WHERE ID_LOAI_TU_DIEN =" + (int)e_loai_tu_dien.TRANG_THAI_HOP_DONG_KHUNG + " ORDER BY GHI_CHU");
            m_cbo_dm_trang_thai_hop_dong.DataSource     = v_ds_trang_thai_hd.CM_DM_TU_DIEN;
            m_cbo_dm_trang_thai_hop_dong.DataValueField = CM_DM_TU_DIEN.ID;
            m_cbo_dm_trang_thai_hop_dong.DataTextField  = CM_DM_TU_DIEN.TEN;
            m_cbo_dm_trang_thai_hop_dong.DataBind();
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
Exemple #27
0
    private void load_cbo_loai_hop_dong()
    {
        try
        {
            US_CM_DM_TU_DIEN v_us_loai_hop_dong      = new US_CM_DM_TU_DIEN();
            DS_CM_DM_TU_DIEN v_ds_loai_loai_hop_dong = new DS_CM_DM_TU_DIEN();
            v_us_loai_hop_dong.FillDataset(v_ds_loai_loai_hop_dong, " WHERE ID_LOAI_TU_DIEN = 5");
            m_cbo_loai_hop_dong.DataSource = v_ds_loai_loai_hop_dong.CM_DM_TU_DIEN;

            m_cbo_loai_hop_dong.DataTextField  = CM_DM_TU_DIEN.TEN;
            m_cbo_loai_hop_dong.DataValueField = CM_DM_TU_DIEN.ID;
            m_cbo_loai_hop_dong.DataBind();
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
    private void load_cbo_loai_su_kien()
    {
        try
        {
            US_CM_DM_TU_DIEN v_us_loai_su_kien      = new US_CM_DM_TU_DIEN();
            DS_CM_DM_TU_DIEN v_ds_loai_loai_su_kien = new DS_CM_DM_TU_DIEN();
            v_us_loai_su_kien.FillDataset(v_ds_loai_loai_su_kien, " WHERE ID_LOAI_TU_DIEN = " + (int)e_loai_tu_dien.LOAI_SU_KIEN);
            m_cbo_loai_su_kien.DataSource = v_ds_loai_loai_su_kien.CM_DM_TU_DIEN;

            m_cbo_loai_su_kien.DataTextField  = CM_DM_TU_DIEN.TEN;
            m_cbo_loai_su_kien.DataValueField = CM_DM_TU_DIEN.ID;
            m_cbo_loai_su_kien.DataBind();
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
Exemple #29
0
    private void load_2_cbo_don_vi_quan_ly()
    {
        US_CM_DM_TU_DIEN v_us_don_vi_quan_ly = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_don_vi_quan_ly = new DS_CM_DM_TU_DIEN();

        try
        {
            v_us_don_vi_quan_ly.FillDataset(v_ds_don_vi_quan_ly, " WHERE ID_LOAI_TU_DIEN = " + (int)e_loai_tu_dien.DON_VI_QUAN_LY_CHINH);
            m_cbo_dm_loai_don_vi_quan_li.DataSource     = v_ds_don_vi_quan_ly.CM_DM_TU_DIEN;
            m_cbo_dm_loai_don_vi_quan_li.DataValueField = CM_DM_TU_DIEN.ID;
            m_cbo_dm_loai_don_vi_quan_li.DataTextField  = CM_DM_TU_DIEN.TEN;
            m_cbo_dm_loai_don_vi_quan_li.DataBind();
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
Exemple #30
0
    private void load_2_cbo_loai_hop_dong()
    {
        US_CM_DM_TU_DIEN v_us_dm_loai_hop_dong = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_dm_loai_hop_dong = new DS_CM_DM_TU_DIEN();

        try
        {
            v_us_dm_loai_hop_dong.FillDataset(v_ds_dm_loai_hop_dong, " WHERE ID_LOAI_TU_DIEN = " + (int)e_loai_tu_dien.LOAI_HOP_DONG);
            m_cbo_dm_loai_hop_dong.DataSource     = v_ds_dm_loai_hop_dong.CM_DM_TU_DIEN;
            m_cbo_dm_loai_hop_dong.DataValueField = CM_DM_TU_DIEN.ID;
            m_cbo_dm_loai_hop_dong.DataTextField  = CM_DM_TU_DIEN.TEN;
            m_cbo_dm_loai_hop_dong.DataBind();
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
    // load dữ liệu lên combo trạng thái
    private void load_data_2_combo_trang_thai()
    {
        US_CM_DM_TU_DIEN v_cm_dm_tu_dien    = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_cm_dm_tu_dien = new DS_CM_DM_TU_DIEN();

        try
        {
            v_cm_dm_tu_dien.FillDataset(v_ds_cm_dm_tu_dien, "WHERE ID_LOAI_TU_DIEN = 23");

            m_cbo_trang_thai.DataSource = v_ds_cm_dm_tu_dien.CM_DM_TU_DIEN;

            m_cbo_trang_thai.DataTextField  = CM_DM_TU_DIEN.TEN;
            m_cbo_trang_thai.DataValueField = CM_DM_TU_DIEN.ID;
        }
        catch (Exception v_e)
        {
            CSystemLog_301.ExceptionHandle(this, v_e);
        }
    }
 private void load_cbo_loai_don_vi()
 {
     try
     {
         US_CM_DM_TU_DIEN m_us = new US_CM_DM_TU_DIEN();
         DS_CM_DM_TU_DIEN m_ds = new DS_CM_DM_TU_DIEN();
         m_us.FillDataset(m_ds, "WHERE ID_LOAI_TU_DIEN = 4");
         m_cbo_loai_hinh_don_vi.DataSource = m_ds.CM_DM_TU_DIEN;
         m_cbo_loai_hinh_don_vi.DataTextField = CM_DM_TU_DIEN.TEN_NGAN;
         m_cbo_loai_hinh_don_vi.DataValueField = CM_DM_TU_DIEN.ID;
         m_cbo_loai_hinh_don_vi.DataBind();
     }
     catch (Exception v_e)
     {
         throw v_e;
     }
 }
        private void loadData_fromDB_toDatasets()
        {
            US_CM_DM_TU_DIEN v_us_tu_dien = new US_CM_DM_TU_DIEN();
            try
            {
                v_us_tu_dien.BeginTransaction();
                this.m_ds_tu_dien = new DS_CM_DM_TU_DIEN();
                v_us_tu_dien.FillDataset(m_ds_tu_dien);

                US_CM_DM_LOAI_TD v_us_loai_tu_dien = new US_CM_DM_LOAI_TD();
                v_us_loai_tu_dien.UseTransOfUSObject(v_us_tu_dien);
                this.m_ds_loai_tu_dien = new DS_CM_DM_LOAI_TD();
                v_us_loai_tu_dien.FillDataset(m_ds_loai_tu_dien);

                v_us_tu_dien.CommitTransaction();
            }
            catch (Exception v_e)
            {
                v_us_tu_dien.Rollback();
                CDBExceptionHandler v_handler = new CDBExceptionHandler(v_e, new CDBClientDBExceptionInterpret());
                v_handler.showErrorMessage();
            }
        }
        public static void load_data_to_cbo_ly_do_tang_giam(
            eLOAI_TU_DIEN ip_e_trang_thai_tai_san
            , eLOAI_TANG_GIAM_TAI_SAN ip_e_loai
            , DropDownList ip_obj_cbo_trang_thai)
        {
            US_CM_DM_TU_DIEN v_us_dm_tu_dien = new US_CM_DM_TU_DIEN();
            DS_CM_DM_TU_DIEN v_ds_dm_tu_dien = new DS_CM_DM_TU_DIEN();
            string v_str_loai_trang_thai = MA_LOAI_TU_DIEN.LY_DO_TANG_GIAM_TS;
            string v_str_loai_tg = "";

            switch (ip_e_loai)
            {
                case eLOAI_TANG_GIAM_TAI_SAN.GIAM_TAI_SAN:
                    v_str_loai_tg = "G";
                    break;
                case eLOAI_TANG_GIAM_TAI_SAN.TANG_TAI_SAN:
                    v_str_loai_tg = "T";
                    break;
            }

            string v_str_query = "WHERE GHI_CHU LIKE N'%" + v_str_loai_tg + "%'"
                + " AND ID_LOAI_TU_DIEN IN"
                + " (SELECT ID FROM CM_DM_LOAI_TD WHERE MA_LOAI = '" + v_str_loai_trang_thai + "')";

            v_us_dm_tu_dien.FillDataset(v_ds_dm_tu_dien, v_str_query);
            ip_obj_cbo_trang_thai.DataSource = v_ds_dm_tu_dien.CM_DM_TU_DIEN;
            ip_obj_cbo_trang_thai.DataTextField = CM_DM_TU_DIEN.TEN;
            ip_obj_cbo_trang_thai.DataValueField = CM_DM_TU_DIEN.ID;
            ip_obj_cbo_trang_thai.DataBind();
        }
        public static void load_data_to_cbo_trang_thai_tang_giam(
            eLOAI_TU_DIEN ip_e_trang_thai_tai_san
            , eTAT_CA ip_e_tat_ca
            , DropDownList ip_obj_cbo_trang_thai)
        {
            US_CM_DM_TU_DIEN v_us_dm_tu_dien = new US_CM_DM_TU_DIEN();
            DS_CM_DM_TU_DIEN v_ds_dm_tu_dien = new DS_CM_DM_TU_DIEN();
            string v_str_loai_trang_thai = "";
            switch (ip_e_trang_thai_tai_san)
            {
                case eLOAI_TU_DIEN.TRANG_THAI_DAT:
                    v_str_loai_trang_thai = MA_LOAI_TU_DIEN.TRANG_THAI_DAT;
                    break;
                case eLOAI_TU_DIEN.TRANG_THAI_NHA:
                    v_str_loai_trang_thai = MA_LOAI_TU_DIEN.TRANG_THAI_NHA;
                    break;
                case eLOAI_TU_DIEN.TRANG_THAI_OTO:
                    v_str_loai_trang_thai = MA_LOAI_TU_DIEN.TRANG_THAI_OTO;
                    break;
                case eLOAI_TU_DIEN.TRANG_THAI_TAI_SAN_KHAC:
                    v_str_loai_trang_thai = MA_LOAI_TU_DIEN.TRANG_THAI_TAI_SAN_KHAC;
                    break;
            }

            string v_str_query = "WHERE GHI_CHU LIKE N'%2%'"
                + " AND ID_LOAI_TU_DIEN IN"
                + " (SELECT ID FROM CM_DM_LOAI_TD WHERE MA_LOAI = '" + v_str_loai_trang_thai + "')" ;

            v_us_dm_tu_dien.FillDataset(v_ds_dm_tu_dien, v_str_query);
            ip_obj_cbo_trang_thai.DataSource = v_ds_dm_tu_dien.CM_DM_TU_DIEN;
            ip_obj_cbo_trang_thai.DataTextField = CM_DM_TU_DIEN.TEN;
            ip_obj_cbo_trang_thai.DataValueField = CM_DM_TU_DIEN.ID;
            ip_obj_cbo_trang_thai.DataBind();
            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                ip_obj_cbo_trang_thai.Items.Insert(0, new ListItem(CONST_QLDB.TAT_CA, CONST_QLDB.ID_TAT_CA.ToString()));
            }
        }
        public static void load_data_to_ddl_loai_nhiem_vu(DropDownList op_ddl)
        {
            US_CM_DM_TU_DIEN v_us = new US_CM_DM_TU_DIEN();
            DS_CM_DM_TU_DIEN v_ds = new DS_CM_DM_TU_DIEN();
            v_us.FillDataset(v_ds, "where " + CM_DM_TU_DIEN.ID_LOAI_TU_DIEN + "=" + ID_LOAI_TU_DIEN.LOAI_NHIEM_VU_NS +
                "order by " + CM_DM_TU_DIEN.GHI_CHU);
            string v_str_data_default = "---Chọn loại nhiệm vụ---";

            for (int i = 0; i < v_ds.CM_DM_TU_DIEN.Count; i++)
            {
                v_ds.Tables[0].Rows[i][CM_DM_TU_DIEN.TEN] = v_ds.Tables[0].Rows[i][CM_DM_TU_DIEN.GHI_CHU].ToString() + " - " +
                    v_ds.Tables[0].Rows[i][CM_DM_TU_DIEN.TEN];
                v_ds.AcceptChanges();
            }
            op_ddl.DataTextField = CM_DM_TU_DIEN.TEN;
            op_ddl.DataValueField = CM_DM_TU_DIEN.ID;
            op_ddl.DataSource = v_ds.CM_DM_TU_DIEN;
            op_ddl.DataBind();
            op_ddl.Items.Insert(0, new ListItem(v_str_data_default, "-1"));
        }
        public static void load_data_to_ddl_loai_nhiem_vu(DropDownList op_ddl, bool ip_b_is_nguon_ns, bool ip_b_is_chi_du_an)
        {
            /*
             * Tác dụng: Load dữ liệu Loại nhiệm vụ theo điều kiện sau:
                 * 1. Nguồn Quỹ BT
                 * - Chi Dự án: Dữ liệu A - Bảo dưỡng..., B - Sửa chữa định kỳ, C -.., D -..., E - ..., F - Văn phòng cục
                 * - Chi theo CLKM: như Chi Dự án, mặc định chọn F - Văn phòng Cục
                 * 2. Nguồn Ngân Sách
                 * - Chi Dự án: A - ..., B - ..., C -..., D - ..., E - ..., F - ...
                 * - Chi theo CLKM: I - Thu, chi, nộp ngân sách phí, lệ phí; II - Dự toán chi ngân sách nhà nước;
                 * Mặc định chọn II và không cho chọn option khác
             * Giải pháp:
                 * 1. Fill data vào dataset theo điều kiện trên
                 * 2. Convert lại dữ liệu: ghép tên: Sửa chữa thường xuyên, ghi chú: A -> A - Sửa chữa thường xuyên
                 * 3. Fill data vào dropdownlist
                 * 4. Đặt giá trị mặc định cho dropdownlist
             */
            US_CM_DM_TU_DIEN v_us = new US_CM_DM_TU_DIEN();
            DS_CM_DM_TU_DIEN v_ds = new DS_CM_DM_TU_DIEN();

            //1. Fill data vào dataset
            if (ip_b_is_chi_du_an)//Chi Dự án
            {
                v_us.FillDataset(v_ds, "where " + CM_DM_TU_DIEN.ID_LOAI_TU_DIEN + "=" + ID_LOAI_TU_DIEN.LOAI_NHIEM_VU +
                "order by " + CM_DM_TU_DIEN.GHI_CHU);
            }
            else//Chi theo CLKM - Chương Loại Khoản Mục
            {
                if (!ip_b_is_nguon_ns)//Nguồn Quỹ BT
                {
                    v_us.FillDataset(v_ds, "where " + CM_DM_TU_DIEN.ID_LOAI_TU_DIEN + "=" + ID_LOAI_TU_DIEN.LOAI_NHIEM_VU +
                "order by " + CM_DM_TU_DIEN.GHI_CHU);
                }
                else//Nguồn Ngân sách
                {
                    v_us.FillDataset(v_ds, "where " + CM_DM_TU_DIEN.ID_LOAI_TU_DIEN + "=" + ID_LOAI_TU_DIEN.LOAI_NHIEM_VU_NS +
                "order by " + CM_DM_TU_DIEN.GHI_CHU);
                }

            }
            //2. Convert dữ liệu
            string v_str_data_default = "---Chọn loại nhiệm vụ---";

            for (int i = 0; i < v_ds.CM_DM_TU_DIEN.Count; i++)
            {
                v_ds.Tables[0].Rows[i][CM_DM_TU_DIEN.TEN] = v_ds.Tables[0].Rows[i][CM_DM_TU_DIEN.GHI_CHU].ToString() + " - " +
                    v_ds.Tables[0].Rows[i][CM_DM_TU_DIEN.TEN];
                v_ds.AcceptChanges();
            }
            //3. Fill dữ liệu vào dropdownlist
            op_ddl.DataTextField = CM_DM_TU_DIEN.TEN;
            op_ddl.DataValueField = CM_DM_TU_DIEN.ID;
            op_ddl.DataSource = v_ds.CM_DM_TU_DIEN;
            op_ddl.DataBind();
            op_ddl.Items.Insert(0, new ListItem(v_str_data_default, "-1"));
            op_ddl.Enabled = true;
            //4. Đặt giá trị mặc định cho dropdownlist
            if (!ip_b_is_chi_du_an)//Chi theo CLKM
                if (!ip_b_is_nguon_ns)//Nguồn Quỹ BT
                {
                    //op_ddl.SelectedValue = ID_LOAI_NHIEM_VU.VAN_PHONG_CUC.ToString();
                }
                else
                {
                    op_ddl.SelectedValue = ID_LOAI_NHIEM_VU_NS.DU_TOAN_CHI_NS_NN.ToString();
                    op_ddl.Enabled = false;
                }
        }