public static void LoadPosTenderTypeToCombo(ref ComboBox cbo) { string sql = "SELECT DISTINCT TypeCode FROM PosTenderType WHERE Retired = 0"; PosTenderTypeEx.LoadCombo(ref cbo, "TypeCode", false, false, "", sql); /** * SqlCommand cmd = new SqlCommand(); * cmd.CommandText = sql; * cmd.CommandTimeout = ConfigHelper.CommandTimeout; * cmd.CommandType = CommandType.Text; * * Common.ComboList comboList = new Common.ComboList(); * * using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(cmd)) * { * while (reader.Read()) * { * Common.ComboItem cboItem = new Common.ComboItem(reader.GetString(0), Guid.Empty); * * comboList.Add(cboItem); * } * } * * cbo.DataSource = comboList; * cbo.ValueMember = "Id"; * cbo.DisplayMember = "Code"; * cbo.SelectedIndex = 0; */ }
private void FillTenderList() { var where = "TypeName <> ''"; var orderBy = new string[] { "TypeCode", "TypeName" }; PosTenderTypeEx.LoadCombo(ref cboTender, "TypeName", true, true, "", where, orderBy); }