using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; namespace BLL { /// /// ·µ»ØÏÂÀ­ »ù´¡×ÊÁÏÐÅÏ¢Àà /// public class ClsBaseDownSelect { #region ÉèÖÃÎı¾¿ò /// /// Ñ¡ÔñÎïÁÏ /// /// /// /// public static void SetTextByMater(TextBox txt, int x, int y) { DAL.ClsGy_Material_View oMater = new DAL.ClsGy_Material_View(); if (oMater.RefreshViewDownMenu(" and ( HHelpCode like '%" + txt.Text + "%' or HModel like '%" + txt.Text + "%' or HName like '%" + txt.Text + "%' or HNumber 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 SetTextBySupplier(TextBox txt, int x, int y) { DAL.ClsGy_Supplier_View oSupplier = new DAL.ClsGy_Supplier_View(); if (oSupplier.RefreshViewDownMenu(" and (HHelpCode like '%" + txt.Text + "%' or 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 SetTextBySupplier(TextBox txt, int x, int y,bool isNumber,TextBox txtName) { DAL.ClsGy_Supplier_View oSupplier = new DAL.ClsGy_Supplier_View(); if (oSupplier.RefreshViewDownMenu(" and (HHelpCode like '%" + txt.Text + "%' or HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oSupplier.oModel.HNumber; txtName.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 SetTextByMater(TextBox txt, int x, int y, bool isNumber, TextBox txtName,TextBox txtModel) { DAL.ClsGy_Material_View oMater = new DAL.ClsGy_Material_View(); if (oMater.RefreshViewDownMenu(" and (HHelpCode like '%" + txt.Text + "%' or HModel like '%" + txt.Text + "%' or HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oMater.oModel.HNumber; txtName.Text = oMater.oModel.HName; txtModel.Text = oMater.oModel.HModel; 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 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 SetTextByEmployee(TextBox txt, int x, int y) { DAL.ClsGy_Employee_View oEmployee = new DAL.ClsGy_Employee_View(); if (oEmployee.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oEmployee.oModel.HName; txt.Tag = oEmployee.oModel.HItemID.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 oSS = new DAL.ClsGy_SettleStyle_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 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 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 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 SetTextByCustomer(TextBox txt, int x, int y) { DAL.ClsGy_Customer_View oCus = new DAL.ClsGy_Customer_View(); if (oCus.RefreshViewDownMenu(" and (HHelpCode like '%" + txt.Text + "%' or 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 SetTextByCustomer(TextBox txt, int x, int y,bool isNumber,TextBox txtHName) { DAL.ClsGy_Customer_View oCus = new DAL.ClsGy_Customer_View(); if (oCus.RefreshViewDownMenu(" and (HHelpCode like '%" + txt.Text + "%' or HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y)) { txt.Text = oCus.oModel.HNumber; txtHName.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 SetTextByCurrency(TextBox txt, 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 + "%')", 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; } } #endregion #region ÉèÖÃÍø¸ñ /// /// Ñ¡ÔñÎïÁÏ /// /// /// /// public static void SetGridByMater(DataGridView grdMain, string sWhere, int i, int HMaterIDCol, int HQuery1Col, int HQuery2Col, int HQuery3Col, int HQuery4Col, int HQuery5Col, int x, int y) { DAL.ClsGy_Material_View oMater = new DAL.ClsGy_Material_View(); if (oMater.RefreshViewDownMenu(" and (HHelpCode like '%" + sWhere + "%' or HModel like '%" + sWhere + "%' or HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%'or HQuery1 like '%" + sWhere + "%'or HQuery2 like '%" + sWhere + "%'or HQuery3 like '%" + sWhere + "%'or HQuery4 like '%" + sWhere + "%'or HQuery5 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 SetGridByMater_yt(Int64 HCusID, DataGridView grdMain, string sWhere, int i, int HMaterIDCol, int HQuery1, int HQuery2, int HQuery3, int HQuery4, int HQuery5, int x, int y) { DAL.ClsGy_Material_View oMater = new DAL.ClsGy_Material_View(); if (oMater.RefreshViewDownMenu_yt(HCusID, " and (HSubjoin like '%" + sWhere + "%' or HHelpCode like '%" + sWhere + "%' or HModel like '%" + sWhere + "%' or HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%'or HQuery1 like '%" + sWhere + "%' or HQuery2 like '%" + sWhere + "%' or HQuery3 like '%" + sWhere + "%' or HQuery4 like '%" + sWhere + "%' or HQuery5 like '%" + sWhere + "%' )", x, y)) { grdMain.Rows[i].Cells[HMaterIDCol].Value = oMater.oModel.HItemID.ToString(); } else { grdMain.Rows[i].Cells[HMaterIDCol].Value = 0; } } #endregion } }