using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; namespace BLL { /// /// ·µ»ØÏÂÀ­ »ù´¡×ÊÁÏÐÅÏ¢Àà /// public class ClsBaseDownSelect_K3 { #region ÉèÖÃÎı¾¿ò /// /// Ñ¡ÔñÎïÁÏ /// /// /// /// public static void SetTextByMater_K3(TextBox txt, TextBox txt2, TextBox txt3, int x, int y) { DAL.ClsK3_Material_View oMater = new DAL.ClsK3_Material_View(); if (oMater.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%' or HModel like '%" + txt.Text + "%' )", x, y)) { if (oMater.GetInfoByID(oMater.oModel.HItemID)) { txt.Text = oMater.omodel.HNumber; txt.Tag = oMater.omodel.HItemID.ToString(); txt2.Text = oMater.omodel.HName; txt3.Text = oMater.omodel.HModel; txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } } else { txt.Text = ""; txt2.Text = ""; txt3.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÎïÁÏ´ø³ö¼ÆÁ¿µ¥Î» /// /// /// /// public static void SetTextByMater_K3(TextBox txtNumber, TextBox txtName, TextBox txtModel, TextBox txtUnit, int x, int y) { DAL.ClsK3_Material_View oMater = new DAL.ClsK3_Material_View(); DAL.ClsK3_Unit_View oUnit = new DAL.ClsK3_Unit_View(); if (oMater.RefreshViewDownMenu(" and ( HName like '%" + txtName.Text + "%' or HNumber like '%" + txtNumber.Text + "%' or HModel like '%" + txtModel.Text + "%' )", x, y)) { if (oMater.GetInfoByID(oMater.oModel.HItemID)) { txtNumber.Text = oMater.omodel.HNumber; txtNumber.Tag = oMater.omodel.HItemID.ToString(); txtName.Text = oMater.omodel.HName; txtModel.Text = oMater.omodel.HModel; txtNumber.ForeColor = System.Drawing.Color.Blue; txtNumber.SelectAll(); if (oUnit.GetInfoByID(oMater.omodel.HUnitID)) { txtUnit.Text = oUnit.omodel.HName; txtUnit.Tag = oUnit.omodel.HItemID.ToString(); } else { txtUnit.Text = ""; txtUnit.Tag = "0"; } } else { txtNumber.Text = ""; txtNumber.Tag = "0"; txtName.Text = ""; txtModel.Text = ""; txtUnit.Text = ""; txtUnit.Tag = "0"; } } else { txtNumber.Text = ""; txtNumber.Tag = "0"; txtName.Text = ""; txtModel.Text = ""; txtUnit.Text = ""; txtUnit.Tag = "0"; txtNumber.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÎïÁÏ /// /// /// /// public static void SetTextByMater_K3(TextBox txt,int x,int y) { DAL.ClsK3_Material_View oMater = new DAL.ClsK3_Material_View(); if (oMater.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%' or HModel like '%" + txt.Text + "%' )", x, y)) { txt.Text = oMater.oModel.HName; txt.Tag = oMater.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÎïÁÏ /// /// /// /// public static void SetTextByMaterNum_K3(TextBox txt, int x, int y) { DAL.ClsK3_Material_View oMater = new DAL.ClsK3_Material_View(); if (oMater.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%' or HModel like '%" + txt.Text + "%' )", x, y)) { txt.Text = oMater.oModel.HNumber; txt.Tag = oMater.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¼ÆÁ¿µ¥Î» /// /// /// /// public static void SetTextByUnit_K3(TextBox txt, int x, int y) { DAL.ClsK3_Unit_View oUnit = new DAL.ClsK3_Unit_View(); if (oUnit.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oUnit.oModel.HName; txt.Tag = oUnit.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¼ÆÁ¿µ¥Î» /// /// /// /// public static void SetTextByUnitNum_K3(TextBox txt, int x, int y) { DAL.ClsK3_Unit_View oUnit = new DAL.ClsK3_Unit_View(); if (oUnit.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oUnit.oModel.HNumber; txt.Tag = oUnit.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ²Ö¿â /// /// /// /// public static void SetTextByWareHouse_K3(TextBox txt, int x, int y) { DAL.ClsK3_Warehouse_View oWh = new DAL.ClsK3_Warehouse_View(); if (oWh.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oWh.oModel.HName; txt.Tag = oWh.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ²Ö¿â /// /// /// /// public static void SetTextByWareHouseNum_K3(TextBox txt, int x, int y) { DAL.ClsK3_Warehouse_View oWh = new DAL.ClsK3_Warehouse_View(); if (oWh.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oWh.oModel.HNumber; txt.Tag = oWh.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ²Öλ /// /// /// /// public static void SetTextByStockPlace_K3(TextBox txt, int x, int y) { DAL.ClsK3_StockPlace_View oStockPlace = new DAL.ClsK3_StockPlace_View(); if (oStockPlace.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oStockPlace.oModel.HName; txt.Tag = oStockPlace.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ²Öλ /// /// /// /// public static void SetTextByStockPlaceNum_K3(TextBox txt, int x, int y) { DAL.ClsK3_StockPlace_View oStockPlace = new DAL.ClsK3_StockPlace_View(); if (oStockPlace.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oStockPlace.oModel.HNumber; txt.Tag = oStockPlace.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ²Öλ×é /// /// /// /// public static void SetTextByStockPlaceGroup_K3(TextBox txt, int x, int y) { DAL.ClsK3_StockPlaceGroup_View oStockPlaceGroup = new DAL.ClsK3_StockPlaceGroup_View(); if (oStockPlaceGroup.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oStockPlaceGroup.oModel.HName; txt.Tag = oStockPlaceGroup.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ²Öλ×é /// /// /// /// public static void SetTextByStockPlaceGroupNum_K3(TextBox txt, int x, int y) { DAL.ClsK3_StockPlaceGroup_View oStockPlaceGroup = new DAL.ClsK3_StockPlaceGroup_View(); if (oStockPlaceGroup.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oStockPlaceGroup.oModel.HNumber; txt.Tag = oStockPlaceGroup.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÖ°Ô± /// /// /// /// public static void SetTextByEmployee_K3(TextBox txt, int x, int y) { DAL.ClsK3_Employee_View oEmp = new DAL.ClsK3_Employee_View(); if (oEmp.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oEmp.oModel.HName; txt.Tag = oEmp.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÖ°Ô± /// /// /// /// public static void SetTextByEmployeeNum_K3(TextBox txt, int x, int y) { DAL.ClsK3_Employee_View oEmp = new DAL.ClsK3_Employee_View(); if (oEmp.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oEmp.oModel.HNumber; txt.Tag = oEmp.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ²¿ÃÅ /// /// /// /// public static void SetTextByDept_K3(TextBox txt, int x, int y) { DAL.ClsK3_Department_View oDept = new DAL.ClsK3_Department_View(); if (oDept.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oDept.oModel.HName; txt.Tag = oDept.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ²¿ÃÅ /// /// /// /// public static void SetTextByDeptNum_K3(TextBox txt, int x, int y) { DAL.ClsK3_Department_View oDept = new DAL.ClsK3_Department_View(); if (oDept.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oDept.oModel.HNumber; txt.Tag = oDept.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¿Í»§ /// /// /// /// public static void SetTextByCustomer_K3(TextBox txt, int x, int y) { DAL.ClsK3_Customer_View oCus = new DAL.ClsK3_Customer_View(); if (oCus.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oCus.oModel.HName; txt.Tag = oCus.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¿Í»§ /// /// /// /// public static void SetTextByCustomerNum_K3(TextBox txt, int x, int y) { DAL.ClsK3_Customer_View oCus = new DAL.ClsK3_Customer_View(); if (oCus.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oCus.oModel.HNumber; txt.Tag = oCus.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¹©Ó¦ÉÌ /// /// /// /// public static void SetTextBySupplier_K3(TextBox txt, int x, int y) { DAL.ClsK3_Supplier_View oSup = new DAL.ClsK3_Supplier_View(); if (oSup.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oSup.oModel.HName; txt.Tag = oSup.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¹©Ó¦ÉÌ /// /// /// /// public static void SetTextBySupplierNum_K3(TextBox txt, int x, int y) { DAL.ClsK3_Supplier_View oSup = new DAL.ClsK3_Supplier_View(); if (oSup.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oSup.oModel.HNumber; txt.Tag = oSup.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ°à×é /// /// /// /// public static void SetTextByGroup_K3(TextBox txt, int x, int y) { DAL.ClsK3_Group_View oGroup = new DAL.ClsK3_Group_View(); if (oGroup.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oGroup.oModel.HName; txt.Tag = oGroup.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ°à×é /// /// /// /// public static void SetTextByGroupNum_K3(TextBox txt, int x, int y) { DAL.ClsK3_Group_View oGroup = new DAL.ClsK3_Group_View(); if (oGroup.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oGroup.oModel.HNumber; txt.Tag = oGroup.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¹¤Ðò /// /// /// /// public static void SetTextByProcess_K3(TextBox txt, int x, int y) { DAL.ClsK3_Process_View oProc = new DAL.ClsK3_Process_View(); if (oProc.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oProc.oModel.HName; txt.Tag = oProc.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¹¤Ðò /// /// /// /// public static void SetTextByProcessNum_K3(TextBox txt, int x, int y) { DAL.ClsK3_Process_View oProc = new DAL.ClsK3_Process_View(); if (oProc.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oProc.oModel.HNumber; txt.Tag = oProc.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÉú²ú×ÊÔ´ /// /// /// /// public static void SetTextBySource_K3(TextBox txt, int x, int y) { DAL.ClsK3_Source_View oSource = new DAL.ClsK3_Source_View(); if (oSource.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oSource.oModel.HName; txt.Tag = oSource.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÉú²ú×ÊÔ´ /// /// /// /// public static void SetTextBySourceNum_K3(TextBox txt, int x, int y) { DAL.ClsK3_Source_View oSource = new DAL.ClsK3_Source_View(); if (oSource.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oSource.oModel.HNumber; txt.Tag = oSource.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¹¤×÷ÖÐÐÄ /// /// /// /// public static void SetTextByWorkCenter_K3(TextBox txt, int x, int y) { DAL.ClsK3_WorkCenter_View oWorkCenter = new DAL.ClsK3_WorkCenter_View(); if (oWorkCenter.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oWorkCenter.oModel.HName; txt.Tag = oWorkCenter.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¹¤×÷ÖÐÐÄ /// /// /// /// public static void SetTextByWorkCenterNum_K3(TextBox txt, int x, int y) { DAL.ClsK3_WorkCenter_View oWorkCenter = new DAL.ClsK3_WorkCenter_View(); if (oWorkCenter.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oWorkCenter.oModel.HNumber; txt.Tag = oWorkCenter.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ±Ò±ð /// /// /// /// public static void SetTextByCurrency_K3(TextBox txt, TextBox txt2, int x, int y) { DAL.ClsK3_Currency_View oCur = new DAL.ClsK3_Currency_View(); if (oCur.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oCur.oModel.HName; txt.Tag = oCur.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ½áË㷽ʽ /// /// /// /// public static void SetTextBySettleStyle_K3(TextBox txt, int x, int y) { DAL.ClsK3_SettleStyle_View oSettle = new DAL.ClsK3_SettleStyle_View(); if (oSettle.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oSettle.oModel.HName; txt.Tag = oSettle.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÏúÊÛ·½Ê½ /// /// /// /// public static void SetTextBySellStyle_K3(TextBox txt, int x, int y) { DAL.ClsK3_SellStyle_View oSS = new DAL.ClsK3_SellStyle_View(); if (oSS.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oSS.oModel.HName; txt.Tag = oSS.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } #endregion #region /// /// Ñ¡ÔñÎïÁÏ /// /// /// /// public static void SetGridByMater_K3(DataGridView grdMain, string sWhere, int i, int HMaterIDCol, int x, int y) { DAL.ClsK3_Material_View oMater = new DAL.ClsK3_Material_View(); if (oMater.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HMaterIDCol].Value = oMater.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HMaterIDCol].Value = 0; } } /// /// Ñ¡Ôñ¼ÆÁ¿µ¥Î» /// /// /// /// public static void SetGridByUnit_K3(DataGridView grdMain, string sWhere, int i, int HUnitIDCol, int x, int y) { DAL.ClsK3_Unit_View oUnit = new DAL.ClsK3_Unit_View(); if (oUnit.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HUnitIDCol].Value = oUnit.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HUnitIDCol].Value = 0; } } /// /// Ñ¡Ôñ²Ö¿â /// /// /// /// public static void SetGridByWareHouse_K3(DataGridView grdMain, string sWhere, int i, int HWhIDCol, int x, int y) { DAL.ClsK3_Warehouse_View oWh = new DAL.ClsK3_Warehouse_View(); if (oWh.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HWhIDCol].Value = oWh.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HWhIDCol].Value = 0; } } /// /// Ñ¡Ôñ²Öλ /// /// /// /// public static void SetGridByStockPlace_K3(DataGridView grdMain, string sWhere, int i, int HStockPlaceIDCol, int x, int y) { DAL.ClsK3_StockPlace_View oStockPlace = new DAL.ClsK3_StockPlace_View(); if (oStockPlace.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HStockPlaceIDCol].Value = oStockPlace.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HStockPlaceIDCol].Value = 0; } } /// /// Ñ¡Ôñ²Öλ×é /// /// /// /// public static void SetGridByStockPlaceGroup_K3(DataGridView grdMain, string sWhere, int i, int HStockPlaceGroupIDCol, int x, int y) { DAL.ClsK3_StockPlaceGroup_View oStockPlaceGroup = new DAL.ClsK3_StockPlaceGroup_View(); if (oStockPlaceGroup.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HStockPlaceGroupIDCol].Value = oStockPlaceGroup.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HStockPlaceGroupIDCol].Value = 0; } } /// /// Ñ¡ÔñÖ°Ô± /// /// /// /// public static void SetGridByEmp_K3(DataGridView grdMain, string sWhere, int i, int HEmpIDCol, int x, int y) { DAL.ClsK3_Employee_View oEmp = new DAL.ClsK3_Employee_View(); if (oEmp.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HEmpIDCol].Value = oEmp.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HEmpIDCol].Value = 0; } } /// /// Ñ¡Ôñ²¿ÃÅ /// /// /// /// public static void SetGridByDept_K3(DataGridView grdMain, string sWhere, int i, int HDeptIDCol, int x, int y) { DAL.ClsK3_Department_View oDept = new DAL.ClsK3_Department_View(); if (oDept.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HDeptIDCol].Value = oDept.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HDeptIDCol].Value = 0; } } /// /// Ñ¡Ôñ¿Í»§ /// /// /// /// public static void SetGridByCustomer_K3(DataGridView grdMain, string sWhere, int i, int HCustomerIDCol, int x, int y) { DAL.ClsK3_Customer_View oCus = new DAL.ClsK3_Customer_View(); if (oCus.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HCustomerIDCol].Value = oCus.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HCustomerIDCol].Value = 0; } } /// /// Ñ¡Ôñ¹©Ó¦ÉÌ /// /// /// /// public static void SetGridBySupplier_K3(DataGridView grdMain, string sWhere, int i, int HSupplierIDCol, int x, int y) { DAL.ClsK3_Supplier_View oSup = new DAL.ClsK3_Supplier_View(); if (oSup.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HSupplierIDCol].Value = oSup.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HSupplierIDCol].Value = 0; } } /// /// Ñ¡Ôñ°à×é /// /// /// /// public static void SetGridByGroup_K3(DataGridView grdMain, string sWhere, int i, int HGroupIDCol, int x, int y) { DAL.ClsK3_Group_View oGroup = new DAL.ClsK3_Group_View(); if (oGroup.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HGroupIDCol].Value = oGroup.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HGroupIDCol].Value = 0; } } /// /// Ñ¡Ôñ¹¤Ðò /// /// /// /// public static void SetGridByProc_K3(DataGridView grdMain, string sWhere, int i, int HProcIDCol, int x, int y) { DAL.ClsK3_Process_View oProc = new DAL.ClsK3_Process_View(); if (oProc.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HProcIDCol].Value = oProc.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HProcIDCol].Value = 0; } } /// /// Ñ¡ÔñÉú²ú×ÊÔ´ /// /// /// /// public static void SetGridBySource_K3(DataGridView grdMain, string sWhere, int i, int HSourceIDCol, int x, int y) { DAL.ClsK3_Source_View oSource = new DAL.ClsK3_Source_View(); if (oSource.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HSourceIDCol].Value = oSource.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HSourceIDCol].Value = 0; } } /// /// Ñ¡Ôñ¹¤×÷ÖÐÐÄ /// /// /// /// public static void SetGridByWorkCenter_K3(DataGridView grdMain, string sWhere, int i, int HWorkCenterIDCol, int x, int y) { DAL.ClsK3_WorkCenter_View oWorkCenter = new DAL.ClsK3_WorkCenter_View(); if (oWorkCenter.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HWorkCenterIDCol].Value = oWorkCenter.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HWorkCenterIDCol].Value = 0; } } public static void SetGridByProperty_K3(DataGridView grdMain, string sWhere, int i, int HPropertyIDCol, int x, int y) { DAL.ClsK3_Property_View oProperty = new DAL.ClsK3_Property_View(); if (oProperty.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HPropertyIDCol].Value = oProperty.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HPropertyIDCol].Value = 0; } } #endregion } }