Example #1
0
        private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
        {
            //if (e.KeyCode == Keys.Up)
            //{
            //    if (dataGridView1.Rows.Count > 0)
            //    {
            //        if (dataGridView1.CurrentCell != null & dataGridView1.CurrentCell.RowIndex >= 0)
            //        {
            //            var index = dataGridView1.CurrentCell.RowIndex;
            //            index = Math.Max(index - 1, 0);

            //            dataGridView1.ClearSelection();
            //            dataGridView1.CurrentCell = dataGridView1[1, index];
            //            dataGridView1.Rows[index].Selected = true;
            //        }
            //    }
            //}
            if (e.KeyCode == Keys.Enter)
            {
                if (dataGridView1.CurrentCell != null && dataGridView1.CurrentCell.RowIndex >= 0)
                {
                    FOUNDERPCB.DAL.DBHelper db  = new FOUNDERPCB.DAL.DBHelper();
                    DATA0555BLL             bll = new DATA0555BLL(db);

                    Data0555          = bll.getDATA0555ByRKEY(decimal.Parse(dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[0].Value.ToString()));
                    this.DialogResult = DialogResult.OK;
                }
            }
        }
Example #2
0
 private void BindData()
 {
     FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
     try
     {
         FOUNDERPCB.BLL.DATA0023BLL bll = new FOUNDERPCB.BLL.DATA0023BLL(db);
         if (SqlWhere.Length > 0)
         {
             list = bll.GetEntityByCode(textBoxSupplierCode.Text.Trim(), SqlWhere);
         }
         else
         {
             list = bll.GetEntityByCode(textBoxSupplierCode.Text.Trim());
         }
         dataGridView1.DataSource = list;
     }
     catch (Exception ex)
     {
         FOUNDERPCB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Example #3
0
 private void BindData()
 {
     FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
     try
     {
         FOUNDERPCB.BLL.DATA0497BLL bll = new FOUNDERPCB.BLL.DATA0497BLL(db);
         if (type == -1)
         {
             list = (List <FOUNDERPCB.Models.DATA0497>)bll.FindBySql(" ACTIVE_FLAG=0 AND APPROVAL_ROUTE_CODE like '%" + textBox1.Text.Trim() + "%'");
         }
         else
         {
             list = (List <FOUNDERPCB.Models.DATA0497>)bll.FindBySql(" ACTIVE_FLAG=0 AND APPROVAL_ROUTE_CODE like '%" + textBox1.Text.Trim() + "%' and APPROVAL_TYPE =" + type.ToString());
         }
         dataGridView1.DataSource = list;
     }
     catch (Exception ex)
     {
         FOUNDERPCB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Example #4
0
 protected void BindData()
 {
     FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
     try
     {
         FOUNDERPCB.BLL.DATA0016BLL bll = new FOUNDERPCB.BLL.DATA0016BLL(db);
         if (data0017Ptr > 0)
         {
             data0016List = bll.GetDefaultLocationByInventory(data0017Ptr);
         }
         else
         {
             data0016List = (List <FOUNDERPCB.Models.DATA0016>)bll.FindBySql(string.Format(" code like '{0}' or location like '%{0}%'", textBox1.Text.Trim()));
         }
         dataGridView1.DataSource = data0016List;
     }
     catch (Exception ex)
     {
         FOUNDERPCB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Example #5
0
        private DataTable tb;//存储DATA0038中的Parameter

        private void FormParameter_Load(object sender, EventArgs e)
        {
            dataGridView1.AutoGenerateColumns   = false;
            dataGridView1.MultiSelect           = false;
            dataGridView1.AllowUserToResizeRows = false;
            dataGridView1.RowHeadersVisible     = false;

            FOUNDERPCB.DAL.DBHelper db = null;
            try
            {
                db = new FOUNDERPCB.DAL.DBHelper();
                tb = db.GetDataSet(string.Format("select distinct {0} as parameter from data0038 where {0} is not null order by {0}", ColumnName));
                for (int i = tb.Rows.Count - 1; i >= 0; i--)//删除空行
                {
                    if (tb.Rows[i][0].ToString().Trim().Length == 0)
                    {
                        tb.Rows.RemoveAt(i);
                    }
                }
                BindData();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (db != null)
                {
                    db.CloseConnection();
                }
            }
        }
Example #6
0
        protected void BindData()
        {
            FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
            try
            {
                FOUNDERPCB.BLL.DATA0017BLL data0017BLL = new FOUNDERPCB.BLL.DATA0017BLL(db);

                string sqlWhere = string.Format(" (inv_part_number like '%{0}%' or inv_part_description like '%{0}%') ", textBox1.Text.Trim());
                if (where.Length > 0)
                {
                    sqlWhere = where + " and " + sqlWhere;
                }
                if (orderBy.Length > 0)
                {
                    sqlWhere = sqlWhere + orderBy;
                }

                data0017List = (List <FOUNDERPCB.Models.DATA0017>)data0017BLL.FindBySql(sqlWhere, topNum);
                dataGridView1.AutoGenerateColumns = false;
                dataGridView1.DataSource          = data0017List;
            }
            catch (Exception ex)
            {
                FOUNDERPCB.FUNC.log.RecordInfo(ex);
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                db.CloseConnection();
            }
        }
Example #7
0
        private void BindData()
        {
            FOUNDERPCB.DAL.DBHelper    db  = new FOUNDERPCB.DAL.DBHelper();
            FOUNDERPCB.BLL.DATA0035BLL bll = new FOUNDERPCB.BLL.DATA0035BLL(db);
            var data = bll.GetModelList(" PRODUCTION_PARAMETER like '%" + txtName.Text.Trim() + "%'");

            dataGridView1.DataSource = data;
        }
Example #8
0
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (dataGridView1.CurrentCell != null && e.RowIndex >= 0)
            {
                FOUNDERPCB.DAL.DBHelper db  = new FOUNDERPCB.DAL.DBHelper();
                DATA0555BLL             bll = new DATA0555BLL(db);

                Data0555          = bll.getDATA0555ByRKEY(decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString()));
                this.DialogResult = DialogResult.OK;
            }
        }
        private void BindData()
        {
            FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
            try
            {
                FOUNDERPCB.BLL.DATA0034BLL bll = new FOUNDERPCB.BLL.DATA0034BLL(db);
                if (!showExpendedData)
                {
                    list = (List <FOUNDERPCB.Models.DATA0034>)bll.FindBySql(" DEPT_CODE like '%" + textBoxCode.Text.Trim() + "%'  and (ACTIVE_FLAG = 0 OR ACTIVE_FLAG IS NULL)" + SqlWhere);
                }
                else
                {
                    try
                    {
                        #region 初始化拓展表
                        DataTable temp = bll.getDataSet("select * from sysobjects where name = 'DATA0034E' and xtype = 'U'");
                        if (temp != null & temp.Rows.Count == 0)
                        {
                            string execSql = @"create table DATA0034E
                                            (
	                                            rkey numeric(10,0) identity(1,1) primary key,
	                                            data0034ptr numeric(10,0) not null,
                                            )";
                            db.ExecuteCommand(execSql);
                        }
                        #endregion
                        list = (List <FOUNDERPCB.Models.DATA0034>)bll.FindBySql(" DEPT_CODE like '%" + textBoxCode.Text.Trim() + "%'  and (ACTIVE_FLAG = 0 OR ACTIVE_FLAG IS NULL)"
                                                                                + " and RKEY IN (select data0034ptr from DATA0034E) "
                                                                                + SqlWhere + " order by DEPT_CODE");
                    }
                    catch (Exception error)
                    {
                        throw error;
                    }
                }
                dataGridView1.DataSource = list;
            }
            catch (Exception ex)
            {
                FOUNDERPCB.FUNC.log.RecordInfo(ex);
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                db.CloseConnection();
            }
        }
 private void BindData()
 {
     FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
     try
     {
         FOUNDERPCB.BLL.DATA0395BLL bll = new FOUNDERPCB.BLL.DATA0395BLL(db);
         var tb = bll.QueryMirForMaintenanceOrder(textBoxCode.Text.Trim());
         dataGridView1.DataSource = null;
         dataGridView1.DataSource = tb;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Example #11
0
 private void BindData()
 {
     FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
     try
     {
         DATA0555BLL bll = new DATA0555BLL(db);
         dataGridView1.DataSource = bll.GetMirList("1", "2", textBoxMirNo.Text.Trim());
     }
     catch (Exception ex)
     {
         FOUNDERPCB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
         textBoxMirNo.Focus();
     }
 }
Example #12
0
 private void BindData()
 {
     FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
     try
     {
         FOUNDERPCB.BLL.DATA0076BLL bll = new FOUNDERPCB.BLL.DATA0076BLL(db);
         list = (List <FOUNDERPCB.Models.DATA0076>)bll.FindBySql(" code like '%" + textBoxRejCode.Text.Trim() + "%' order by code");
         dataGridView1.DataSource = list;
     }
     catch (Exception ex)
     {
         FOUNDERPCB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
 private void BindData()
 {
     FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
     try
     {
         FOUNDERPCB.BLL.DATA0172BLL bll = new FOUNDERPCB.BLL.DATA0172BLL(db);
         var list = (List <DATA0172>)bll.FindBySql(string.Format(" STATUS_OF_MO=4 and MO_NUMBER like '%{0}%' order by MO_NUMBER", textBoxCode.Text.Trim()));
         dataGridView1.DataSource = null;
         dataGridView1.DataSource = list;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Example #14
0
 protected void BindData()
 {
     FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
     try
     {
         FOUNDERPCB.BLL.DATA0370BLL bll = new FOUNDERPCB.BLL.DATA0370BLL(db);
         list = (List <FOUNDERPCB.Models.DATA0370>)bll.FindBySql(" CODE like '%" + textBox1.Text.Trim() + "%' and (Data0370.ACTIVE_FLAG = 0 OR Data0370.ACTIVE_FLAG IS NULL)");
         dataGridView1.DataSource = list;
     }
     catch (Exception ex)
     {
         FOUNDERPCB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Example #15
0
 private void BindData()
 {
     FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
     try
     {
         DATA0466BLL bll = new DATA0466BLL(db);
         DataTable   tb  = bll.QueryROForBasePage(textBoxCode.Text.Trim(), Data0023Ptr);
         dataGridView1.DataSource = null;
         dataGridView1.DataSource = tb;
     }
     catch (Exception ex)
     {
         FOUNDERPCB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Example #16
0
 protected void BindData()
 {
     FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
     try
     {
         FOUNDERPCB.BLL.DATA0015BLL data0015BLL = new FOUNDERPCB.BLL.DATA0015BLL(db);
         data0015List = (List <FOUNDERPCB.Models.DATA0015>)data0015BLL.FindBySql(string.Format("warehouse_code like '%{0}%' or warehouse_name like '%{0}%' ", textBox1.Text.Trim()));
         dataGridView1.AutoGenerateColumns = false;
         dataGridView1.DataSource          = data0015List;
     }
     catch (Exception ex)
     {
         FOUNDERPCB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
 private void BindData()
 {
     FOUNDERPCB.DAL.DBHelper db = null;
     try
     {
         db = new FOUNDERPCB.DAL.DBHelper();
         FOUNDERPCB.BLL.DATA0039BLL bll = new FOUNDERPCB.BLL.DATA0039BLL(db);
         string sqlWhere = " REJECT_DEFECT_FLAG = '{0}' and (REJ_CODE like '%{1}%' or REJECT_DESCRIPTION like '%{1}%')";
         list = (List <DATA0039>)bll.FindBySql(string.Format(sqlWhere, RejectType, txtUserInput.Text.Trim()));
         dataGridView1.DataSource = list;
     }
     catch (Exception ex)
     {
         FOUNDERPCB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (dataGridView1.CurrentCell != null && e.RowIndex >= 0)
            {
                FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
                try
                {
                    FOUNDERPCB.BLL.DATA0172BLL bll = new FOUNDERPCB.BLL.DATA0172BLL(db);
                    Data0172 = bll.getDATA0172ByRECORD_KEY_MO(decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString()));

                    this.DialogResult = DialogResult.OK;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
                finally
                {
                    db.CloseConnection();
                }
            }
        }
Example #19
0
        private void BindData()
        {
            FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
            try
            {
                FOUNDERPCB.BLL.DATA0013BLL bll = new FOUNDERPCB.BLL.DATA0013BLL(db);
                data0013List = (List <FOUNDERPCB.Models.DATA0013>)bll.FindBySql(" NP_CODE like '%" + textBox1.Text.Trim() + "%'");
                var list = new List <D13Item>();
                foreach (var d13 in data0013List)
                {
                    var item = new D13Item();
                    item.rkey          = d13.RKEY;
                    item.NP_CODE       = d13.NP_CODE;
                    item.NOTE_PAD_LINE = (string.IsNullOrEmpty(d13.NOTE_PAD_LINE_1) ? "" : d13.NOTE_PAD_LINE_1.Trim())
                                         + (string.IsNullOrEmpty(d13.NOTE_PAD_LINE_2) ? "" : d13.NOTE_PAD_LINE_2.Trim())
                                         + (string.IsNullOrEmpty(d13.NOTE_PAD_LINE_3) ? "" : d13.NOTE_PAD_LINE_3.Trim())
                                         + (string.IsNullOrEmpty(d13.NOTE_PAD_LINE_4) ? "" : d13.NOTE_PAD_LINE_4.Trim());

                    list.Add(item);
                }
                dataGridView1.DataSource = null;
                dataGridView1.DataSource = list;
                for (int i = 0; i < list.Count; i++)
                {
                    dataGridView1.Rows[i].Cells[0].Value = list[i].NP_CODE;
                    dataGridView1.Rows[i].Cells[1].Value = list[i].NOTE_PAD_LINE;
                }
            }
            catch (Exception ex)
            {
                FOUNDERPCB.FUNC.log.RecordInfo(ex);
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                db.CloseConnection();
            }
        }
Example #20
0
 private void BaseWorkOrder_Load(object sender, EventArgs e)
 {
     FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
     try
     {
         d06bll = new DATA0006BLL(db);
         dataGridView1.AutoGenerateColumns = false;
         if (HasOpType == 1)
         {
             txt_SearchStr.Visible = false;
             btn_Clean.Visible     = false;
         }
         else
         {
             txt_SearchStr.Text = work_order_number;
         }
         top = 200;
         BindData();
     }
     finally
     {
         db.CloseConnection();
     }
 }
Example #21
0
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (dataGridView1.CurrentCell != null && dataGridView1.CurrentCell.RowIndex >= 0)
            {
                FOUNDERPCB.DAL.DBHelper db = new FOUNDERPCB.DAL.DBHelper();
                try
                {
                    Data0017Ptr = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString());
                    DATA0017BLL bll = new DATA0017BLL(db);

                    inventory         = bll.getDATA0017ByRKEYWithNolock(Data0017Ptr);
                    this.DialogResult = DialogResult.OK;
                }
                catch (Exception ex)
                {
                    FOUNDERPCB.FUNC.log.RecordInfo(ex);
                    MessageBox.Show(ex.ToString());
                }
                finally
                {
                    db.CloseConnection();
                }
            }
        }
Example #22
0
        /// <summary>
        /// 加载数据
        /// </summary>
        private void BindData()
        {
            string iswhere = "ACTIVE_FLAG = 'Y'";

            if (OpType == 0)
            {
                iswhere += " and  (RKEY = PRODUCTION_PART_PTR) ";
            }
            else
            {
                iswhere += " and  (RKEY != PRODUCTION_PART_PTR) ";
            }
            //加入库存过滤
            if (boolQtyOnHand)
            {
                iswhere += " and  (QTY_ON_HAND>0) ";
            }

            if (SqlWhere != "")
            {
                iswhere += SqlWhere;
            }
            else
            {
                if (PartNumber != "")
                {
                    lab_Name.Text      = "部件号码:";
                    txt_SearchStr.Text = PartNumber;
                }
                if (Data0010Rkey > 0)
                {
                    iswhere += " and CUSTOMER_PTR=" + Data0010Rkey.ToString();
                }
                if (lab_Name.Text.Contains("号码"))
                {
                    iswhere += " and CUSTOMER_PART_NUMBER like '" + txt_SearchStr.Text.Trim() + "%'";
                }
                else
                {
                    iswhere += " and CUSTOMER_PART_DESC like '" + txt_SearchStr.Text.Trim() + "%'";
                }
            }
            try
            {
                FOUNDERPCB.DAL.DBHelper    db     = new FOUNDERPCB.DAL.DBHelper();
                FOUNDERPCB.BLL.DATA0050BLL d50bll = new FOUNDERPCB.BLL.DATA0050BLL(db);
                list = d50bll.FindBySql(iswhere);
                if (list.Count < 1)
                {
                    if (PartNumber != "")
                    {
                        MessageBox.Show("没有找到任何数据。");
                        this.DialogResult = DialogResult.Cancel;
                    }
                }
                dataGridView1.DataSource = list;
            }
            catch (Exception ee)
            {
                FOUNDERPCB.FUNC.log.RecordInfo(ee);
                MessageBox.Show(ee.Message);
            }
        }