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 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); }
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() });} }