You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/Import/DAL/audit/auditDAL.cs

117 lines
4.5 KiB
C#

2 years ago
using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using DSWeb.Areas.Import.Models.audit;
using DSWeb.Areas.Import.Models.ImportTrade;
using Microsoft.Practices.EnterpriseLibrary.Data;
using DSWeb.Areas.CommMng.Models;
using System.Web;
using System.Data.Common;
using DSWeb.TruckMng.Comm.Cookie;
using WebSqlHelper;
using HcUtility.Core;
using System.Collections;
using System.Xml;
using DSWeb.Areas.CommMng.DAL;
using HcUtility.Comm;
using InvokeWebService;
using System.IO;
using System.Xml.Serialization;
using System.Linq;
using DSWeb.TruckMng.Helper.Repository;
using DSWeb.TruckMng.Helper;
using System.Data.SqlClient;
namespace DSWeb.Areas.Import.DAL.audit
{
public partial class auditDAL
{
#region 审单情况表
static public List<AuditStatusmb> GetAuditStatusList ( string condition)
{ //合同信息/商品信息
var strSql = new StringBuilder();
strSql.Append(" select GID,BSNO,RECEIPTNAME,dbo.trimtime(MODIFIEDTIME) MODIFIEDTIME ");
strSql.Append(" ,MODIFIEDUSER,AUDITSTATUS,CZSTATUS,t.DispIndex from Import_AuditStatus ");
strSql.Append(" left join tsysenumvalue t on t.EnumValueName=receiptname and t.EnumTypeID=33 ");
if (!string.IsNullOrEmpty(condition))
{
strSql.Append(" where " + condition);
}
strSql.Append(" order by t.DispIndex ");
return SetAuditStatus(strSql);
}
private static List<AuditStatusmb> SetAuditStatus ( StringBuilder strSql )
{
var headList = new List<AuditStatusmb>();
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
AuditStatusmb data = new AuditStatusmb();
#region Set DB data to Object
data.GID = Convert.ToString(reader["GID"]);
data.BSNO = Convert.ToString(reader["BSNO"]);
data.RECEIPTNAME = Convert.ToString(reader["RECEIPTNAME"]);
data.MODIFIEDTIME = Convert.ToString(reader["MODIFIEDTIME"]);
data.MODIFIEDUSER = Convert.ToString(reader["MODIFIEDUSER"]);
data.AUDITSTATUS = Convert.ToString(reader["AUDITSTATUS"]);
data.CZSTATUS = Convert.ToString(reader["CZSTATUS"]);
#endregion
headList.Add(data);
}
reader.Close();
}
return headList;
}
#endregion
#region 审单情况明细表
static public List<AuditStatus_Bodymb> GetAuditStatusBodyList ( string condition )
{ //合同信息/商品信息
var strSql = new StringBuilder();
strSql.Append(" select GID,BSNO,LINKID,dbo.trimtime(MODIFIEDTIME) MODIFIEDTIME ");
strSql.Append(" ,MODIFIEDUSER,AUDITSTATUS,CZSTATUS from Import_AuditStatus_Body ");
if (!string.IsNullOrEmpty(condition))
{
strSql.Append(" where " + condition);
}
strSql.Append(" order by MODIFIEDTIME desc ");
return SetAuditStatusBody(strSql);
}
private static List<AuditStatus_Bodymb> SetAuditStatusBody ( StringBuilder strSql )
{
var headList = new List<AuditStatus_Bodymb>();
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
AuditStatus_Bodymb data = new AuditStatus_Bodymb();
#region Set DB data to Object
data.GID = Convert.ToString(reader["GID"]);
data.BSNO = Convert.ToString(reader["BSNO"]);
data.LINKID = Convert.ToString(reader["LINKID"]);
data.MODIFIEDTIME = Convert.ToString(reader["MODIFIEDTIME"]);
data.MODIFIEDUSER = Convert.ToString(reader["MODIFIEDUSER"]);
data.AUDITSTATUS = Convert.ToString(reader["AUDITSTATUS"]);
data.CZSTATUS = Convert.ToString(reader["CZSTATUS"]);
#endregion
headList.Add(data);
}
reader.Close();
}
return headList;
}
#endregion
}
}