示例#1
0
        private void requery()
        {
            string where_str = " 1=1 ";

            if (this.textBox_query.Text != "")
            {
                // 通过零件的id或者零件的名字
                where_str += string.Format("  and ( componentId like '%{0}%' or name like '%{1}%') ", this.textBox_query.Text, this.textBox_query.Text);
            }
            Maticsoft.BLL.component parts_bll = new Maticsoft.BLL.component();
            totle_num = parts_bll.GetRecordCount(where_str);

            if (this.totle_num % this.cur_page_lenb == 0)
            {
                this.totle_page_num = this.totle_num / this.cur_page_lenb;
            }
            else
            {
                this.totle_page_num = this.totle_num / this.cur_page_lenb + 1;
            }
            string page_info = string.Format("{0}/{1}", 1, totle_page_num);

            this.label_tot.Text = page_info;
            this.init_dgv();
        }
示例#2
0
        private void BomFrom2_Load(object sender, EventArgs e)
        {
            string where_str = " 1=1 ";

            if (this.textBoxljjl_query.Text != "")
            {
                where_str += string.Format(" and ( componentId = {0}'  or Barcode ARef '%{1}%') ", this.textBoxljjl_query.Text, this.textBoxljjl_query.Text);
            }

            Maticsoft.BLL.component parts_bll = new Maticsoft.BLL.component();
            totle_num = parts_bll.GetRecordCount(where_str);
            if (this.totle_num % this.cur_page_lenb == 0)
            {
                this.totle_page_num = this.totle_num / this.cur_page_lenb;
            }
            else
            {
                this.totle_page_num = this.totle_num / this.cur_page_lenb + 1;
            }
            string page_info = string.Format("{0}/{1}", 1, totle_page_num);

            this.label_tot.Text = page_info;
            this.init_dgv();
        }