/// <summary>初始化明细数据源
        ///
        /// </summary>
        private void DoInitDetailGridSource()
        {
            const string strBindSql = "SELECT ProjectID,Name From BseProject;SELECT 'gridDetailmrzProjectID '";
            BindClass    bindClass  = new BindClass()
            {
                SqlType = SqlType.SqlServer,
                BindSql = strBindSql
            };

            m_dsDetailGridSource = BindSourceHelper.GetBindSourceDataSet(bindClass, GlobalHelp.Conn);
        }
        /// <summary>初始主表数据源
        ///
        /// </summary>
        private void DoInitMasterGridSource()
        {
            const string strBindSql = "SELECT   Name,value FROM [BseDictionary] WHERE ParentID=19;SELECT   Name,value FROM [BseDictionary] WHERE ParentID=22;SELECT 'gridmrzCategory ','gridmrzOnLevel '";
            BindClass    bindClass  = new BindClass()
            {
                SqlType = SqlType.SqlServer,
                BindSql = strBindSql
            };

            m_dsMasterGridSource = BindSourceHelper.GetBindSourceDataSet(bindClass, GlobalHelp.Conn);
        }
Пример #3
0
        /// <summary>初始化绑定
        ///
        /// </summary>
        private void DoInitData()
        {
            const string strBindEditSql = "select TableName From CacheTables;SELECT 'cboEditTableName '";
            BindClass    bindClass      = new BindClass()
            {
                SqlType = SqlType.SqlServer,
                BindSql = strBindEditSql
            };
            DataSet ds = BindSourceHelper.GetBindSourceDataSet(bindClass, GlobalHelp.Conn);

            ComboBoxHelper.BindComboBox(cboEditTableName, ds.Tables["cboEditTableName"], "TableName", "TableName");
        }
Пример #4
0
        /// <summary>初始化绑定
        ///
        /// </summary>
        private void DoInitData()
        {
            const string strBindSql = "select '学习记录' as Name  union all  select '其它记录' as Name ;SELECT 'cboEditType '";
            BindClass    bindClass  = new  BindClass()
            {
                SqlType = SqlType.SqlServer,
                BindSql = strBindSql
            };
            DataSet ds = BindSourceHelper.GetBindSourceDataSet(bindClass, GlobalHelp.Conn);

            ComboBoxHelper.BindComboBox(cboEditType, ds.Tables["cboEditType"], "Name", "Name");
        }
Пример #5
0
        /// <summary>初始化Detail绑定
        ///
        /// </summary>
        private void DoInitDetailData()
        {
            const string strBindEditSql = "SELECT ProjectID,Name From BseProject;SELECT 'cboDetailEditProjectID '";
            BindClass    bindClass      = new BindClass()
            {
                SqlType = SqlType.SqlServer,
                BindSql = strBindEditSql
            };
            DataSet ds = BindSourceHelper.GetBindSourceDataSet(bindClass, GlobalHelp.Conn);

            ComboBoxHelper.BindComboBox(cboDetailEditProjectID, ds.Tables["cboDetailEditProjectID"], "Name", "ProjectID");
        }
Пример #6
0
        /// <summary>初始化Master绑定
        ///
        /// </summary>
        private void DoInitMasterData()
        {
            const string strBindEditSql = "SELECT   Name,value FROM [BseDictionary] WHERE ParentID=19;SELECT   Name,value FROM [BseDictionary] WHERE ParentID=22;SELECT 'cboEditCategory ','cboEditOnLevel '";
            BindClass    bindClass      = new BindClass()
            {
                SqlType = SqlType.SqlServer,
                BindSql = strBindEditSql
            };
            DataSet ds = BindSourceHelper.GetBindSourceDataSet(bindClass, GlobalHelp.Conn);

            ComboBoxHelper.BindComboBox(cboEditCategory, ds.Tables["cboEditCategory"], "Name", "Value");
            ComboBoxHelper.BindComboBox(cboEditOnLevel, ds.Tables["cboEditOnLevel"], "Name", "Value");
        }
Пример #7
0
        private void grdData_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
        {
            if (m_dsGridSource == null)
            {
                const string strBindGridSql = "SELECT   Name,value FROM [BseDictionary] WHERE ParentID=22;SELECT   Name,value FROM [BseDictionary] WHERE ParentID=19;SELECT 'gridcboOnLevel ','gridcboCategory '";
                BindClass    bindClass      = new BindClass()
                {
                    SqlType = SqlType.SqlServer,
                    BindSql = strBindGridSql
                };
                m_dsGridSource = BindSourceHelper.GetBindSourceDataSet(bindClass, GlobalHelp.Conn);
            }
            DataGridViewComboBoxCell gridcboOnLevelCell = this.grdData.Rows[e.RowIndex].Cells[gridcboOnLevel.Name] as DataGridViewComboBoxCell;

            ComboBoxHelper.BindDataGridViewComboBoxCell(gridcboOnLevelCell, m_dsGridSource.Tables["gridcboOnLevel"], "Name", "Value");
            DataGridViewComboBoxCell gridcboCategoryCell = this.grdData.Rows[e.RowIndex].Cells[gridcboCategory.Name] as DataGridViewComboBoxCell;

            ComboBoxHelper.BindDataGridViewComboBoxCell(gridcboCategoryCell, m_dsGridSource.Tables["gridcboCategory"], "Name", "Value");
        }