예제 #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
        private DataSet GetBindSource(BindSourceHelper.BindClass bindClass)
        {
            IDbHelper helper = DbHelper.GetDbHelper(bindClass.SqlType, bindClass.Connections);

            helper.CreateCommand(bindClass.BindSql);
            DataSet ds = helper.ExecuteQueryDataSet();

            for (int i = 0; i < ds.Tables.Count; i++)
            {
                //ds.Tables[i].TableName = lstBseUis[i].ControlName;
            }
            return(ds);
        }