bklLiudl
2024-07-23 675b8bcc4a3630d95e3d0b97d933e63442075ecb
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 BLL.IDAL;
using Common;
using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace BLL.DAL
{
    public class DALBarCode:IDALBarCode
    {
        public int GetStartNo()
        {
            int no = 0;
            try
            {
                StringBuilder strSQL = new StringBuilder();
                strSQL.Append("select * from Pub where Name = 'PalletNo'");
 
                DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(strSQL);
 
                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        no = int.Parse(dt.Rows[0]["Value"].ToString());
                    }
                }
            }
            catch(Exception ex)
            {
                return -1;
            }
            return no;
        }
 
        public int UpdateStartNo(int startNo)
        {
            int r = 0;
            try
            {
                StringBuilder strSQL = new StringBuilder();
                strSQL.Append("update Pub set Value = '");
                strSQL.Append(startNo.ToString());
                strSQL.Append("' Where Name = 'PalletNo'");
 
                r = DataFactory.SqlDataBase().ExecuteBySql(strSQL);
            }
            catch(Exception ex)
            {
                r = -1;
            }
            return r;
        }
 
        public IList<DepotsLocation> GetPosList()
        {
            IList<DepotsLocation> lst = new List<DepotsLocation>();
            lst.Clear();
            try
            {
                StringBuilder strSQL = new StringBuilder();
 
                strSQL.Append("select * from DepotsLocation order by LRow, LColumn, LLayer");
 
                DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(strSQL);
                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        lst = (IList<DepotsLocation>)ModelConvertHelper<DepotsLocation>.DataTableToModel(dt);
                    }
                }
            }
            catch(Exception ex)
            {
 
            }
            return lst;
        }
    }
}