using System;
|
using System.Collections.Generic;
|
using System.Text;
|
using System.Windows.Forms;
|
|
namespace BLL
|
{
|
/// <summary>
|
/// ·µ»ØÏÂÀ »ù´¡×ÊÁÏÐÅÏ¢Àà
|
/// </summary>
|
public class ClsBaseDownSelect_InterFace
|
{
|
|
#region ÉèÖÃÎı¾¿ò
|
|
/// <summary>
|
/// Ñ¡Ôñ½áË㷽ʽ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextBySettleStyle(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_SettleStyle_View oSettle = new DAL.ClsIF_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;
|
}
|
}
|
|
|
/// <summary>
|
/// Ñ¡Ôñ²É¹º·½Ê½
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByPoStockStyle(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_PoStockStyle_View oPSS = new DAL.ClsIF_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;
|
}
|
}
|
|
|
/// <summary>
|
/// Ñ¡Ôñ±Ò±ð
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByCurrency(TextBox txt, TextBox txt2, int x, int y)
|
{
|
DAL.ClsIF_Currency_View oCur = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ¹©Ó¦ÉÌ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextBySupplier(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Supplier_View oSupplier = new DAL.ClsIF_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;
|
}
|
}
|
/// <summary>
|
/// Ñ¡Ôñ¹¤Î»
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByStation(TextBox txt, int x, int y)
|
{
|
DAL.ClsGy_WorkStation_View oStation = new DAL.ClsGy_WorkStation_View();
|
if (oStation.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y))
|
{
|
txt.Text = oStation.oModel.HNumber;
|
txt.Tag = oStation.oModel.HItemID.ToString();
|
txt.ForeColor = System.Drawing.Color.Blue;
|
txt.SelectAll();
|
}
|
else
|
{
|
txt.Text = "";
|
txt.ForeColor = System.Drawing.Color.Black;
|
}
|
}
|
|
|
/// <summary>
|
/// Ñ¡ÔñÄ£¾ß
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByMould(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Mould_View oMater = new DAL.ClsIF_Mould_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;
|
}
|
}
|
|
|
/// <summary>
|
/// Ñ¡ÔñÎïÁÏ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByMater(TextBox txt, TextBox txt2, TextBox txt3, int x, int y)
|
{
|
DAL.ClsIF_Material_View oMater = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡ÔñÎïÁÏ´ø³ö¼ÆÁ¿µ¥Î»
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByMater(TextBox txtNumber, TextBox txtName, TextBox txtModel, TextBox txtUnit, int x, int y)
|
{
|
DAL.ClsIF_Material_View oMater = new DAL.ClsIF_Material_View();
|
DAL.ClsIF_Unit_View oUnit = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡ÔñÎïÁÏ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByMater(TextBox txt,int x,int y)
|
{
|
DAL.ClsIF_Material_View oMater = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡ÔñÎïÁÏ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByMaterNum(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Material_View oMater = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ¼ÆÁ¿µ¥Î»
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByUnit(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Unit_View oUnit = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ¼ÆÁ¿µ¥Î»
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByUnitNum(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Unit_View oUnit = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ²Ö¿â
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByWarehouse(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Warehouse_View oWh = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ²Ö¿â
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByWarehouseNum(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Warehouse_View oWh = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ²Öλ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByStockPlace(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_StockPlace_View oSP = new DAL.ClsIF_StockPlace_View();
|
if (oSP.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y))
|
{
|
txt.Text = oSP.oModel.HName;
|
txt.Tag = oSP.oModel.HItemID.ToString();
|
txt.ForeColor = System.Drawing.Color.Blue;
|
txt.SelectAll();
|
}
|
else
|
{
|
txt.Text = "";
|
txt.ForeColor = System.Drawing.Color.Black;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ²Öλ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByStockPlaceNum(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_StockPlace_View oSP = new DAL.ClsIF_StockPlace_View();
|
if (oSP.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y))
|
{
|
txt.Text = oSP.oModel.HNumber;
|
txt.Tag = oSP.oModel.HItemID.ToString();
|
txt.ForeColor = System.Drawing.Color.Blue;
|
txt.SelectAll();
|
}
|
else
|
{
|
txt.Text = "";
|
txt.ForeColor = System.Drawing.Color.Black;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ²Öλ×é
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByStockPlaceGroup(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_StockPlaceGroup_View oSPG = new DAL.ClsIF_StockPlaceGroup_View();
|
if (oSPG.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y))
|
{
|
txt.Text = oSPG.oModel.HName;
|
txt.Tag = oSPG.oModel.HItemID.ToString();
|
txt.ForeColor = System.Drawing.Color.Blue;
|
txt.SelectAll();
|
}
|
else
|
{
|
txt.Text = "";
|
txt.ForeColor = System.Drawing.Color.Black;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ²Öλ×é
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByStockPlaceGroupNum(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_StockPlaceGroup_View oSPG = new DAL.ClsIF_StockPlaceGroup_View();
|
if (oSPG.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y))
|
{
|
txt.Text = oSPG.oModel.HNumber;
|
txt.Tag = oSPG.oModel.HItemID.ToString();
|
txt.ForeColor = System.Drawing.Color.Blue;
|
txt.SelectAll();
|
}
|
else
|
{
|
txt.Text = "";
|
txt.ForeColor = System.Drawing.Color.Black;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡ÔñÖ°Ô±
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByEmployee(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Employee_View oEmp = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡ÔñÖ°Ô±
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByEmployeeNum(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Employee_View oEmp = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ²¿ÃÅ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByDept(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Department_View oDep = new DAL.ClsIF_Department_View();
|
if (oDep.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y))
|
{
|
txt.Text = oDep.oModel.HName;
|
txt.Tag = oDep.oModel.HItemID.ToString();
|
txt.ForeColor = System.Drawing.Color.Blue;
|
txt.SelectAll();
|
}
|
else
|
{
|
txt.Text = "";
|
txt.ForeColor = System.Drawing.Color.Black;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ²¿ÃÅ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByDeptNum(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Department_View oDep = new DAL.ClsIF_Department_View();
|
if (oDep.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y))
|
{
|
txt.Text = oDep.oModel.HNumber;
|
txt.Tag = oDep.oModel.HItemID.ToString();
|
txt.ForeColor = System.Drawing.Color.Blue;
|
txt.SelectAll();
|
}
|
else
|
{
|
txt.Text = "";
|
txt.ForeColor = System.Drawing.Color.Black;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ¿Í»§
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByCustomer(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Customer_View oCus = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ¿Í»§
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByCustomerNum(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Customer_View oCus = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ°à×é
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByGroup(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Group_View oGroup = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ°à×é
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByGroupNum(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Group_View oGroup = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ¹¤Ðò
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByProcess(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Process_View oPro = new DAL.ClsIF_Process_View();
|
if (oPro.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y))
|
{
|
txt.Text = oPro.oModel.HName;
|
txt.Tag = oPro.oModel.HItemID.ToString();
|
txt.ForeColor = System.Drawing.Color.Blue;
|
txt.SelectAll();
|
}
|
else
|
{
|
txt.Text = "";
|
txt.ForeColor = System.Drawing.Color.Black;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ¹¤Ðò
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByProcessNum(TextBox txt, int x, int y)
|
{
|
DAL.ClsIF_Process_View oPro = new DAL.ClsIF_Process_View();
|
if (oPro.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y))
|
{
|
txt.Text = oPro.oModel.HNumber;
|
txt.Tag = oPro.oModel.HItemID.ToString();
|
txt.ForeColor = System.Drawing.Color.Blue;
|
txt.SelectAll();
|
}
|
else
|
{
|
txt.Text = "";
|
txt.ForeColor = System.Drawing.Color.Black;
|
}
|
}
|
|
|
|
#endregion
|
|
|
#region
|
|
/// <summary>
|
/// Ñ¡Ôñ¸¨ÖúÊôÐÔ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByProperty(DataGridView grdMain, string sWhere, int i, int HPropertyIDCol, int x, int y)
|
{
|
DAL.ClsIF_Property_View oProp = new DAL.ClsIF_Property_View();
|
if (oProp.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y))
|
{
|
grdMain.Rows[i].Cells[HPropertyIDCol].Value = oProp.oModel.HItemID.ToString();
|
}
|
else
|
{
|
grdMain.Rows[i].Cells[HPropertyIDCol].Value = 0;
|
}
|
}
|
|
|
/// <summary>
|
/// Ñ¡ÔñÉú²ú×ÊÔ´
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridBySource(DataGridView grdMain, string sWhere, int i, int HSourceIDCol, int x, int y)
|
{
|
DAL.ClsIF_Source_View oSource = new DAL.ClsIF_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;
|
}
|
}
|
|
|
/// <summary>
|
/// Ñ¡ÔñÎïÁÏ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByMould(DataGridView grdMain, string sWhere, int i, int HMaterIDCol, int x, int y)
|
{
|
DAL.ClsIF_Mould_View oMater = new DAL.ClsIF_Mould_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡ÔñÎïÁÏ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByMater(DataGridView grdMain, string sWhere, int i, int HMaterIDCol, int x, int y)
|
{
|
DAL.ClsIF_Material_View oMater = new DAL.ClsIF_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;
|
}
|
}
|
|
|
/// <summary>
|
/// Ñ¡Ôñ¹¤Î»
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByStation(DataGridView grdMain, string sWhere, int i, int HWorkStationID, int x, int y)
|
{
|
DAL.ClsGy_WorkStation_View oStation = new DAL.ClsGy_WorkStation_View();
|
if (oStation.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y))
|
{
|
grdMain.Rows[i].Cells[HWorkStationID].Value = oStation.oModel.HItemID.ToString();
|
}
|
else
|
{
|
grdMain.Rows[i].Cells[HWorkStationID].Value = 0;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ¹¤×÷ÖÐÐÄ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByCenter(DataGridView grdMain, string sWhere, int i, int HCenterID, int x, int y)
|
{
|
DAL.ClsIF_WorkCenter_View oCenter = new DAL.ClsIF_WorkCenter_View();
|
if (oCenter.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y))
|
{
|
grdMain.Rows[i].Cells[HCenterID].Value = oCenter.oModel.HItemID.ToString();
|
}
|
else
|
{
|
grdMain.Rows[i].Cells[HCenterID].Value = 0;
|
}
|
}
|
|
|
/// <summary>
|
/// Ñ¡Ôñ¼ÆÁ¿µ¥Î»
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByUnit(DataGridView grdMain, string sWhere, int i, int HUnitIDCol, int x, int y)
|
{
|
DAL.ClsIF_Unit_View oUnit = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ²Ö¿â
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByWareHouse(DataGridView grdMain, string sWhere, int i, int HWhIDCol, int x, int y)
|
{
|
DAL.ClsIF_Warehouse_View oWh = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ²Öλ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByStockPlace(DataGridView grdMain, string sWhere, int i, int HStockPlaceIDCol, int x, int y)
|
{
|
DAL.ClsIF_StockPlace_View oSP = new DAL.ClsIF_StockPlace_View();
|
if (oSP.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y))
|
{
|
grdMain.Rows[i].Cells[HStockPlaceIDCol].Value = oSP.oModel.HItemID.ToString();
|
}
|
else
|
{
|
grdMain.Rows[i].Cells[HStockPlaceIDCol].Value = 0;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ²Öλ×é
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByStockPlaceGroup(DataGridView grdMain, string sWhere, int i, int HStockPlaceGroupIDCol, int x, int y)
|
{
|
DAL.ClsIF_StockPlaceGroup_View oSPG = new DAL.ClsIF_StockPlaceGroup_View();
|
if (oSPG.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y))
|
{
|
grdMain.Rows[i].Cells[HStockPlaceGroupIDCol].Value = oSPG.oModel.HItemID.ToString();
|
}
|
else
|
{
|
grdMain.Rows[i].Cells[HStockPlaceGroupIDCol].Value = 0;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡ÔñÖ°Ô±
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByEmp(DataGridView grdMain, string sWhere, int i, int HEmpIDCol, int x, int y)
|
{
|
DAL.ClsIF_Employee_View oEmp = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ²¿ÃÅ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByDept(DataGridView grdMain, string sWhere, int i, int HDeptIDCol, int x, int y)
|
{
|
DAL.ClsIF_Department_View oDep = new DAL.ClsIF_Department_View();
|
if (oDep.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y))
|
{
|
grdMain.Rows[i].Cells[HDeptIDCol].Value = oDep.oModel.HItemID.ToString();
|
}
|
else
|
{
|
grdMain.Rows[i].Cells[HDeptIDCol].Value = 0;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ¿Í»§
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByCustomer(DataGridView grdMain, string sWhere, int i, int HCustomerIDCol, int x, int y)
|
{
|
DAL.ClsIF_Customer_View oCus = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ°à×é
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByGroup(DataGridView grdMain, string sWhere, int i, int HGroupIDCol, int x, int y)
|
{
|
DAL.ClsIF_Group_View oGroup = new DAL.ClsIF_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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ¹¤Ðò
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByProc(DataGridView grdMain, string sWhere, int i, int HProcIDCol, int x, int y)
|
{
|
DAL.ClsIF_Process_View oPro = new DAL.ClsIF_Process_View();
|
if (oPro.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y))
|
{
|
grdMain.Rows[i].Cells[HProcIDCol].Value = oPro.oModel.HItemID.ToString();
|
}
|
else
|
{
|
grdMain.Rows[i].Cells[HProcIDCol].Value = 0;
|
}
|
}
|
|
#endregion
|
}
|
}
|