Example #1
0
        //public void AddPK(string pDBParameter,pDBFieldName)
        //{
        //    VSPrimaryKey.Add(pDBParameter,pPK);
        //    mDA.AddParameter(pDBParameter,pPK);
        //}
        public void UpdateEspackControl()
        {
            string lSql;
            int    mNumRecords = 0;

            Page = 1;
            //mDA.SelectRS=new DynamicRS();
            mDA.SelectRS.DS.Dispose();
            DataSource = null;
            if (Paginate)
            {
                mDA.Open((Page - 1) * mPageSize, mPageSize);
                lSql = "SELECT NumRecords=count(*) FROM " + CtlQuery.Tablename.DBItemName + " WHERE " + CtlQuery.WhereString;
                DynamicRS lRS = (DynamicRS) new DynamicRS(lSql, Conn);
                foreach (CtlVSColumn lColumn in ColumnsExternalKeys)
                {
                    lRS.AddControlParameter(lColumn.Name, lColumn.LinkedControl);
                }
                lRS.Open();
                mNumRecords            = Convert.ToInt32(lRS["NumRecords"]);
                NumPages               = mNumRecords / mPageSize + ((mNumRecords % mPageSize) == 0 ? 0 : 1);
                mNavigationBar.Enabled = NumPages > 1;
                mNavigationBar.Items["Counter"].Text = "1/" + NumPages.ToString();
            }
            else
            {
                mDA.Open();
            }
            DataSource = mDA.Table;
            Refresh();
            Status = mStatus;
        }