Exemplo n.º 1
0
        private void FindView()
        {
            DataSet ds = new DataSet();

            switch (CBFind.Text.Trim())
            {
            case "运输单位":
                ds = bindLogic.GetBindInfo(textBox1.Text, "", "");
                break;

            case "车牌号":
                ds = bindLogic.GetBindInfo("", textBox1.Text, "");
                break;

            case "卡号":
                ds = bindLogic.GetBindInfo("", "", textBox1.Text);
                break;

            default:
                ds = bindLogic.GetBindInfo("", "", "");
                break;
            }

            dataGridView1.DataSource            = ds.Tables[0];
            dataGridView1.Columns["id"].Visible = false;
        }
Exemplo n.º 2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            BindInfoLogic bindLogic = new BindInfoLogic();
            DataSet       ds        = new DataSet();
            string        strText   = "";

            // 换读卡器前的读卡号调用的方法;
            //strText = weighingLogic.GetCardNo(icdev);

            // 换读卡器后的读卡号调用的方法;
            strText = weighingLogic.Get_CardNo();
            if (!strText.Trim().Equals(""))
            {
                if (strText.Length > 15)
                {
                    strText = strText.Remove(15, strText.Length - 15);
                    ds      = bindLogic.GetBindInfo("", "", strText);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        CBTruckNo.Text = ds.Tables[0].Rows[0]["车牌号"].ToString();
                    }
                }
            }
        }