Files
T-DAS/Epost.DAL/Print_BoxDAL.cs
2025-06-24 15:35:29 +08:00

77 lines
2.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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,matchid 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
}
}