Files
T-DAS/Epost.DAL/Print_BoxDAL.cs

77 lines
2.8 KiB
C#
Raw Normal View History

2025-06-05 15:11:19 +08:00
using Epost.Common;
using Epost.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Epost.DAL
{
public class Print_BoxDAL
{
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
#region
public DataTable GetPrintList(string block)
{
try
{
string strwhere = string.Empty;
if (!string.IsNullOrEmpty(block))
{
strwhere = strwhere + " and block='" + block + "'";
}
string sql = string.Format("select id, orderid, city , fdate , boxcode, shopname, shopid, orderway, boxno,isnull(totalcount,0) as totalcount , warehouseid, state,block,printstate,senddate,loc from print_box where state=0 " + strwhere + " order by id");
return db.GetsqlForDT(sql);
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("Box获取打印列表异常" + ex.Message, LogHelper.Log_Type.ERROR);
return null;
}
}
#endregion
#region
public bool UpPrintList(string id)
{
try
{
string sql = string.Format("update print_box set state=1 where id='{0}'",
id);
long x = db.UpdateSql(sql);
if (x > 0)
return true;
return false;
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("Box修改打印状态异常" + ex.Message, LogHelper.Log_Type.ERROR);
return false;
}
}
#endregion
#region
public bool InsertPrint(JobModel model, int boxno, int totalcount)
{
try
{
string sql = string.Format("insert into print_box(orderid ,city,fdate,boxcode,shopname,shopid,orderway,boxno,warehouseid,state,block,senddate,totalcount,matchid,loc) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}') ",
model.OrderID, model.ProdArea,DateTime.Now.ToString(), model.BoxCode, model.Shopname, model.ShopID, model.Orderway, boxno, "", "0", "", "", totalcount, model.Matchid, "");
long x = db.UpdateSql(sql);
if (x > 0)
return true;
return false;
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("Box修改打印状态异常" + ex.Message, LogHelper.Log_Type.ERROR);
return false;
}
}
#endregion
}
}