Example #1
0
        /// <summary>
        /// 多条件查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void sbQuary_Click(object sender, EventArgs e)
        {
            DateTime startTime = Convert.ToDateTime(dtpBegin.Text);
            DateTime endTime   = Convert.ToDateTime(dtpBegin.Text);
            string   vno       = txtvNo.Text.Trim(); //车牌号
            string   vcolo     = null;               //车身颜色
            int?     vrin      = null;               //林格曼系数

            int total = 0;

            if (cbeColor.SelectedItem.ToString() == "所有")
            {
                vcolo = null;
            }
            else
            {
                vcolo = cbeColor.SelectedItem.ToString();
            }
            switch (cbeRegin.SelectedIndex)
            {
            case 0:
                vrin = null;

                break;

            case 1:
                vrin = 1;
                break;

            case 2:
                vrin = 2;
                break;

            case 3:
                vrin = 3;
                break;

            case 4:
                vrin = 4;
                break;

            case 5:
                vrin = 5;
                break;
            }
            DataTable dt = BAL.GetVehiclesByMulCondition(startTime, endTime, vno, vcolo, vrin, 1, 5, ref total);


            gcVehicleInfo.DataSource = dt;
            resultTotal = total;


            //设置底部信息

            //总共条数
            lblTotal.Text = total.ToString();
            //总共页数
            lblResultTotal.Text = PageTotal(total, 5).ToString();
            //当前页
            lblIndex.Text = "1";
            lblTotal.Text = total.ToString();

            //为全局当前页设最新值
            pageCurrIndex = 1;
        }