コード例 #1
0
        /// <summary>初始化绑定下拉框等
        ///
        /// </summary>
        private void DoInitData()
        {
            //DataTable dt=new DataTable();
            //dt.Columns.Add("Name", typeof(string));
            //dt.Columns.Add("Value", typeof(string));
            //foreach (string strItem in LoadTypeAry)
            //{
            //    DataRow dr = dt.NewRow();
            //    dr[0] = strItem;
            //    dr[1] = strItem;
            //    dt.Rows.Add(dr);
            //}
            BindSourceHelper.BindClass bindClass = new BindSourceHelper.BindClass
            {
                BindSql     = "",
                SqlType     = SqlType.SqlServer,
                Connections = string.Empty
            };
            DataSet ds = GetBindSource(bindClass);

            for (int i = 0; i < ds.Tables.Count; i++)
            {
                CheckedComboBoxHelper.BindCheckedComboBox(cbkID, ds.Tables[i], "Name", "Value");
            }
        }
コード例 #2
0
        /// <summary>初始化绑定下拉框等
        ///
        /// </summary>
        private void DoInitData()
        {
            const string strBindSql = "SELECT 2 AS  value , '管理员' AS  Name UNION ALL  SELECT 3 AS  value , '功城队' AS  NAME;SELECT 'cbkQueryRemark '";

            BindSourceHelper.BindClass bindClass = new BindSourceHelper.BindClass()
            {
                SqlType = SqlType.SqlServer,
                BindSql = strBindSql
            };
            DataSet ds = BindSourceHelper.GetBindSourceDataSet(bindClass);

            CheckedComboBoxHelper.BindCheckedComboBox(cbkQueryRemark, ds.Tables["cbkQueryRemark"], "Name", "value");
        }