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 BoxPickDAL { DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance(); #region 添加箱号 public bool InsertBoxPick(BoxPickModel model) { try { string sql = string.Format("insert into boxpick(matchid,shopid,orderway,wmsboxcode,state,orderid,block,weight,sumquantity,location,prino) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}')", model.Matchid, model.Shopid, model.Orderway, model.Wmsboxcode, model.State, model.Orderid, model.Block, model.Weight, model.Sumquantity, model.Location, model.Prino); int x = db.InsertSql(sql); if (x > 0) return true; return false; } catch (Exception ex) { LogHelper.WriteLogInfo("添加箱号异常:" + ex.Message); return false; } } #endregion #region 修改箱号状态 public bool UpdateBoxPick(string shopid) { try { string sql = string.Format("update boxpick set state=2 where shopid='{0}' ", shopid ); long x = db.UpdateSql(sql); if (x > 0) return true; return false; } catch (Exception ex) { LogHelper.WriteLogInfo("修改箱号状态异常:" + ex.Message); return false; } } #endregion #region 删除箱号 public bool DeleteBoxPick(string shopid) { try { string sql = string.Format("delete from boxpick where shopid='{0}' ", shopid); long x = db.DeleteSql(sql); if (x > 0) return true; return false; } catch (Exception ex) { LogHelper.WriteLogInfo("删除箱号异常:" + ex.Message); return false; } } #endregion #region 删除箱号 public bool DeleteBox(string shopid,string boxcode ) { try { string sql = string.Format("delete from boxpick where shopid='{0}' and wmsboxcode='{1}' ", shopid, boxcode); long x = db.DeleteSql(sql); if (x > 0) return true; return false; } catch (Exception ex) { LogHelper.WriteLogInfo("删除箱号异常:" + ex.Message); return false; } } #endregion #region 查询箱号列表 public DataTable GetBoxPickList() { try { string sql = string.Format("select * from boxpick"); DataTable dt = db.GetsqlForDT(sql); return dt; } catch (Exception ex) { LogHelper.WriteLogInfo("查询箱号列表异常:" + ex.Message); return null; } } #endregion } }