chenhaozhe
3 天以前 ba60f925949d9f00ed7e386c07f3aafb729b589f
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
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
 
namespace BLL
{
    public class ClsIF_StockPlace_View
    {
        /// <summary>
        /// 根据过滤条件返回仓位列表
        /// </summary>
        /// <param name="sWhere">过滤条件</param>
        /// <param name="sErr">错误信息</param>
        /// <returns></returns>
        public DataSet GetList(string sWhere, ref string sErr)
        {
            try
            {
                DAL.ClsIF_StockPlace_View dal = new DAL.ClsIF_StockPlace_View();
                return dal.GetList(sWhere);
            }
            catch (Exception e)
            {
                sErr = sErr + "," + e.Message;
                return null;
            }
        }
 
        /// <summary>
        /// 根据内码返回仓位信息
        /// </summary>
        /// <param name="sWhere">内码</param>
        /// <param name="sErr">错误信息</param>
        /// <returns></returns>
        public Model.ClsGy_StockPlace_Model GetInfoByID(long sWhere, ref string sErr)
        {
            try
            {
                DAL.ClsIF_StockPlace_View dal = new DAL.ClsIF_StockPlace_View();
                if (dal.GetInfoByID(sWhere))
                {
                    return dal.omodel;
                }
                else
                {
                    return null;
                }
            }
            catch (Exception e)
            {
                sErr = sErr + "," + e.Message;
                return null;
            }
        }
 
        /// <summary>
        /// 根据内码返回仓位信息(并判断是否在对应的仓库里)
        /// </summary>
        /// <param name="HSPID">仓位内码</param>
        /// <param name="HWHID">仓库内码</param>
        /// <param name="sErr">错误信息</param>
        /// <returns></returns>
        public Model.ClsGy_StockPlace_Model GetInfoByID(long HSPID,long HWHID, ref string sErr)
        {
            try
            {
                DAL.ClsIF_StockPlace_View dal = new DAL.ClsIF_StockPlace_View();
                if (dal.GetInfoByID(HSPID, HWHID))
                {
                    return dal.omodel;
                }
                else
                {
                    return null;
                }
            }
            catch (Exception e)
            {
                sErr = sErr + "," + e.Message;
                return null;
            }
        }
 
 
        /// <summary>
        /// 根据内码返回仓位信息(并判断是否在对应的仓库里)
        /// </summary>
        /// <param name="HSPID">仓位内码</param>
        /// <param name="HWHID">仓库内码</param>
        /// <param name="sErr">错误信息</param>
        /// <returns></returns>
        public DataSet GetInfoByID(long HSPID, long HWHID, long HORGID)
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("Select * from h_v_IF_StockPlace Where HItemID=" + HSPID.ToString() + " and HWHID=" + HWHID.ToString(), "h_v_IF_StockPlace", ref DBUtility.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return null;
                else
                {
                    return DS;
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
 
 
    }
}