using System; 
 | 
using System.Collections.Generic; 
 | 
using System.Text; 
 | 
using System.Windows.Forms; 
 | 
  
 | 
namespace BLL 
 | 
{ 
 | 
    /// <summary> 
 | 
    /// ¸ù¾ÝIDÏÔʾÄÚÈÝ 
 | 
    /// </summary> 
 | 
    public class ClsBaseShow 
 | 
    { 
 | 
  
 | 
        //ÏÔʾµ½Îı¾ 
 | 
        #region 
 | 
  
 | 
  
 | 
        public static void ShowTextByAreaSet(TextBox txt,Model.ClsGy_AreaSet_Model omodel,string sType) 
 | 
        { 
 | 
            DAL.ClsGy_AreaSet_View oAreaSet = new DAL.ClsGy_AreaSet_View(); 
 | 
            if (sType.ToUpper() == "ID") 
 | 
            { 
 | 
                if (oAreaSet.GetInfoByID(omodel.HItemID)) 
 | 
                { 
 | 
                    txt.Text = oAreaSet.omodel.HName; 
 | 
                    txt.Tag = oAreaSet.omodel.HItemID.ToString(); 
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    txt.Text = ""; 
 | 
                } 
 | 
            } 
 | 
            if (sType.ToUpper() == "NAME") 
 | 
            { 
 | 
                if (oAreaSet.GetInfoByName(omodel.HName)) 
 | 
                { 
 | 
                    txt.Text = oAreaSet.omodel.HName; 
 | 
                    txt.Tag = oAreaSet.omodel.HItemID.ToString(); 
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    txt.Text = ""; 
 | 
                } 
 | 
            } 
 | 
            if (sType.ToUpper() == "NUMBER") 
 | 
            { 
 | 
                if (oAreaSet.GetInfoByNumber(omodel.HNumber)) 
 | 
                { 
 | 
                    txt.Text = oAreaSet.omodel.HName; 
 | 
                    txt.Tag = oAreaSet.omodel.HItemID.ToString(); 
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    txt.Text = ""; 
 | 
                } 
 | 
            } 
 | 
        } 
 | 
  
 | 
  
 | 
        #endregion 
 | 
        //ÏÔʾµ½Íø¸ñ 
 | 
        #region 
 | 
  
 | 
        public static void ShowGridByAreaSet(DataGridView grdMain, int i, int HIDCol, int HNumberCol, int HNameCol, Model.ClsGy_AreaSet_Model omodel, string sType) 
 | 
        { 
 | 
            DAL.ClsGy_AreaSet_View oAreaSet = new DAL.ClsGy_AreaSet_View(); 
 | 
            if (sType.ToUpper() == "ID") 
 | 
            { 
 | 
                if (oAreaSet.GetInfoByID(omodel.HItemID)) 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HIDCol].Value = oAreaSet.omodel.HItemID.ToString(); 
 | 
                    grdMain.Rows[i].Cells[HNumberCol].Value = oAreaSet.omodel.HNumber; 
 | 
                    grdMain.Rows[i].Cells[HNameCol].Value = oAreaSet.omodel.HName;  
 | 
                } 
 | 
                else 
 | 
                {  
 | 
                    grdMain.Rows[i].Cells[HIDCol].Value = "0"; 
 | 
                    grdMain.Rows[i].Cells[HNumberCol].Value = ""; 
 | 
                    grdMain.Rows[i].Cells[HNameCol].Value = "";  
 | 
                } 
 | 
            } 
 | 
            if (sType.ToUpper() == "NAME") 
 | 
            { 
 | 
                if (oAreaSet.GetInfoByName(omodel.HName)) 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HIDCol].Value = oAreaSet.omodel.HItemID.ToString(); 
 | 
                    grdMain.Rows[i].Cells[HNumberCol].Value = oAreaSet.omodel.HNumber; 
 | 
                    grdMain.Rows[i].Cells[HNameCol].Value = oAreaSet.omodel.HName; 
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HIDCol].Value = "0"; 
 | 
                    grdMain.Rows[i].Cells[HNumberCol].Value = ""; 
 | 
                    grdMain.Rows[i].Cells[HNameCol].Value = ""; 
 | 
                } 
 | 
            } 
 | 
            if (sType.ToUpper() == "NUMBER") 
 | 
            { 
 | 
                if (oAreaSet.GetInfoByNumber(omodel.HNumber)) 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HIDCol].Value = oAreaSet.omodel.HItemID.ToString(); 
 | 
                    grdMain.Rows[i].Cells[HNumberCol].Value = oAreaSet.omodel.HNumber; 
 | 
                    grdMain.Rows[i].Cells[HNameCol].Value = oAreaSet.omodel.HName; 
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HIDCol].Value = "0"; 
 | 
                    grdMain.Rows[i].Cells[HNumberCol].Value = ""; 
 | 
                    grdMain.Rows[i].Cells[HNameCol].Value = ""; 
 | 
                } 
 | 
            } 
 | 
        } 
 | 
        #endregion 
 | 
  
 | 
    } 
 | 
} 
 |