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 GetPosList() { IList lst = new List(); 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)ModelConvertHelper.DataTableToModel(dt); } } } catch(Exception ex) { } return lst; } } }