public static void load_data_to_cbo_bo_tinh(
            eTAT_CA ip_e_tat_ca
            , ComboBox ip_obj_cbo_bo_tinh)
        {
            US_DM_DON_VI v_us_dm_don_vi = new US_DM_DON_VI();
            DS_DM_DON_VI v_ds_dm_don_vi = new DS_DM_DON_VI();

            //v_us_dm_don_vi.FillDataset(v_ds_dm_don_vi, "where ID_LOAI_DON_VI = " + ID_LOAI_DON_VI.BO_TINH);
            string v_str_user_name = HttpContext.Current.Session[SESSION.UserName].ToString();
            v_us_dm_don_vi.FillDataset(
                v_ds_dm_don_vi
                , ID_LOAI_DON_VI.BO_TINH

                , CONST_QLDB.ID_TAT_CA
                , CONST_QLDB.ID_TAT_CA
                , v_str_user_name);
            if (ip_e_tat_ca == eTAT_CA.YES) {
                DataRow v_dr = v_ds_dm_don_vi.DM_DON_VI.NewDM_DON_VIRow();
                v_dr[DM_DON_VI.ID] = CONST_QLDB.ID_TAT_CA;
                v_dr[DM_DON_VI.TEN_DON_VI] = CONST_QLDB.TAT_CA;

                v_ds_dm_don_vi.DM_DON_VI.Rows.InsertAt(v_dr, 0);
            }
            ip_obj_cbo_bo_tinh.DataSource = v_ds_dm_don_vi.DM_DON_VI;
            ip_obj_cbo_bo_tinh.DisplayMember = DM_DON_VI.TEN_DON_VI;
            ip_obj_cbo_bo_tinh.ValueMember = DM_DON_VI.ID;
        }
        public static void load_data_to_cbo_bo_tinh(
            eTAT_CA ip_e_tat_ca
            , DropDownList ip_obj_cbo_bo_tinh)
        {
            US_DM_DON_VI v_us_dm_don_vi = new US_DM_DON_VI();
            DS_DM_DON_VI v_ds_dm_don_vi = new DS_DM_DON_VI();

            //v_us_dm_don_vi.FillDataset(v_ds_dm_don_vi, "where ID_LOAI_DON_VI = " + ID_LOAI_DON_VI.BO_TINH);
            string v_str_user_name = HttpContext.Current.Session[SESSION.UserName].ToString();
            v_us_dm_don_vi.FillDataset(
                v_ds_dm_don_vi
                , ID_LOAI_DON_VI.BO_TINH

                , CONST_QLDB.ID_TAT_CA
                , CONST_QLDB.ID_TAT_CA
                , v_str_user_name);

            ip_obj_cbo_bo_tinh.DataSource = v_ds_dm_don_vi.DM_DON_VI;
            ip_obj_cbo_bo_tinh.DataTextField = DM_DON_VI.TEN_DON_VI;
            ip_obj_cbo_bo_tinh.DataValueField = DM_DON_VI.ID;
            ip_obj_cbo_bo_tinh.DataBind();
            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                ip_obj_cbo_bo_tinh.Items.Insert(0, new ListItem(CONST_QLDB.TAT_CA, CONST_QLDB.ID_TAT_CA.ToString()));
            }
        }
        public static void load_data_to_cbo_tu_dien(
            eLOAI_TU_DIEN ip_e
            , eTAT_CA ip_e_tat_ca
            , ComboBox ip_obj_cbo_trang_thai)
        {
            IP.Core.IPUserService.US_CM_DM_TU_DIEN v_us_dm_tu_dien = new IP.Core.IPUserService.US_CM_DM_TU_DIEN();
            IP.Core.IPData.DS_CM_DM_TU_DIEN v_ds_dm_tu_dien = new IP.Core.IPData.DS_CM_DM_TU_DIEN();
            string v_str_loai_tu_dien = "";
            switch (ip_e)
            {
                case eLOAI_TU_DIEN.TRANG_THAI_CHUC_VU:
                    v_str_loai_tu_dien = MA_LOAI_TU_DIEN.TRANG_THAI_CHUC_VU;
                    break;
                case eLOAI_TU_DIEN.LOAI_HOP_DONG:
                    v_str_loai_tu_dien = MA_LOAI_TU_DIEN.LOAI_HOP_DONG;
                    break;
                case eLOAI_TU_DIEN.LOAI_DON_VI:
                    v_str_loai_tu_dien = MA_LOAI_TU_DIEN.LOAI_DON_VI;
                    break;
                case eLOAI_TU_DIEN.CAP_DON_VI:
                    v_str_loai_tu_dien = MA_LOAI_TU_DIEN.CAP_DON_VI;
                    break;
                case eLOAI_TU_DIEN.LOAI_QUYET_DINH:
                    v_str_loai_tu_dien = MA_LOAI_TU_DIEN.LOAI_QUYET_DINH;
                    break;
                case eLOAI_TU_DIEN.TRANG_THAI_LAO_DONG:
                    v_str_loai_tu_dien = MA_LOAI_TU_DIEN.TRANG_THAI_LAO_DONG;
                    break;
                case eLOAI_TU_DIEN.DM_CA_HOC:
                    v_str_loai_tu_dien = MA_LOAI_TU_DIEN.DM_CA_HOC;
                    break;
            }
            v_us_dm_tu_dien.fill_tu_dien_cung_loai_ds(
                v_str_loai_tu_dien
                , CM_DM_TU_DIEN.GHI_CHU
                , v_ds_dm_tu_dien);

            ip_obj_cbo_trang_thai.DataSource = v_ds_dm_tu_dien.CM_DM_TU_DIEN;
            ip_obj_cbo_trang_thai.DisplayMember = CM_DM_TU_DIEN.TEN;
            ip_obj_cbo_trang_thai.ValueMember = CM_DM_TU_DIEN.ID;

            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                DataRow v_dr = v_ds_dm_tu_dien.CM_DM_TU_DIEN.NewRow();
                v_dr[CM_DM_TU_DIEN.ID] = -1;
                v_dr[CM_DM_TU_DIEN.TEN] = "------ Tất cả ------";
                v_dr[CM_DM_TU_DIEN.MA_TU_DIEN] = "";
                v_dr[CM_DM_TU_DIEN.TEN_NGAN] = "";
                v_dr[CM_DM_TU_DIEN.ID_LOAI_TU_DIEN] = 1;
                v_dr[CM_DM_TU_DIEN.GHI_CHU] = "";
                v_ds_dm_tu_dien.CM_DM_TU_DIEN.Rows.InsertAt(v_dr, 0);
                ip_obj_cbo_trang_thai.SelectedIndex = 0;
            }
        }
