yangle
2023-06-25 6585cda35b87eb1a3a05a948faf7dc5d08ef8ff7
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
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using SQLHelper;
 
namespace BLL
{
    class ClsGy_OpenTmp_View:IDisposable
    {
        private string mvarReportTitle;
 
        public string MvarReportTitle
        {
            get { return mvarReportTitle; }
            set { mvarReportTitle = value; }
        }
        public string WherePart;
        public string ClsName;
        //
        ClsCN oCN = new ClsCN();
        public ClsGy_OpenTmp_Model oModel;
        public ClsGy_OpenTmp_View()
        {
            mvarReportTitle = "打印模板设置";
            ClsName = "打印模板";
        }
        //
        public void Dispose()
        {
            GC.SuppressFinalize(this);
        }
        //
         
        
        //返回项目信息
        public bool GetInfoByID(long sItemID)
        {
            DataSet DS ;
            try
            {
                DS = oCN.RunProcReturn("Select * from Gy_OpenTmp Where HItemID='" + sItemID + "'", "Gy_OpenTmp", ref DBUtility.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count  == 0)
                    return false;
                else
                {
                    oModel = new ClsGy_OpenTmp_Model();
                    oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]);
                    oModel.HNumber = DS.Tables[0].Rows[0]["HNumber"].ToString().Trim();
                    oModel.HName = DS.Tables[0].Rows[0]["HName"].ToString().Trim();
                    oModel.HModel = DS.Tables[0].Rows[0]["HModel"].ToString().Trim();
                    return true;
                }
            }
            catch (Exception e)
            {
                return false;
            }
        }
        //根据代码返回项目信息
        public bool GetInfoByNumber(string sNumber)
        {
            DataSet DS;
            try
            {
                DS = oCN.RunProcReturn("Select * from Gy_OpenTmp Where HNumber='" + sNumber + "'", "Gy_OpenTmp", ref DBUtility.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    oModel = new ClsGy_OpenTmp_Model();
                    oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]);
                    oModel.HNumber = DS.Tables[0].Rows[0]["HNumber"].ToString().Trim();
                    oModel.HName = DS.Tables[0].Rows[0]["HName"].ToString().Trim();
                    oModel.HModel = DS.Tables[0].Rows[0]["HModel"].ToString().Trim();
                    return true;
                }
            }
            catch (Exception e)
            {
                return false;
            }
        }
    }
}