Esempio n. 1
0
        public static void Register(this QLComboBox comboBox, string a_strSql, string s_strDisplay, string s_strValue)
        {
            SqlServerDbConn SSD = new SqlServerDbConn();

            if (SSD.GetData(a_strSql))
            {
                DBComboBox a_cbo = (comboBox.InnerEditor) as DBComboBox;
                a_cbo.Items.Clear();
                foreach (DataRow l_row in SSD.Data.Tables[0].Rows)
                {
                    a_cbo.AddItem(l_row[s_strDisplay].ToString(), l_row[s_strValue].ToString());
                }
            }
        }
Esempio n. 2
0
        public static void Register(this QLComboBox comboBox, string a_strType)
        {
            string          sqlStr = string.Format("select * from simple_code where simple_type ='{0}'", a_strType);
            SqlServerDbConn SSD    = new SqlServerDbConn();

            if (SSD.GetData(sqlStr))
            {
                DBComboBox a_cbo = (comboBox.InnerEditor) as DBComboBox;
                a_cbo.Items.Clear();
                foreach (DataRow l_row in SSD.Data.Tables[0].Rows)
                {
                    a_cbo.AddItem(l_row["simple_name_cn"].ToString(), l_row["simple_no"].ToString());
                }
            }
        }