Beispiel #4
0
        public static void load_data_to_cbo_tu_dien(
            eLOAI_TU_DIEN ip_e_trang_thai_chuc_vu
            , eTAT_CA ip_e_tat_ca
            , ComboBox 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_tu_dien = "";

            switch (ip_e_trang_thai_chuc_vu)
            {
            case eLOAI_TU_DIEN.TRANG_THAI_CHUC_VU:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.TRANG_THAI_CHUC_VU;
                break;

            case eLOAI_TU_DIEN.LOAI_HOP_DONG:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.LOAI_HOP_DONG;
                break;

            case eLOAI_TU_DIEN.LOAI_DON_VI:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.LOAI_DON_VI;
                break;

            case eLOAI_TU_DIEN.CAP_DON_VI:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.CAP_DON_VI;
                break;
            }
            v_us_dm_tu_dien.fill_tu_dien_cung_loai_ds(
                v_str_loai_tu_dien
                , CM_DM_TU_DIEN.GHI_CHU
                , v_ds_dm_tu_dien);

            ip_obj_cbo_trang_thai.DataSource    = v_ds_dm_tu_dien.CM_DM_TU_DIEN;
            ip_obj_cbo_trang_thai.DisplayMember = CM_DM_TU_DIEN.TEN;
            ip_obj_cbo_trang_thai.ValueMember   = CM_DM_TU_DIEN.ID;

            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                DataRow v_dr = v_ds_dm_tu_dien.CM_DM_TU_DIEN.NewRow();
                v_dr[CM_DM_TU_DIEN.ID]              = -1;
                v_dr[CM_DM_TU_DIEN.TEN]             = "------ Tất cả ------";
                v_dr[CM_DM_TU_DIEN.MA_TU_DIEN]      = "";
                v_dr[CM_DM_TU_DIEN.TEN_NGAN]        = "";
                v_dr[CM_DM_TU_DIEN.ID_LOAI_TU_DIEN] = 1;
                v_dr[CM_DM_TU_DIEN.GHI_CHU]         = "";
                v_ds_dm_tu_dien.CM_DM_TU_DIEN.Rows.InsertAt(v_dr, 0);
                ip_obj_cbo_trang_thai.SelectedIndex = 0;
            }
        }
 public static void load_data_to_cbo_loai_hinh_don_vi(
     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 = "";
     v_str_loai_trang_thai = MA_LOAI_TU_DIEN.LOAI_HINH_DON_VI;
     v_us_dm_tu_dien.fill_tu_dien_cung_loai_ds(
         v_str_loai_trang_thai
         , CM_DM_TU_DIEN.GHI_CHU
         , v_ds_dm_tu_dien);
     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.MA_TU_DIEN;
     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_cbo_don_vi_su_dung_theo_loai_hinh(
            string ip_str_loai_hinh_don_vi
            , string ip_str_id_don_vi_chu_quan
            , string ip_str_id_bo_tinh
            , eTAT_CA ip_e_tat_ca
            , DropDownList ip_obj_cbo_dv_su_dung
            )
        {
            if (ip_str_id_bo_tinh.Length == 0)
            {
                ip_obj_cbo_dv_su_dung.Items.Clear();
                return;
            }
            if (ip_str_id_don_vi_chu_quan.Length == 0)
            {
                ip_obj_cbo_dv_su_dung.Items.Clear();
                return;
            }

            US_DM_DON_VI v_us_dm_don_vi = new US_DM_DON_VI();
            DS_DM_DON_VI v_ds_dm_don_vi = new DS_DM_DON_VI();

            string v_str_user_name = HttpContext.Current.Session[SESSION.UserName].ToString();
            if (!Person.check_session_valid()) return;
            decimal v_dc_id_don_vi_chu_quan = CIPConvert.ToDecimal(ip_str_id_don_vi_chu_quan);
            decimal v_dc_id_bo_tinh = CIPConvert.ToDecimal(ip_str_id_bo_tinh);
            v_us_dm_don_vi.FillDataset(
                v_ds_dm_don_vi
                , ID_LOAI_DON_VI.DV_SU_DUNG
                , v_dc_id_don_vi_chu_quan
                , v_dc_id_bo_tinh
                , ip_str_loai_hinh_don_vi
                , v_str_user_name);
            ip_obj_cbo_dv_su_dung.DataSource = v_ds_dm_don_vi.DM_DON_VI;
            ip_obj_cbo_dv_su_dung.DataTextField = DM_DON_VI.TEN_DON_VI;
            ip_obj_cbo_dv_su_dung.DataValueField = DM_DON_VI.ID;
            ip_obj_cbo_dv_su_dung.DataBind();

            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                ip_obj_cbo_dv_su_dung.Items.Insert(0, new ListItem(CONST_QLDB.TAT_CA, CONST_QLDB.ID_TAT_CA.ToString()));
            }
        }
        public static void load_data_to_cbo_don_vi_chu_quan(
            string ip_str_id_bo_tinh
            , eTAT_CA ip_e_tat_ca
            , DropDownList ip_obj_cbo_dv_chu_quan)
        {
            US_DM_DON_VI v_us_dm_don_vi = new US_DM_DON_VI();
            DS_DM_DON_VI v_ds_dm_don_vi = new DS_DM_DON_VI();

            if (ip_str_id_bo_tinh.Length == 0)
            {
                ip_obj_cbo_dv_chu_quan.Items.Clear();
                return;
            }

            string v_str_user_name = HttpContext.Current.Session[SESSION.UserName].ToString();
            decimal v_dc_id_bo_tinh = CIPConvert.ToDecimal(ip_str_id_bo_tinh);
            v_us_dm_don_vi.FillDataset(
                v_ds_dm_don_vi
                , ID_LOAI_DON_VI.DV_CHU_QUAN

                , v_dc_id_bo_tinh
                , CONST_QLDB.ID_TAT_CA
                , v_str_user_name);

            ip_obj_cbo_dv_chu_quan.DataSource = v_ds_dm_don_vi.DM_DON_VI;
            ip_obj_cbo_dv_chu_quan.DataTextField = DM_DON_VI.TEN_DON_VI;
            ip_obj_cbo_dv_chu_quan.DataValueField = DM_DON_VI.ID;
            ip_obj_cbo_dv_chu_quan.DataBind();
            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                ip_obj_cbo_dv_chu_quan.Items.Insert(0, new ListItem(CONST_QLDB.TAT_CA, CONST_QLDB.ID_TAT_CA.ToString()));
            }
        }
        public static void load_data_to_cbo_tu_dien(
            eLOAI_TU_DIEN ip_e
            , eTAT_CA ip_e_tat_ca
            , ComboBox ip_obj_cbo_trang_thai)
        {
            IP.Core.IPUserService.US_CM_DM_TU_DIEN v_us_dm_tu_dien = new IP.Core.IPUserService.US_CM_DM_TU_DIEN();
            IP.Core.IPData.DS_CM_DM_TU_DIEN        v_ds_dm_tu_dien = new IP.Core.IPData.DS_CM_DM_TU_DIEN();
            string v_str_loai_tu_dien = "";

            switch (ip_e)
            {
            case eLOAI_TU_DIEN.TRANG_THAI_CHUC_VU:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.TRANG_THAI_CHUC_VU;
                break;

            case eLOAI_TU_DIEN.LOAI_HOP_DONG:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.LOAI_HOP_DONG;
                break;

            case eLOAI_TU_DIEN.LOAI_DON_VI:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.LOAI_DON_VI;
                break;

            case eLOAI_TU_DIEN.CAP_DON_VI:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.CAP_DON_VI;
                break;

            case eLOAI_TU_DIEN.LOAI_QUYET_DINH:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.LOAI_QUYET_DINH;
                break;

            case eLOAI_TU_DIEN.TRANG_THAI_LAO_DONG:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.TRANG_THAI_LAO_DONG;
                break;

            case eLOAI_TU_DIEN.NGACH:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.NGACH;
                break;

            case eLOAI_TU_DIEN.LOAI_CHUC_VU:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.LOAI_CHUC_VU;
                break;

            case eLOAI_TU_DIEN.TRANG_THAI_HOP_DONG:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.TRANG_THAI_HOP_DONG;
                break;

            case eLOAI_TU_DIEN.TRANG_THAI_DU_AN:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.TRANG_THAI_DU_AN;
                break;

            case eLOAI_TU_DIEN.MA_HOP_DONG:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.MA_HOP_DONG;
                break;

            case eLOAI_TU_DIEN.DANH_HIEU:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.DANH_HIEU;
                break;

            case eLOAI_TU_DIEN.CO_CHE:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.CO_CHE;
                break;

            case eLOAI_TU_DIEN.LOAI_DU_AN:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.LOAI_DU_AN;
                break;

            case eLOAI_TU_DIEN.MA_QUYET_DINH:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.MA_QUYET_DINH;
                break;

            case eLOAI_TU_DIEN.DIA_BAN:
                v_str_loai_tu_dien = MA_LOAI_TU_DIEN.DIA_BAN;
                break;
            }
            v_us_dm_tu_dien.fill_tu_dien_cung_loai_ds(
                v_str_loai_tu_dien
                , CM_DM_TU_DIEN.GHI_CHU
                , v_ds_dm_tu_dien);


            ip_obj_cbo_trang_thai.DisplayMember = CM_DM_TU_DIEN.TEN;
            ip_obj_cbo_trang_thai.ValueMember   = CM_DM_TU_DIEN.ID;
            ip_obj_cbo_trang_thai.DataSource    = v_ds_dm_tu_dien.CM_DM_TU_DIEN;
            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                DataRow v_dr = v_ds_dm_tu_dien.CM_DM_TU_DIEN.NewRow();
                v_dr[CM_DM_TU_DIEN.ID]              = -1;
                v_dr[CM_DM_TU_DIEN.TEN]             = "------ Tất cả ------";
                v_dr[CM_DM_TU_DIEN.MA_TU_DIEN]      = "";
                v_dr[CM_DM_TU_DIEN.TEN_NGAN]        = "";
                v_dr[CM_DM_TU_DIEN.ID_LOAI_TU_DIEN] = 1;
                v_dr[CM_DM_TU_DIEN.GHI_CHU]         = "";
                v_ds_dm_tu_dien.CM_DM_TU_DIEN.Rows.InsertAt(v_dr, 0);
                ip_obj_cbo_trang_thai.SelectedIndex = 0;
            }
        }
        public static void load_data_to_cbo_tu_dien(
            string ip_str_ma_loai_tu_dien
            , 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();

            v_us_dm_tu_dien.fill_tu_dien_cung_loai_ds(
                ip_str_ma_loai_tu_dien
                , CM_DM_TU_DIEN.GHI_CHU
                , v_ds_dm_tu_dien);

            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_GIAO_DICH.STR_VALUE_TAT_CA, CONST_GIAO_DICH.ID_TAT_CA.ToString()));
            }
        }
        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_cbo_dia_chi(
     decimal ip_dc_bo_tinh
     , decimal ip_dc_id_don_vi_chu_quan
     , decimal ip_dc_id_don_vi_su_dung
     , decimal ip_dc_id_trang_thai_dat
     , eTAT_CA ip_e_tat_ca
     , DropDownList op_obj_cbo_dia_chi_dat)
 {
     DS_DM_DAT v_ds_dm_dat = new DS_DM_DAT();
     US_DM_DAT v_us_dm_dat = new US_DM_DAT();
     string v_str_user_name = HttpContext.Current.Session[SESSION.UserName].ToString();
     v_us_dm_dat.FillDatasetByID_DonVi(
         ip_dc_bo_tinh
         , ip_dc_id_don_vi_chu_quan
         , ip_dc_id_don_vi_su_dung
         , ip_dc_id_trang_thai_dat
         , v_str_user_name
         , v_ds_dm_dat);
     op_obj_cbo_dia_chi_dat.DataSource = v_ds_dm_dat.DM_DAT;
     op_obj_cbo_dia_chi_dat.DataTextField = DM_DAT.DIA_CHI;
     op_obj_cbo_dia_chi_dat.DataValueField = DM_DAT.ID;
     op_obj_cbo_dia_chi_dat.DataBind();
     if (ip_e_tat_ca == eTAT_CA.YES)
     {
         op_obj_cbo_dia_chi_dat.Items.Insert(0, new ListItem(CONST_QLDB.TAT_CA, CONST_QLDB.ID_TAT_CA.ToString()));
     }
 }
        public static void load_data_to_cbo_cong_trinh_du_an(
            decimal ip_dc_id_don_vi
            , decimal ip_id_cong_trinh
            , decimal ip_dc_id_loai_nhiem_vu
            , eTAT_CA ip_e_tat_ca
            , DropDownList ip_obj_cbo_cong_trinh_du_an_goi_thau)
        {
            US_DM_CONG_TRINH_DU_AN_GOI_THAU v_us_dm_cong_trinh_du_an_goi_thau = new US_DM_CONG_TRINH_DU_AN_GOI_THAU();
            DS_DM_CONG_TRINH_DU_AN_GOI_THAU v_ds_dm_cong_trinh_du_an_goi_thau = new DS_DM_CONG_TRINH_DU_AN_GOI_THAU();

            string v_str_user_name = HttpContext.Current.Session[SESSION.UserName].ToString();

            v_us_dm_cong_trinh_du_an_goi_thau.loadDanhMucDuanTheoCongTrinhVaLoaiNhiemVu(
                v_ds_dm_cong_trinh_du_an_goi_thau
                , ip_dc_id_don_vi
                , ip_id_cong_trinh
            , ip_dc_id_loai_nhiem_vu);

            DataView v_dv_quyet_dinh = v_ds_dm_cong_trinh_du_an_goi_thau.DM_CONG_TRINH_DU_AN_GOI_THAU.DefaultView;
            v_dv_quyet_dinh.Sort = DM_CONG_TRINH_DU_AN_GOI_THAU.TEN + " ASC";

            ip_obj_cbo_cong_trinh_du_an_goi_thau.DataSource = v_dv_quyet_dinh.ToTable();
            ip_obj_cbo_cong_trinh_du_an_goi_thau.DataTextField = DM_CONG_TRINH_DU_AN_GOI_THAU.TEN;
            ip_obj_cbo_cong_trinh_du_an_goi_thau.DataValueField = DM_CONG_TRINH_DU_AN_GOI_THAU.ID;
            ip_obj_cbo_cong_trinh_du_an_goi_thau.DataBind();

            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                ip_obj_cbo_cong_trinh_du_an_goi_thau.Items.Insert(0, new ListItem(CONST_GIAO_DICH.STR_VALUE_TAT_CA, CONST_GIAO_DICH.ID_TAT_CA.ToString()));
            }
        }
        public static void load_data_to_cbo_don_vi_su_dung(
            decimal ip_dc_id_don_vi_chu_quan
            , decimal ip_dc_id_bo_tinh
            , eTAT_CA ip_e_tat_ca
            , ComboBox ip_obj_cbo_dv_su_dung)
        {
            if (ip_dc_id_bo_tinh == 0) {
                    ip_obj_cbo_dv_su_dung.Items.Clear();
                    return;
                }
                if (ip_dc_id_don_vi_chu_quan == 0) {
                    ip_obj_cbo_dv_su_dung.Items.Clear();
                    return;
                }

            US_DM_DON_VI v_us_dm_don_vi = new US_DM_DON_VI();
            DS_DM_DON_VI v_ds_dm_don_vi = new DS_DM_DON_VI();

            string v_str_user_name = HttpContext.Current.Session[SESSION.UserName].ToString();

            v_us_dm_don_vi.FillDataset(
                v_ds_dm_don_vi
                , ID_LOAI_DON_VI.DV_SU_DUNG

                , ip_dc_id_don_vi_chu_quan
                , ip_dc_id_bo_tinh
                , v_str_user_name);

            if (ip_e_tat_ca == eTAT_CA.YES) {
                DataRow v_dr = v_ds_dm_don_vi.DM_DON_VI.NewDM_DON_VIRow();
                v_dr[DM_DON_VI.ID] = CONST_QLDB.ID_TAT_CA;
                v_dr[DM_DON_VI.TEN_DON_VI] = CONST_QLDB.TAT_CA;

                v_ds_dm_don_vi.DM_DON_VI.Rows.InsertAt(v_dr, 0);
            }

            ip_obj_cbo_dv_su_dung.DataSource = v_ds_dm_don_vi.DM_DON_VI;
            ip_obj_cbo_dv_su_dung.DisplayMember = DM_DON_VI.TEN_DON_VI;
            ip_obj_cbo_dv_su_dung.ValueMember = DM_DON_VI.ID;
        }
        public static void load_data_to_combobox(string ip_str_table_name, string ip_str_value_field, string ip_str_display_field, string ip_str_condition, eTAT_CA ip_e_tat_ca,ComboBox ip_cbo)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet v_ds = new DataSet();
            DataTable v_dt = new DataTable();
            v_ds.Tables.Add(v_dt);
            v_us.FillDatasetCBO(v_ds, ip_str_table_name, ip_str_value_field, ip_str_display_field, ip_str_condition);

            ip_cbo.DisplayMember = ip_str_display_field;
            ip_cbo.ValueMember = ip_str_value_field;
            ip_cbo.DataSource = v_ds.Tables[0];

            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                DataRow v_dr = v_ds.Tables[0].NewRow();
                v_dr[0] = -1;
                v_dr[1] = "------------Hãy chọn-----------";
                v_ds.Tables[0].Rows.InsertAt(v_dr, 0);
                ip_cbo.SelectedIndex = 0;
            }
            else
            {
                ip_cbo.SelectedIndex = 0;
            }
        }
