using System;
|
using System.Collections.Generic;
|
using System.Text;
|
using System.Windows.Forms;
|
|
namespace BLL
|
{
|
/// <summary>
|
/// ·µ»ØÏÂÀ »ù´¡×ÊÁÏÐÅÏ¢Àà
|
/// </summary>
|
public class ClsBaseDownSelect
|
{
|
#region ÉèÖÃÎı¾¿ò
|
|
|
|
/// <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.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;
|
}
|
}
|
|
/// <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.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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ¹©Ó¦ÉÌ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
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;
|
}
|
}
|
|
|
/// <summary>
|
/// Ñ¡ÔñÎïÁÏ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
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;
|
}
|
}
|
|
/// <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.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;
|
}
|
}
|
/// <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.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;
|
}
|
}
|
|
|
/// <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.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;
|
}
|
}
|
|
|
/// <summary>
|
/// Ñ¡Ôñ²¿ÃÅ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
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;
|
}
|
}
|
/// <summary>
|
/// Ñ¡ÔñÏúÊÛ·½Ê½
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
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;
|
}
|
}
|
/// <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.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;
|
}
|
}
|
|
|
/// <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.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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ¿Í»§
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ±Ò±ð
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
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 ÉèÖÃÍø¸ñ
|
|
/// <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 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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡ÔñÎïÁÏ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
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
|
}
|
}
|