1
duhe
3 天以前 d703d7cc2f3a86692b1db16793ff2ffc60a1a355
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
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
 
    }
}