Beispiel #1
0
        public static void InitCtrl(PLMultiCombobox Input, bool? IsAdd)
        {
            string sql = string.Format(@"SELECT *
                           From {0}
                           where 1=1", TABLE_MAP);

            QueryBuilder query = new QueryBuilder(sql);
            if (IsAdd == true)
                query.addCondition("VISIBLE_BIT='Y'");
            query.setAscOrderBy("lower(NAME)");
            DataSet ds = HelpDB.getDatabase().LoadDataSet(query,TABLE_MAP);
            Input.DataSource = ds.Tables[0];
            Input.DisplayField = "NAME";
            Input.ValueField = "ID";
            Input._init();
        }
Beispiel #2
0
        public static void InitCtrlNhanVien(PLMultiCombobox input, bool? isAdd)
        {
            string sql = string.Format(@"SELECT *
                           From DM_NHAN_VIEN
                           where 1=1");

            var query = new QueryBuilder(sql);
            if (isAdd == true)
                query.addCondition("VISIBLE_BIT='Y'");
            query.setAscOrderBy("lower(NAME)");
            var ds = HelpDB.getDatabase().LoadDataSet(query, "DM_NHAN_VIEN");
            input.DataSource = ds.Tables[0];
            input.DisplayField = "NAME";
            input.ValueField = "ID";
            input._init();
        }
Beispiel #3
0
        public static void InitCtrlThuTrongTuan(PLMultiCombobox input)
        {
            string sql = string.Format(@"SELECT *
                           From DAY_OF_WEEK
                           where 1=1");

            var query = new QueryBuilder(sql);
            query.setAscOrderBy("ID");
            var ds = HelpDB.getDatabase().LoadDataSet(query, "DAY_OF_WEEK");
            input.DataSource = ds.Tables[0];
            input.DisplayField = "NAME";
            input.ValueField = "ID";
            input.UseSort = false;
            input._init();
            input.Properties.SelectAllItemCaption = "(Cả tuần)";
        }
Beispiel #4
0
        public static void InitCtrl(PLMultiCombobox Input, bool? IsAdd)
        {
            string sql = string.Format(@"SELECT *
                           From {0}
                           where 1=1", TABLE_MAP);

            QueryBuilder query = new QueryBuilder(sql);
            if (IsAdd == true)
            {
                query.addCondition("VISIBLE_BIT='Y'");
            }
            query.addID("CONG_TY", FrameworkParams.LoginCompanyID);
            query.setAscOrderBy("lower(NAME)");
            DataSet ds = HelpDB.getDatabase().LoadDataSet(query, TABLE_MAP);
            Input.UseSort = false;
            Input.DataSource = AppUtil.SortLogicalTable(ds.Tables[0], "NAME");
            Input.DisplayField = "NAME";
            Input.ValueField = "ID";
            Input._init();
        }
Beispiel #5
0
 public static void InitCtrlBudgetPlanState(PLMultiCombobox input)
 {
     var dt = new DataTable();
     dt.Columns.Add("ID", typeof(Int64));
     dt.Columns.Add("NAME");
     var ds = new DataSet();
     ds.Tables.Add(dt);
     dt.Rows.Add(BudgetPlanStatus.GENERAL, "Tổng quát");
     dt.Rows.Add(BudgetPlanStatus.DETAIL, "Chi tiết");
     dt.Rows.Add(BudgetPlanStatus.COMPLETE, "Hoàn thành");
     input.ValueField = "ID";
     input.DisplayField = "NAME";
     input.DataSource = dt;
     input._init();
 }
 public static void InitCtrlLPS(PLMultiCombobox input, bool defaultValue)
 {
     string sql = string.Format(@"select  dth.*
     from {0} dth
     inner join (select distinct kenh_phat from  ql_lich_phat_song  ) lps on lps.kenh_phat=dth.id
     order by name", TABLE_MAP);
     DataSet ds = HelpDB.getDatabase().LoadDataSet(sql, TABLE_MAP);
     input.DataSource = ds.Tables[0];
     input.DisplayField = "NAME";
     input.ValueField = "ID";
     input._init();
     if (defaultValue)
     {
         var defaultkenhPhat = AppCtrl.GetDefaultKenhPhat();
         if (ds.Tables[0].Select("ID=" + defaultkenhPhat).Length > 0)
         {
             input._setSelectedIDs(new[] {defaultkenhPhat});
         }
     }
 }
 public static void InitCtrlKHLPS(PLMultiCombobox input, bool isDelete)
 {
     string sql = string.Format(@"select  dth.*
     from {0} dth
     inner join (select distinct kenh_phat from ke_hoach_lps lps where {1} ) lps on lps.kenh_phat=dth.id
     order by name", TABLE_MAP, isDelete ? " lps.is_delete='Y'" : "lps.is_delete='N' or lps.is_delete is null");
     DataSet ds = HelpDB.getDatabase().LoadDataSet(sql, TABLE_MAP);
     input.DataSource = ds.Tables[0];
     input.DisplayField = "NAME";
     input.ValueField = "ID";
     input._init();
 }
        public static void InitCtrl(PLMultiCombobox input, bool? isAdd, bool defaultValue)
        {
            string sql = string.Format(@"SELECT *
                           From {0}
                           where 1=1", TABLE_MAP);

            var query = new QueryBuilder(sql);
            if (isAdd == true)
                query.addCondition("VISIBLE_BIT='Y'");
            query.setAscOrderBy("lower(NAME)");
            DataSet ds = HelpDB.getDatabase().LoadDataSet(query, TABLE_MAP);
            input.DataSource = ds.Tables[0];
            input.DisplayField = "NAME";
            input.ValueField = "ID";
            input._init();
            if (defaultValue)
            {  input._setSelectedIDs(new[] { AppCtrl.GetDefaultKenhPhat() });}
        }
 private void InitVTUT(PLMultiCombobox Input, bool? IsAdd)
 {
     bool IsVisible = false;
     if (IsAdd == true) IsVisible = true;
     QueryBuilder query = null;
     if (IsVisible)
         query = new QueryBuilder("SELECT * FROM DM_VI_TRI_UNG_TUYEN where VISIBLE_BIT = 'Y' AND 1=1");
     else
         query = new QueryBuilder("SELECT * FROM DM_VI_TRI_UNG_TUYEN where 1=1");
     query.setAscOrderBy("NAME");
     DataSet ds = HelpDB.getDatabase().LoadReadOnlyDataSet(query);
     Input._init(ds.Tables[0], "NAME", "ID");
 }
Beispiel #10
0
 public static void InitCtrlKenhPhatKHPS(PLMultiCombobox input)
 {
     string sql = string.Format(@"select * from
                                 {0}   dth
                                 where exists(select first 1 1 from {1} ct
                                 where ct.{2}=dth.id) order by name",
                                DMDaiTruyenHinh.TABLE_MAP, KE_HOACH_LPS.TABLE_NAME,
                                KE_HOACH_LPS.KENH_PHAT);
     DataSet ds = HelpDB.getDatabase().LoadDataSet(sql, DMDaiTruyenHinh.TABLE_MAP);
     input.DataSource = ds.Tables[0];
     input.DisplayField = "NAME";
     input.ValueField = "ID";
     input._init();
 }