This commit is contained in:
@ -127,9 +127,11 @@
|
||||
<Compile Include="Enum\SqlLogType.cs" />
|
||||
<Compile Include="ErrorLogDAL.cs" />
|
||||
<Compile Include="HistoryDataDAL.cs" />
|
||||
<Compile Include="InboundOrdersDAL.cs" />
|
||||
<Compile Include="MenuInfoDAL.cs" />
|
||||
<Compile Include="OrcaleDB.cs" />
|
||||
<Compile Include="OrdersDAL.cs" />
|
||||
<Compile Include="PalletinfoDAL.cs" />
|
||||
<Compile Include="PressureTestDAL.cs" />
|
||||
<Compile Include="Properties\Class1.cs" />
|
||||
<Compile Include="ControlDAL.cs" />
|
||||
@ -140,6 +142,7 @@
|
||||
<Compile Include="RoleInfoDAL.cs" />
|
||||
<Compile Include="SkuInfoDAL.cs" />
|
||||
<Compile Include="StoreDAL.cs" />
|
||||
<Compile Include="Sys_operate_logDAL.cs" />
|
||||
<Compile Include="UserDAL.cs" />
|
||||
<Compile Include="WmsDAL.cs" />
|
||||
<Compile Include="WmsDB.cs" />
|
||||
|
83
Epost.DAL/InboundOrdersDAL.cs
Normal file
83
Epost.DAL/InboundOrdersDAL.cs
Normal file
@ -0,0 +1,83 @@
|
||||
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 InboundOrdersDAL
|
||||
{
|
||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||
#region 分页获取订单表列表
|
||||
|
||||
public List<InboundOrdersModel> GetOrdersListByPage(string strWhere, string orderby, int startIndex, int endIndex, out int recordCount)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("SELECT * FROM ( ");
|
||||
strSql.Append(" SELECT ROW_NUMBER() OVER (");
|
||||
if (!string.IsNullOrEmpty(orderby.Trim()))
|
||||
{
|
||||
strSql.Append("order by T." + orderby);
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql.Append("order by id desc");
|
||||
}
|
||||
strSql.Append(")AS Row, T.* from inboundorders T WITH(NOLOCK) ");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
{
|
||||
strSql.Append(" WHERE 1=1 " + strWhere);
|
||||
}
|
||||
strSql.Append(" ) TT");
|
||||
strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
|
||||
List<InboundOrdersModel> list = ModelConvertHelper<InboundOrdersModel>.ConvertToList(db.GetsqlForDT(strSql.ToString()));
|
||||
|
||||
strSql.Remove(0, strSql.Length);
|
||||
strSql.Append("SELECT COUNT(*) FROM inboundorders AS T ");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
{
|
||||
strSql.AppendFormat(" WHERE 1=1 {0}", strWhere);
|
||||
}
|
||||
|
||||
object obj = db.GetsqlForDT(strSql.ToString()).Rows[0][0];
|
||||
if (obj != null)
|
||||
recordCount = Convert.ToInt32(obj);
|
||||
else
|
||||
recordCount = 0;
|
||||
|
||||
return list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLog(GetType(), ex.Message);
|
||||
recordCount = 0;
|
||||
return new List<InboundOrdersModel>();
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
#region 查询订单是否已存在
|
||||
public DataTable GetOrdersList(string wmsDocNo)
|
||||
{
|
||||
string sql = string.Format("select top 1 * from InboundOrders where wmsDocNo = '{0}'",
|
||||
wmsDocNo);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 添加订单
|
||||
public bool InsertOrders(DataTable dt, Dictionary<string, string> diclist)
|
||||
{
|
||||
return db.UpdateData(dt, "InboundOrders", diclist);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
76
Epost.DAL/PalletinfoDAL.cs
Normal file
76
Epost.DAL/PalletinfoDAL.cs
Normal file
@ -0,0 +1,76 @@
|
||||
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 PalletinfoDAL
|
||||
{
|
||||
|
||||
|
||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||
#region 分页获取订单表列表
|
||||
|
||||
public List<PalletinfoModel> GetPalletListByPage(string strWhere, string orderby, int startIndex, int endIndex, out int recordCount)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("SELECT * FROM ( ");
|
||||
strSql.Append(" SELECT ROW_NUMBER() OVER (");
|
||||
if (!string.IsNullOrEmpty(orderby.Trim()))
|
||||
{
|
||||
strSql.Append("order by T." + orderby);
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql.Append("order by id desc");
|
||||
}
|
||||
strSql.Append(")AS Row, T.* from Palletinfo T WITH(NOLOCK) ");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
{
|
||||
strSql.Append(" WHERE 1=1 " + strWhere);
|
||||
}
|
||||
strSql.Append(" ) TT");
|
||||
strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
|
||||
List<PalletinfoModel> list = ModelConvertHelper<PalletinfoModel>.ConvertToList(db.GetsqlForDT(strSql.ToString()));
|
||||
|
||||
strSql.Remove(0, strSql.Length);
|
||||
strSql.Append("SELECT COUNT(*) FROM Palletinfo AS T ");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
{
|
||||
strSql.AppendFormat(" WHERE 1=1 {0}", strWhere);
|
||||
}
|
||||
|
||||
object obj = db.GetsqlForDT(strSql.ToString()).Rows[0][0];
|
||||
if (obj != null)
|
||||
recordCount = Convert.ToInt32(obj);
|
||||
else
|
||||
recordCount = 0;
|
||||
|
||||
return list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLog(GetType(), ex.Message);
|
||||
recordCount = 0;
|
||||
return new List<PalletinfoModel>();
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 添加订单
|
||||
public bool InsertPallet(DataTable dt, Dictionary<string, string> diclist)
|
||||
{
|
||||
return db.UpdateData(dt, "Palletinfo", diclist);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
104
Epost.DAL/Sys_operate_logDAL.cs
Normal file
104
Epost.DAL/Sys_operate_logDAL.cs
Normal file
@ -0,0 +1,104 @@
|
||||
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 Sys_operate_logDAL
|
||||
{
|
||||
|
||||
|
||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||
#region 分页获取日志列表
|
||||
|
||||
public List<Sys_operate_logModel> GetLogListByPage(string strWhere, string orderby, int startIndex, int endIndex, out int recordCount)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("SELECT * FROM ( ");
|
||||
strSql.Append(" SELECT ROW_NUMBER() OVER (");
|
||||
if (!string.IsNullOrEmpty(orderby.Trim()))
|
||||
{
|
||||
strSql.Append("order by T." + orderby);
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql.Append("order by id desc");
|
||||
}
|
||||
strSql.Append(")AS Row, T.* from Sys_operate_log T WITH(NOLOCK) ");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
{
|
||||
strSql.Append(" WHERE 1=1 " + strWhere);
|
||||
}
|
||||
strSql.Append(" ) TT");
|
||||
strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
|
||||
List<Sys_operate_logModel> list = ModelConvertHelper<Sys_operate_logModel>.ConvertToList(db.GetsqlForDT(strSql.ToString()));
|
||||
|
||||
strSql.Remove(0, strSql.Length);
|
||||
strSql.Append("SELECT COUNT(*) FROM Sys_operate_log AS T ");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
{
|
||||
strSql.AppendFormat(" WHERE 1=1 {0}", strWhere);
|
||||
}
|
||||
|
||||
object obj = db.GetsqlForDT(strSql.ToString()).Rows[0][0];
|
||||
if (obj != null)
|
||||
recordCount = Convert.ToInt32(obj);
|
||||
else
|
||||
recordCount = 0;
|
||||
|
||||
return list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLog(GetType(), ex.Message);
|
||||
recordCount = 0;
|
||||
return new List<Sys_operate_logModel>();
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取日志明细
|
||||
|
||||
public List<Sys_operate_logModel> GetLogDetail(int mid)
|
||||
{
|
||||
string sql = string.Format("select * from Sys_operate_log where ID='" + mid + "'");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return ModelConvertHelper<Sys_operate_logModel>.ConvertToList(dt);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 添加日志
|
||||
public bool InsertLogDetail(Sys_operate_logModel model)
|
||||
{
|
||||
string sql = string.Format("insert into Sys_operate_log([title],[method],[operate_url],[operate_param],[json_result],[status],[error_msg],[addtime]) " +
|
||||
"values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}' )",
|
||||
model.title, model.method, model.operate_url, model.operate_param, model.json_result, model.status, model.error_msg, model.addtime);
|
||||
long x = db.UpdateSql(sql);
|
||||
|
||||
if (x > 0)
|
||||
{
|
||||
return true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("添加日志失败" + sql);
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user