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_K3(TextBox txtHMaterID, TextBox txtHMaterName,TextBox txtHMaterModel, int x, int y)
|
{
|
DAL.ClsK3_Material_View oMater = new DAL.ClsK3_Material_View();
|
if (oMater.RefreshViewDownMenu(" and ( HName like '%" + txtHMaterID.Text + "%' or HNumber like '%" + txtHMaterID.Text + "%' or HModel like '%" + txtHMaterID.Text + "%' )", x, y))
|
{
|
if (oMater.GetInfoByID(oMater.oModel.HItemID))
|
{
|
txtHMaterID.Text = oMater.omodel.HNumber;
|
txtHMaterID.Tag = oMater.omodel.HItemID.ToString();
|
txtHMaterName.Text = oMater.omodel.HName;
|
txtHMaterModel.Text = oMater.omodel.HModel;
|
//txtHMaterID.ForeColor = System.Drawing.Color.Blue;
|
txtHMaterID.SelectAll();
|
}
|
else
|
{
|
txtHMaterID.Tag = "";
|
txtHMaterID.Text = "";
|
txtHMaterName.Text = "";
|
txtHMaterModel.Text = "";
|
}
|
}
|
else
|
{
|
txtHMaterID.Tag = "";
|
txtHMaterID.Text = "";
|
txtHMaterName.Text = "";
|
txtHMaterModel.Text = "";
|
//txtHMaterID.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, 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 = "";
|
}
|
}
|
|
|
/// <summary>
|
/// Ñ¡Ôñ¹¤Ðò
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
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 = "";
|
}
|
}
|
|
/// <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 ( 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 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 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 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;
|
}
|
}
|
|
/// <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 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;
|
}
|
}
|
|
/// <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 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 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;
|
}
|
}
|
/// <summary>
|
/// Ñ¡ÔñÒøÐÐ
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡ÔñÔËÊ乫˾
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetTextByConveyComp(TextBox txt, int x, int y)
|
{
|
DAL.ClsGy_ConveyComp_View oCC = new DAL.ClsGy_ConveyComp_View();
|
if (oCC.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y))
|
{
|
txt.Text = oCC.oModel.HName;
|
txt.Tag = oCC.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 SetTextByConveyType(TextBox txt, int x, int y)
|
{
|
DAL.ClsGy_ConveyType_View oCT = new DAL.ClsGy_ConveyType_View();
|
if (oCT.RefreshViewDownMenu(" and ( HName like '%" + txt.Text + "%' or HNumber like '%" + txt.Text + "%')", x, y))
|
{
|
txt.Text = oCT.oModel.HName;
|
txt.Tag = oCT.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 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;
|
}
|
}
|
|
/// <summary>
|
/// Ñ¡Ôñ²»Á¼ÔÒò
|
/// </summary>
|
/// <param name="txt"></param>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public static void SetGridByBadReason(DataGridView grdMain, string sWhere, int i, int HBadReasonCol, int x, int y)
|
{
|
DAL.ClsK3_BadReason_View oBad = new DAL.ClsK3_BadReason_View();
|
if (oBad.RefreshViewDownMenu(" and ( HName like '%" + sWhere + "%' or HNumber like '%" + sWhere + "%' )", x, y))
|
{
|
grdMain.Rows[i].Cells[HBadReasonCol].Value = oBad.oModel.HItemID.ToString();
|
}
|
else
|
{
|
grdMain.Rows[i].Cells[HBadReasonCol].Value = 0;
|
}
|
}
|
#endregion
|
}
|
}
|