Beispiel #15
0
        public static void load_data_to_combobox_with_query(ComboBox ip_cbo, string ip_str_value_field, string ip_str_display_field, eTAT_CA ip_e_tat_ca, string ip_query)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet       v_ds = new DataSet();
            DataTable     v_dt = new DataTable();

            v_ds.Tables.Add(v_dt);
            v_us.FillDatasetWithQuery(v_ds, ip_query);

            ip_cbo.DisplayMember = ip_str_display_field;
            ip_cbo.ValueMember   = ip_str_value_field;
            ip_cbo.DataSource    = v_ds.Tables[0];

            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                DataRow v_dr = v_ds.Tables[0].NewRow();
                v_dr[0] = -1;
                v_dr[1] = "---------- Hãy chọn ----------";
                v_ds.Tables[0].Rows.InsertAt(v_dr, 0);
                ip_cbo.SelectedIndex = 0;
            }
            else if (ip_e_tat_ca == eTAT_CA.TAT_CA)
            {
                DataRow v_dr = v_ds.Tables[0].NewRow();
                v_dr[0] = -1;
                v_dr[1] = "Tất cả";
                v_ds.Tables[0].Rows.InsertAt(v_dr, 0);
                ip_cbo.SelectedIndex = 0;
            }
            else
            {
                ip_cbo.SelectedIndex = 0;
            }
        }
        public static void load_data_to_cbo_tu_dien(
            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;
                case eLOAI_TU_DIEN.LOAI_HINH_DON_VI:
                    v_str_loai_trang_thai = MA_LOAI_TU_DIEN.LOAI_HINH_DON_VI;
                    break;
                case eLOAI_TU_DIEN.PHAN_LOAI_TAI_SAN:
                    v_str_loai_trang_thai = MA_LOAI_TU_DIEN.PHAN_LOAI_TAI_SAN;
                    break;
                case eLOAI_TU_DIEN.LOAI_BAO_CAO:
                    v_str_loai_trang_thai = MA_LOAI_TU_DIEN.LOAI_BAO_CAO;
                    break;
                case eLOAI_TU_DIEN.TINH_TRANG_TAI_SAN:
                    v_str_loai_trang_thai = MA_LOAI_TU_DIEN.TINH_TRANG_TAI_SAN;
                    break;
                case eLOAI_TU_DIEN.LY_DO_TANG_GIAM_TS:
                    v_str_loai_trang_thai = MA_LOAI_TU_DIEN.LY_DO_TANG_GIAM_TS;
                    break;
            }
            v_us_dm_tu_dien.fill_tu_dien_cung_loai_ds(
                v_str_loai_trang_thai
                , CM_DM_TU_DIEN.GHI_CHU
                , v_ds_dm_tu_dien);

            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()));
            }
        }
        /// <summary>
        /// Đưa danh sách tất cả các đơn vị vào DropDownList
        /// </summary>
        /// <param name="?"></param>
        /// <param name="ip_e_tat_ca"></param>
        /// <param name="ip_obj_cbo_dv_su_dung"></param>
        public static void load_data_to_cbo_don_vi_su_dung(
            eTAT_CA ip_e_tat_ca
            , DropDownList ip_obj_cbo_dv_su_dung)
        {
            US_DM_DON_VI v_us_dm_don_vi = new US_DM_DON_VI();
            DS_DM_DON_VI v_ds_dm_don_vi = new DS_DM_DON_VI();

            string v_str_user_name = HttpContext.Current.Session[SESSION.UserName].ToString();

            v_us_dm_don_vi.FillDataset_Load_data_to_grid_danh_muc_don_vi(
                v_ds_dm_don_vi
                , ID_LOAI_DON_VI.DV_SU_DUNG
                , v_str_user_name);

            DataView v_dv_don_vi_su_dung = v_ds_dm_don_vi.DM_DON_VI.DefaultView;
            v_dv_don_vi_su_dung.Sort = DM_DON_VI.TEN_DON_VI + " ASC";

            ip_obj_cbo_dv_su_dung.DataSource = v_dv_don_vi_su_dung.ToTable();
            ip_obj_cbo_dv_su_dung.DataTextField = DM_DON_VI.TEN_DON_VI;
            ip_obj_cbo_dv_su_dung.DataValueField = DM_DON_VI.ID;
            ip_obj_cbo_dv_su_dung.DataBind();

            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                ip_obj_cbo_dv_su_dung.Items.Insert(0, new ListItem(CONST_GIAO_DICH.STR_VALUE_TAT_CA, CONST_GIAO_DICH.ID_TAT_CA.ToString()));
            }
        }
        /// <summary>
        /// Load danh sách các quyết định theo các tiêu chí vào DropDownList đơn vị
        /// </summary>
        /// <param name="ip_dc_id_don_vi"></param>
        /// <param name="ip_dc_id_loai_nhiem_vu"></param>
        /// <param name="ip_dc_id_cong_trinh"></param>
        /// <param name="ip_dc_id_du_an"></param>
        /// <param name="ip_dat_tu_ngay"></param>
        /// <param name="ip_dat_den_ngay"></param>
        /// <param name="ip_str_tu_khoa"></param>
        /// <param name="ip_e_tat_ca"></param>
        /// <param name="ip_obj_cbo_quyet_dinh"></param>
        public static void load_data_to_cbo_quyet_dinh(
            decimal ip_dc_id_don_vi
            , decimal ip_dc_id_loai_nhiem_vu
            , decimal ip_dc_id_cong_trinh
            , decimal ip_dc_id_du_an
            , DateTime ip_dat_tu_ngay
            , DateTime ip_dat_den_ngay
            , string ip_str_tu_khoa
            , eTAT_CA ip_e_tat_ca
            , string ip_str_proc
            , DropDownList ip_obj_cbo_quyet_dinh)
        {
            US_DM_QUYET_DINH v_us_dm_quyet_dinh = new US_DM_QUYET_DINH();
            DS_DM_QUYET_DINH v_ds_dm_quyet_dinh = new DS_DM_QUYET_DINH();
            DataSet v_ds = new DataSet();
            DataTable v_dt = new DataTable();
            v_ds.Tables.Add(v_dt);

            string v_str_user_name = HttpContext.Current.Session[SESSION.UserName].ToString();

            v_ds_dm_quyet_dinh.EnforceConstraints = false;
            v_us_dm_quyet_dinh.get_ds_quyet_dinh(
                                    v_ds
                                    , ip_dc_id_don_vi
                                    , ip_dc_id_loai_nhiem_vu
                                    , ip_dc_id_cong_trinh
                                    , ip_dc_id_du_an
                                    , ip_dat_tu_ngay
                                    , ip_dat_den_ngay
                                    , ip_str_tu_khoa
                                    , ip_str_proc
                                    );

            DataView v_dv_quyet_dinh = v_ds.Tables[0].DefaultView;

            ip_obj_cbo_quyet_dinh.DataSource = v_dv_quyet_dinh.ToTable();
            ip_obj_cbo_quyet_dinh.DataTextField = DM_QUYET_DINH.SO_QUYET_DINH;
            ip_obj_cbo_quyet_dinh.DataValueField = DM_QUYET_DINH.ID;
            ip_obj_cbo_quyet_dinh.DataBind();

            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                ip_obj_cbo_quyet_dinh.Items.Insert(0, new ListItem(CONST_TONG.TONG, CONST_GIAO_DICH.ID_TAT_CA.ToString()));
            }
        }
