Exemplo n.º 1
0
 private void BindData()
 {
     KB.DAL.DBHelper db = new KB.DAL.DBHelper();
     try
     {
         KB.BLL.DATA0023BLL bll = new KB.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)
     {
         KB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Exemplo n.º 2
0
 private void BindData()
 {
     KB.DAL.DBHelper db = new KB.DAL.DBHelper();
     try
     {
         KB.BLL.DATA0497BLL bll = new KB.BLL.DATA0497BLL(db);
         if (type == -1)
         {
             list = (List <KB.Models.DATA0497>)bll.FindBySql(" ACTIVE_FLAG=0 AND APPROVAL_ROUTE_CODE like '%" + textBox1.Text.Trim() + "%'");
         }
         else
         {
             list = (List <KB.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)
     {
         KB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Exemplo n.º 3
0
        protected void BindData()
        {
            KB.DAL.DBHelper db = new KB.DAL.DBHelper();
            try
            {
                KB.BLL.DATA0017BLL data0017BLL = new KB.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 <KB.Models.DATA0017>)data0017BLL.FindBySql(sqlWhere, topNum);
                dataGridView1.AutoGenerateColumns = false;
                dataGridView1.DataSource          = data0017List;
            }
            catch (Exception ex)
            {
                KB.FUNC.log.RecordInfo(ex);
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                db.CloseConnection();
            }
        }
Exemplo n.º 4
0
 protected void BindData()
 {
     KB.DAL.DBHelper db = new KB.DAL.DBHelper();
     try
     {
         KB.BLL.DATA0016BLL bll = new KB.BLL.DATA0016BLL(db);
         if (data0017Ptr > 0)
         {
             data0016List = bll.GetDefaultLocationByInventory(data0017Ptr);
         }
         else
         {
             data0016List = (List <KB.Models.DATA0016>)bll.FindBySql(string.Format(" code like '{0}' or location like '%{0}%'", textBox1.Text.Trim()));
         }
         dataGridView1.DataSource = data0016List;
     }
     catch (Exception ex)
     {
         KB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Exemplo n.º 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;

            KB.DAL.DBHelper db = null;
            try
            {
                db = new KB.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();
                }
            }
        }
Exemplo n.º 6
0
        private void BindData()
        {
            KB.DAL.DBHelper db = new KB.DAL.DBHelper();
            try
            {
                KB.BLL.DATA0034BLL bll = new KB.BLL.DATA0034BLL(db);
                if (!showExpendedData)
                {
                    list = (List <KB.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 <KB.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)
            {
                KB.FUNC.log.RecordInfo(ex);
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                db.CloseConnection();
            }
        }
Exemplo n.º 7
0
 private void BindData()
 {
     KB.DAL.DBHelper db = new KB.DAL.DBHelper();
     try
     {
         KB.BLL.DATA0395BLL bll = new KB.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();
     }
 }
Exemplo n.º 8
0
 private void BindData()
 {
     KB.DAL.DBHelper db = new KB.DAL.DBHelper();
     try
     {
         KB.BLL.DATA0172BLL bll = new KB.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();
     }
 }
Exemplo n.º 9
0
 private void BindData()
 {
     KB.DAL.DBHelper db = new KB.DAL.DBHelper();
     try
     {
         DATA0555BLL bll = new DATA0555BLL(db);
         dataGridView1.DataSource = bll.GetMirList("1", "2", textBoxMirNo.Text.Trim());
     }
     catch (Exception ex)
     {
         KB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
         textBoxMirNo.Focus();
     }
 }
Exemplo n.º 10
0
 private void BindData()
 {
     KB.DAL.DBHelper db = new KB.DAL.DBHelper();
     try
     {
         KB.BLL.DATA0161BLL bll = new KB.BLL.DATA0161BLL(db);
         list = (List <KB.Models.DATA0161>)bll.FindBySql(" EQUIPMENT_NAME like '%" + textBoxCode.Text.Trim() + "%'");
         dataGridView1.DataSource = list;
     }
     catch (Exception ex)
     {
         KB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Exemplo n.º 11
0
 protected void BindData()
 {
     KB.DAL.DBHelper db = new KB.DAL.DBHelper();
     try
     {
         KB.BLL.DATA0370BLL bll = new KB.BLL.DATA0370BLL(db);
         list = (List <KB.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)
     {
         KB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Exemplo n.º 12
0
 private void BindData()
 {
     KB.DAL.DBHelper db = new KB.DAL.DBHelper();
     try
     {
         KB.BLL.DATA0005BLL bll = new KB.BLL.DATA0005BLL(db);
         data0005List             = (List <KB.Models.DATA0005>)bll.FindBySql(" empl_code like '%" + textBoxCode.Text.Trim() + "%' or employee_name like '%" + textBoxCode.Text.Trim() + "%'");
         dataGridView1.DataSource = data0005List;
     }
     catch (Exception ex)
     {
         KB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Exemplo n.º 13
0
 private void BindData()
 {
     KB.DAL.DBHelper db = new KB.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)
     {
         KB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Exemplo n.º 14
0
 protected void BindData()
 {
     KB.DAL.DBHelper db = new KB.DAL.DBHelper();
     try
     {
         KB.BLL.DATA0015BLL data0015BLL = new KB.BLL.DATA0015BLL(db);
         data0015List = (List <KB.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)
     {
         KB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Exemplo n.º 15
0
 private void BindData()
 {
     KB.DAL.DBHelper db = null;
     try
     {
         db = new KB.DAL.DBHelper();
         KB.BLL.DATA0039BLL bll      = new KB.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)
     {
         KB.FUNC.log.RecordInfo(ex);
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         db.CloseConnection();
     }
 }
Exemplo n.º 16
0
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (dataGridView1.CurrentCell != null && e.RowIndex >= 0)
            {
                KB.DAL.DBHelper db = new KB.DAL.DBHelper();
                try
                {
                    KB.BLL.DATA0172BLL bll = new KB.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();
                }
            }
        }
Exemplo n.º 17
0
        private void BindData()
        {
            KB.DAL.DBHelper db = new KB.DAL.DBHelper();
            try
            {
                KB.BLL.DATA0013BLL bll = new KB.BLL.DATA0013BLL(db);
                data0013List = (List <KB.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)
            {
                KB.FUNC.log.RecordInfo(ex);
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                db.CloseConnection();
            }
        }
Exemplo n.º 18
0
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (dataGridView1.CurrentCell != null && dataGridView1.CurrentCell.RowIndex >= 0)
            {
                KB.DAL.DBHelper db = new KB.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)
                {
                    KB.FUNC.log.RecordInfo(ex);
                    MessageBox.Show(ex.ToString());
                }
                finally
                {
                    db.CloseConnection();
                }
            }
        }
Exemplo n.º 19
0
 private void BaseWorkOrder_Load(object sender, EventArgs e)
 {
     KB.DAL.DBHelper db = new KB.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();
     }
 }