using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; namespace BLL { /// /// ·µ»ØÏÂÀ­ »ù´¡×ÊÁÏÐÅÏ¢Àà /// public class ClsBaseDownSelect { #region ÉèÖÃÎı¾¿ò /// /// Ñ¡Ôñ²¿ÃÅ /// /// /// /// public static void SetTextByDepartmentNum(TextBox txt, int x, int y) { DAL.ClsGy_Department_View oDepar = new DAL.ClsGy_Department_View(); if (oDepar.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oDepar.oModel.HNumber; txt.Tag = oDepar.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¸Úλ /// /// /// /// public static void SetTextByPost(TextBox txt, int x, int y) { DAL.ClsGy_Post_View oPost = new DAL.ClsGy_Post_View(); if (oPost.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oPost.oModel.HName; txt.Tag = oPost.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¹¤×ÊÀàÐÍ /// /// /// /// public static void SetTextByWorkPayType(TextBox txt, int x, int y) { DAL.ClsGy_WorkPayType_View oWorkPayType = new DAL.ClsGy_WorkPayType_View(); if (oWorkPayType.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oWorkPayType.oModel.HName; txt.Tag = oWorkPayType.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ²¿ÃÅ /// /// /// /// public static void SetTextByDepartment(TextBox txt, int x, int y) { DAL.ClsGy_Department_View oDepar = new DAL.ClsGy_Department_View(); if (oDepar.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oDepar.oModel.HName; txt.Tag = oDepar.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÉú²ú×ÊÔ´ /// /// /// /// public static void SetTextBySource(TextBox txt, int x, int y) { DAL.ClsGy_Source_View oSource = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_Source_View oSource = new DAL.ClsGy_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 SetTextByConkType(TextBox txt, int x, int y) { DAL.ClsGy_ConkType_View oConkType = new DAL.ClsGy_ConkType_View(); if (oConkType.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oConkType.oModel.HName; txt.Tag = oConkType.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¹ÊÕÏÀà±ð /// /// /// /// public static void SetTextByConkTypeNum(TextBox txt, int x, int y) { DAL.ClsGy_ConkType_View oConkType = new DAL.ClsGy_ConkType_View(); if (oConkType.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oConkType.oModel.HNumber; txt.Tag = oConkType.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÄ£¾ß·ÖÀà /// /// /// /// public static void SetTextByMouldType(TextBox txt, int x, int y) { DAL.ClsGy_MouldType_View oMouldType = new DAL.ClsGy_MouldType_View(); if (oMouldType.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oMouldType.oModel.HName; txt.Tag = oMouldType.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñBOM×é /// /// /// /// public static void SetTextByICBomGroup(TextBox txt, int x, int y) { DAL.ClsGy_ICBomGroup_View oICBomGroup = new DAL.ClsGy_ICBomGroup_View(); if (oICBomGroup.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oICBomGroup.oModel.HName; txt.Tag = oICBomGroup.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÉ豸 /// /// /// /// public static void SetTextByEquipMent(TextBox txt, int x, int y) { DAL.ClsGy_EquipMent_View oEquipMent = new DAL.ClsGy_EquipMent_View(); if (oEquipMent.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oEquipMent.oModel.HName; txt.Tag = oEquipMent.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÉ豸 /// /// /// /// public static void SetTextByEquipMentNum(TextBox txt, int x, int y) { DAL.ClsGy_EquipMent_View oEquipMent = new DAL.ClsGy_EquipMent_View(); if (oEquipMent.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oEquipMent.oModel.HNumber; txt.Tag = oEquipMent.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¸¨ÖúÊôÐÔ /// /// /// /// public static void SetTextByProperty(TextBox txt, int x, int y) { DAL.ClsGy_Property_View oProperty = new DAL.ClsGy_Property_View(); if (oProperty.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oProperty.oModel.HName; txt.Tag = oProperty.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÎïÁÏ /// /// /// /// public static void SetTextByMater(TextBox txt,int x,int y) { DAL.ClsGy_Material_View oMater = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_Material_View oMater = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_Unit_View oUnit = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_Unit_View oUnit = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_Warehouse_View oWH = new DAL.ClsGy_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 SetTextByVirtualWarehouse(TextBox txt, int x, int y) { DAL.ClsGy_VirtualWarehouse_View oWH = new DAL.ClsGy_VirtualWarehouse_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(TextBox txt, int x, int y) { DAL.ClsGy_Warehouse_View oWH = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_StockPlace_View oStockPlace = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_StockPlace_View oStockPlace = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_StockPlaceGroup_View oStockPlaceGroup = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_StockPlaceGroup_View oStockPlaceGroup = new DAL.ClsGy_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 SetTextByRepair(TextBox txt, int x, int y) { DAL.ClsGy_Repair_View oRepair = new DAL.ClsGy_Repair_View(); if (oRepair.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oRepair.oModel.HName; txt.Tag = oRepair.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñάÐÞÏîÄ¿ /// /// /// /// public static void SetTextByRepairNum(TextBox txt, int x, int y) { DAL.ClsGy_Repair_View oRepair = new DAL.ClsGy_Repair_View(); if (oRepair.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oRepair.oModel.HNumber; txt.Tag = oRepair.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÖ°Ô± /// /// /// /// public static void SetTextByEmployee(TextBox txt, int x, int y) { DAL.ClsGy_Employee_View oEmp = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_Employee_View oEmp = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_Department_View oDept = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_Department_View oDept = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_Customer_View oCus = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_Customer_View oCus = new DAL.ClsGy_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(TextBox txt,int x,int y) { DAL.ClsGy_Supplier_View oSupplier = new DAL.ClsGy_Supplier_View(); if (oSupplier.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oSupplier.oModel.HName; txt.Tag = oSupplier.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¹©Ó¦ÉÌ /// /// /// /// public static void SetTextBySupplierNum(TextBox txt, int x, int y) { DAL.ClsGy_Supplier_View oSupplier = new DAL.ClsGy_Supplier_View(); if (oSupplier.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oSupplier.oModel.HNumber; txt.Tag = oSupplier.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¹¤Ðò /// /// /// /// public static void SetTextByProcess(TextBox txt, Int64 HMainProcID, int x, int y) { DAL.ClsGy_Process_View oProc = new DAL.ClsGy_Process_View(); if (oProc.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%') and HMainProcID=" + HMainProcID, x, y)) { txt.Text = oProc.oModel.HName; txt.Tag = oProc.oModel.HItemID.ToString(); txt.SelectAll(); } else { txt.Text = ""; } } /// /// Ñ¡Ôñ°à×é /// /// /// /// public static void SetTextByGroup(TextBox txt, Int64 HCenterID, int x, int y) { DAL.ClsGy_Group_View oGroup = new DAL.ClsGy_Group_View(); if (oGroup.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%') and HCenterID=" + HCenterID, x, y)) { txt.Text = oGroup.oModel.HName; txt.Tag = oGroup.oModel.HItemID.ToString(); txt.SelectAll(); } else { txt.Text = ""; } } /// /// Ñ¡Ôñ°à×é /// /// /// /// public static void SetTextByGroup(TextBox txt, int x, int y) { DAL.ClsGy_Group_View oGroup = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_Group_View oGroup = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_Process_View oProc = new DAL.ClsGy_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(TextBox txt, int x, int y) { DAL.ClsGy_Process_View oProc = new DAL.ClsGy_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 SetTextByWorkType(TextBox txt, int x, int y) { DAL.ClsGy_WorkType_View oWorkType = new DAL.ClsGy_WorkType_View(); if (oWorkType.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oWorkType.oModel.HName; txt.Tag = oWorkType.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¹¤ÖÖ /// /// /// /// public static void SetTextByWorkTypeNum(TextBox txt, int x, int y) { DAL.ClsGy_WorkType_View oWorkType = new DAL.ClsGy_WorkType_View(); if (oWorkType.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oWorkType.oModel.HNumber; txt.Tag = oWorkType.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¿Û²¹×ÊÁÏ /// /// /// /// public static void SetTextByDuSubsidyItem(TextBox txt, int x, int y) { DAL.ClsGy_DuSubsidyItem_View oDuSubsidyItem = new DAL.ClsGy_DuSubsidyItem_View(); if (oDuSubsidyItem.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oDuSubsidyItem.oModel.HName; txt.Tag = oDuSubsidyItem.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ¿Û²¹×ÊÁÏ /// /// /// /// public static void SetTextByDuSubsidyItemNum(TextBox txt, int x, int y) { DAL.ClsGy_DuSubsidyItem_View oDuSubsidyItem = new DAL.ClsGy_DuSubsidyItem_View(); if (oDuSubsidyItem.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oDuSubsidyItem.oModel.HNumber; txt.Tag = oDuSubsidyItem.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÍâ³öÀàÐÍ /// /// /// /// public static void SetTextByLeave(TextBox txt, int x, int y) { DAL.ClsGy_Leave_View oLe = new DAL.ClsGy_Leave_View(); if (oLe.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oLe.oModel.HName; txt.Tag = oLe.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÍâ³öÀàÐÍ /// /// /// /// public static void SetTextByLeaveNum(TextBox txt, int x, int y) { DAL.ClsGy_Leave_View oLe = new DAL.ClsGy_Leave_View(); if (oLe.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oLe.oModel.HNumber; txt.Tag = oLe.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ±Ò±ð /// /// /// /// public static void SetTextByCurrency(TextBox txt,TextBox txt2, int x, int y) { DAL.ClsGy_Currency_View oCur = new DAL.ClsGy_Currency_View(); if (oCur.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%'or HExchangeRate like '%" + txt2.Text + "%')", x, y)) { txt.Text = oCur.oModel.HName; txt.Tag = oCur.oModel.HItemID.ToString(); txt2.Text = oCur.omodel.HExchangeRate.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡Ôñ½áË㷽ʽ /// /// /// /// public static void SetTextBySettleStyle(TextBox txt, int x, int y) { DAL.ClsGy_SettleStyle_View oSettle = new DAL.ClsGy_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 SetTextByPoStockStyle(TextBox txt, int x, int y) { DAL.ClsGy_PoStockStyle_View oPSS = new DAL.ClsGy_PoStockStyle_View(); if (oPSS.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oPSS.oModel.HName; txt.Tag = oPSS.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// Ñ¡ÔñÏúÊÛ·½Ê½ /// /// /// /// public static void SetTextBySellStyle(TextBox txt, int x, int y) { DAL.ClsGy_SellStyle_View oSS = new DAL.ClsGy_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; } } /// /// Ñ¡ÔñÒøÐÐ /// /// /// /// public static void SetTextByBank(TextBox txt, int x, int y) { DAL.ClsGy_Bank_View oBank = new DAL.ClsGy_Bank_View(); if (oBank.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oBank.oModel.HName; txt.Tag = oBank.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// ÔËÊ乫˾ /// /// /// /// public static void SetTextByConveyComp(TextBox txt, int x, int y) { DAL.ClsGy_ConveyComp_View oComp = new DAL.ClsGy_ConveyComp_View(); if (oComp.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oComp.oModel.HName; txt.Tag = oComp.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// ÔËÊ䷽ʽ /// /// /// /// public static void SetTextByConveyType(TextBox txt, int x, int y) { DAL.ClsGy_ConveyType_View oType = new DAL.ClsGy_ConveyType_View(); if (oType.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oType.oModel.HName; txt.Tag = oType.oModel.HItemID.ToString(); txt.ForeColor = System.Drawing.Color.Blue; txt.SelectAll(); } else { txt.Text = ""; txt.ForeColor = System.Drawing.Color.Black; } } /// /// ÈÎÎñµ¥ºÅ /// /// /// /// public static void SetTextByICMOBillNo(TextBox txt, int x, int y) { //DAL.ClsSc_ICMOBill oICMO = new DAL.ClsSc_ICMOBill(); //if (oICMO.RefreshViewDownMenu(" and HNumber like '%" + txt.Text + "%'", x, y)) //{ // txt.Text = oICMO.oModel.HNumber; // txt.Tag = oICMO.oModel.HItemID.ToString(); // txt.ForeColor = System.Drawing.Color.Blue; // txt.SelectAll(); //} //else //{ // txt.Text = ""; // txt.Tag = 0; // txt.ForeColor = System.Drawing.Color.Black; //} } #endregion #region /// /// Ñ¡Ôñ°à´Î /// /// /// /// public static void SetGridByShifts(DataGridView grdMain, string sWhere, int i, int HSchClassIDCol, int x, int y) { DAL.ClsGy_Shifts_View oShifts = new DAL.ClsGy_Shifts_View(); if (oShifts.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HSchClassIDCol].Value = oShifts.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HSchClassIDCol].Value = 0; } } /// /// Ñ¡ÔñºËË㷽ʽ /// /// /// /// public static void SetGridByClassTimePrj(DataGridView grdMain, string sWhere, int i, int HCTPrjIDCol, int x, int y) { DAL.ClsGy_ClassTimePrj_View oCTP = new DAL.ClsGy_ClassTimePrj_View(); if (oCTP.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HCTPrjIDCol].Value = oCTP.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HCTPrjIDCol].Value = 0; } } /// /// Ñ¡Ôñ¸Úλ /// /// /// /// public static void SetGridByPost(DataGridView grdMain, string sWhere, int i, int HPostIDCol, int x, int y) { DAL.ClsGy_Post_View oPost = new DAL.ClsGy_Post_View(); if (oPost.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HPostIDCol].Value = oPost.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HPostIDCol].Value = 0; } } /// /// Ñ¡ÔñÉú²ú×ÊÔ´ /// /// /// /// public static void SetGridBySource(DataGridView grdMain, string sWhere, int i, int HSourceIDCol, int x, int y) { DAL.ClsGy_Source_View oSource = new DAL.ClsGy_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 SetGridByBadReason(DataGridView grdMain, string sWhere, int i, int HBadReasonIDCol, int x, int y) { DAL.ClsGy_BadReason_View oBadReason = new DAL.ClsGy_BadReason_View(); if (oBadReason.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HBadReasonIDCol].Value = oBadReason.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HBadReasonIDCol].Value = 0; } } /// /// Ñ¡Ôñ¸¨ÖúÊôÐÔ /// /// /// /// public static void SetGridByProperty(DataGridView grdMain, string sWhere, int i, int HPropertyIDCol, int x, int y) { DAL.ClsGy_Property_View oProperty = new DAL.ClsGy_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; } } /// /// Ñ¡ÔñάÐÞÏîÄ¿ /// /// /// /// public static void SetGridByRepair(DataGridView grdMain, string sWhere, int i, int HRepairIDCol, int x, int y) { DAL.ClsGy_Repair_View oRepair = new DAL.ClsGy_Repair_View(); if (oRepair.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HRepairIDCol].Value = oRepair.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HRepairIDCol].Value = 0; } } /// /// Ñ¡Ôñ¹ÊÕÏÔ­Òò /// /// /// /// public static void SetGridByConkReason(DataGridView grdMain, string sWhere, int i, int HConkReasonIDCol, int x, int y) { DAL.ClsGy_ConkReason_View oConkReason = new DAL.ClsGy_ConkReason_View(); if (oConkReason.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HConkReasonIDCol].Value = oConkReason.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HConkReasonIDCol].Value = 0; } } /// /// Ñ¡Ôñ¹¤×÷ÖÐÐÄ /// /// /// /// public static void SetGridByWorkCenter(DataGridView grdMain, string sWhere, int i, int HWorkCenterIDCol, int x, int y) { DAL.ClsGy_WorkCenter_View oWorkCenter = new DAL.ClsGy_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 SetGridByRepairCheck(DataGridView grdMain, string sWhere, int i, int HRepairCheckIDCol, int x, int y) { DAL.ClsGy_RepairCheck_View oRepairCheck = new DAL.ClsGy_RepairCheck_View(); if (oRepairCheck.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HRepairCheckIDCol].Value = oRepairCheck.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HRepairCheckIDCol].Value = 0; } } /// /// Ñ¡ÔñÉ豸 /// /// /// /// public static void SetGridByEquipMent(DataGridView grdMain, string sWhere, int i, int HEquipIDCol, int x, int y) { DAL.ClsGy_EquipMent_View oEquipMent = new DAL.ClsGy_EquipMent_View(); if (oEquipMent.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HEquipIDCol].Value = oEquipMent.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HEquipIDCol].Value = 0; } } /// /// Ñ¡ÔñÎïÁÏ /// /// /// /// public static void SetGridByMater(DataGridView grdMain, string sWhere, int i, int HMaterIDCol, int x, int y) { DAL.ClsGy_Material_View oMater = new DAL.ClsGy_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(DataGridView grdMain, string sWhere, int i, int HUnitIDCol, int x, int y) { DAL.ClsGy_Unit_View oUnit = new DAL.ClsGy_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(DataGridView grdMain, string sWhere, int i, int HWhIDCol, int x, int y) { DAL.ClsGy_Warehouse_View oWh = new DAL.ClsGy_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 SetGridByVirtualWareHouse(DataGridView grdMain, string sWhere, int i, int HWhIDCol, int x, int y) { DAL.ClsGy_VirtualWarehouse_View oWh = new DAL.ClsGy_VirtualWarehouse_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(DataGridView grdMain, string sWhere, int i, int HStockPlaceIDCol, int x, int y) { DAL.ClsGy_StockPlace_View oStockPlace = new DAL.ClsGy_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(DataGridView grdMain, string sWhere, int i, int HStockPlaceGroupIDCol, int x, int y) { DAL.ClsGy_StockPlaceGroup_View oStockPlaceGroup = new DAL.ClsGy_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(DataGridView grdMain, string sWhere, int i, int HEmpIDCol, int x, int y) { DAL.ClsGy_Employee_View oEmp = new DAL.ClsGy_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(DataGridView grdMain, string sWhere, int i, int HDeptIDCol, int x, int y) { DAL.ClsGy_Department_View oDept = new DAL.ClsGy_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(DataGridView grdMain, string sWhere, int i, int HCustomerIDCol, int x, int y) { DAL.ClsGy_Customer_View oCus = new DAL.ClsGy_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(DataGridView grdMain, string sWhere, int i, int HSupplierIDCol, int x, int y) { DAL.ClsGy_Supplier_View oSupplier = new DAL.ClsGy_Supplier_View(); if (oSupplier.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HSupplierIDCol].Value = oSupplier.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HSupplierIDCol].Value = 0; } } /// /// Ñ¡Ôñ°à×é /// /// /// /// public static void SetGridByGroup(DataGridView grdMain, string sWhere, int i, int HGroupIDCol, int x, int y) { DAL.ClsGy_Group_View oGroup = new DAL.ClsGy_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(DataGridView grdMain, string sWhere, int i, int HProcIDCol, int x, int y) { DAL.ClsGy_Process_View oProc = new DAL.ClsGy_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 SetGridByWorkType(DataGridView grdMain, string sWhere, int i, int HWorkTypeIDCol, int x, int y) { DAL.ClsGy_WorkType_View oWorkType = new DAL.ClsGy_WorkType_View(); if (oWorkType.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HWorkTypeIDCol].Value = oWorkType.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HWorkTypeIDCol].Value = 0; } } /// /// Ñ¡Ôñ¿Û²¹×ÊÁÏ /// /// /// /// public static void SetGridByDuSubsidyItem(DataGridView grdMain, string sWhere, int i, int HDuSubsidyItemIDCol, int x, int y) { DAL.ClsGy_DuSubsidyItem_View oDuSubsidyItem = new DAL.ClsGy_DuSubsidyItem_View(); if (oDuSubsidyItem.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HDuSubsidyItemIDCol].Value = oDuSubsidyItem.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HDuSubsidyItemIDCol].Value = 0; } } /// /// Ñ¡ÔñÍâ³öÀàÐÍ /// /// /// /// public static void SetGridByLeave(DataGridView grdMain, string sWhere, int i, int HLeaveIDCol, int x, int y) { DAL.ClsGy_Leave_View oLe = new DAL.ClsGy_Leave_View(); if (oLe.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HLeaveIDCol].Value = oLe.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HLeaveIDCol].Value = 0; } } #endregion } }