Beispiel #19
0
        public static void load_data_to_combobox_with_query(ComboBox ip_cbo, string ip_str_value_field, string ip_str_display_field, eTAT_CA ip_e_tat_ca, string ip_query)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet v_ds = new DataSet();
            DataTable v_dt = new DataTable();
            v_ds.Tables.Add(v_dt);
            v_us.FillDatasetWithQuery(v_ds, ip_query);

            ip_cbo.DisplayMember = ip_str_display_field;
            ip_cbo.ValueMember = ip_str_value_field;
            ip_cbo.DataSource = v_ds.Tables[0];

            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                DataRow v_dr = v_ds.Tables[0].NewRow();
                v_dr[0] = -1;
                v_dr[1] = "------ Tất cả ------";
                v_ds.Tables[0].Rows.InsertAt(v_dr, 0);
                ip_cbo.SelectedIndex = 0;
            }
            else
            {
                ip_cbo.SelectedIndex = 0;
            }
        }
Beispiel #20
0
        public static void load_data_to_combobox(string ip_str_table_name, string ip_str_value_field, string ip_str_display_field, string ip_str_condition, eTAT_CA ip_e_tat_ca, ComboBox ip_cbo)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet       v_ds = new DataSet();
            DataTable     v_dt = new DataTable();

            v_ds.Tables.Add(v_dt);
            v_us.FillDatasetCBO(v_ds, ip_str_table_name, ip_str_value_field, ip_str_display_field, ip_str_condition);

            ip_cbo.DisplayMember = ip_str_display_field;
            ip_cbo.ValueMember   = ip_str_value_field;
            ip_cbo.DataSource    = v_ds.Tables[0];

            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                DataRow v_dr = v_ds.Tables[0].NewRow();
                v_dr[0] = -1;
                v_dr[1] = "------ Tất cả ------";
                v_ds.Tables[0].Rows.InsertAt(v_dr, 0);
                ip_cbo.SelectedIndex = 0;
            }
            else
            {
                ip_cbo.SelectedIndex = 0;
            }
        }