Ejemplo n.º 1
0
        /// <summary>
        /// 查询数据
        /// </summary>
        /// <param name="regCode"></param>
        /// <param name="cardNumber"></param>
        /// <param name="cardName"></param>
        /// <param name="cardCode"></param>
        /// <param name="isUsed"></param>
        private void SearchData(string regCode, string cardNumber, string cardName, string cardCode, int isUsed)
        {
            //封装数据
            Service.Regulatory data = new Regulatory.Service.Regulatory();
            data.RegCode    = regCode;
            data.CardNumber = cardNumber;
            data.CardName   = cardName;
            data.CardCode   = cardCode;
            data.IsUsed     = isUsed;
            data.PageIndex  = pageIndex;
            data.PageSize   = pageSize;

            //
            data.AccID = accID;

            //查询数据
            int       total;
            DataTable dt = service.GetRegulatoryList(connectionString, data, out total);

            dgvRegulatory.DataSource = dt;
            lblPageC.Text            = pageIndex.ToString();
            if (total == 0)
            {
                total = 1;
            }
            lblPageT.Text = total % pageSize == 0?(total / pageSize).ToString():(total / pageSize + 1).ToString();

            btnControl();
        }