Ejemplo n.º 1
0
 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});
         }
     }
 }
Ejemplo n.º 2
0
 public static void SetMuitiValues(PLMultiCombobox multi, string ids)
 {
     if (ids == null) { multi._setSelectedIDs(new long[] { }); return; }
     ids = ids.TrimStart(',').TrimEnd(',');
     long[] idArr = Array.ConvertAll<string, long>(ids.Split(','), HelpNumber.ParseInt64);
     multi._setSelectedIDs(idArr);
 }
Ejemplo n.º 3
0
        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() });}
        }