Beispiel #1
0
        private void requery2()
        {
            string where_str = " 1=1 ";

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

            Maticsoft.BLL.parts parts_bll = new Maticsoft.BLL.parts();
            totle_num2 = parts_bll.GetRecordCount(where_str);

            if (this.totle_num2 % this.cur_page_lenb == 0)
            {
                this.totle_page_num2 = this.totle_num2 / this.cur_page_lenb;
            }
            else
            {
                this.totle_page_num2 = this.totle_num2 / this.cur_page_lenb + 1;
            }

            //int tot_page_index = this.totle_num / this.cur_page_lenb + (this.totle_num % this.cur_page_lenb == 0 ? 0 : 1);
            string page_info = string.Format("{0}/{1}", 1, totle_page_num2);

            this.label_baifen1.Text = page_info;
            init_ljjldgv();
        }
Beispiel #2
0
        private void BomFrom_Load(object sender, EventArgs e)
        {
            Maticsoft.BLL.parts part_bll = new Maticsoft.BLL.parts();
            string where_string          = this.query_wherestring();

            this.totle_num = part_bll.GetRecordCount(where_string);
            string parem_num = string.Format("1/{0}", this.totle_num / this.cur_page_lenb + 1);

            labelX1.Text = parem_num;
            // Maticsoft.BLL.parts pr = new Maticsoft.BLL.parts();
            DataSet ds = part_bll.GetList(" 1=1 limit 30 ");

            main_gc.DataSource = ds.Tables[0];
            //DataTable dt = new DataTable();//创建表
            //dt.Columns.Add("ljh", typeof(String));
            //dt.Columns.Add("mc", typeof(String));
            //dt.Columns.Add("gdh", typeof(String));
            //dt.Columns.Add("scbh", typeof(String));
            //dt.Columns.Add("cc", typeof(String));
            //dt.Columns.Add("sandsm", typeof(String));
            //dt.Columns.Add("tm", typeof(String));
            //dt.Columns.Add("clbz", typeof(String));
            //dt.Columns.Add("clsj", typeof(String));
            //dt.Rows.Add(new object[] { "00001", "XX零件", "123223", "312312", "1*2*3","xxx.step" ,"3213123131231"});//添加行
            //dt.Rows.Add(new object[] { "00002", "XX零件", "423523", "321122", "2*2*1", "xxx.step", "3213123131232" });
            //dt.Rows.Add(new object[] { "00003", "XX零件", "242123", "441212", "2*3*3", "xxx.step", "3213123131233" });

            //this.main_gc.DataSource = dt;
        }
Beispiel #3
0
        private void tabControl_main_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (tabControl_main.SelectedIndex == 0)
            {
                // MessageBox.Show("导入零件类型数据");
                this.init_dgv();
            }
            else if (tabControl_main.SelectedIndex == 1)
            {
                string where_str = " 1=1 ";
                if (this.textBoxljjl_query.Text != "")
                {
                    where_str += string.Format(" and ( PN like  '%{0}%'  or Barcode like '%{1}%') ", this.textBoxljjl_query.Text, this.textBoxljjl_query.Text);
                }
                if (this.textBox_type.Text != "")
                {
                    where_str += string.Format(" and componentId = {0} ", this.textBox_type.Text);
                }

                Maticsoft.BLL.parts parts_bll = new Maticsoft.BLL.parts();
                totle_num2 = parts_bll.GetRecordCount(where_str);

                if (this.totle_num2 % this.cur_page_lenb == 0)
                {
                    this.totle_page_num2 = this.totle_num2 / this.cur_page_lenb;
                }
                else
                {
                    this.totle_page_num2 = this.totle_num2 / this.cur_page_lenb + 1;
                }

                //int tot_page_index = this.totle_num / this.cur_page_lenb + (this.totle_num % this.cur_page_lenb == 0 ? 0 : 1);
                string page_info = string.Format("{0}/{1}", 1, totle_page_num2);
                this.label_baifen1.Text = page_info;
                this.init_ljjldgv();
            }
        }