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/OA/DAL/FeeInput/FeeInputDAL.cs

87 lines
3.3 KiB
C#

3 years ago
using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using DSWeb.Areas.OA.Models.FeeInput;
using Microsoft.Practices.EnterpriseLibrary.Data;
using DSWeb.Areas.CommMng.Models;
namespace DSWeb.Areas.OA.DAL.FeeInput
{
public partial class FeeInputDAL
{
static public List<VWSettlement> GetVWSettlement(string strCondition, string sort)
{ //合同信息/商品信息
var strSql = new StringBuilder();
strSql.Append(" select v.corpid corpid,v.OPLB ");
strSql.Append(" ,v.BSNO,v.OPLBNAME,v.CUSTOMERNAME,v.CUSTNO,v.ORDERNO,v.MBLNO,v.VESSEL,v.VOYNO,v.INPUTBY,v.OP,v.CUSTOMNO ");
strSql.Append(" ,dbo.trimdate(V.etd) etd ,dbo.trimdate(V.eta) eta ,(case v.OPLBNAME when '进口贸易' then dbo.F_ImportTrade_SaleInfo_Main(v.bsno) else '' end) SALEINFO ");
strSql.Append(" from v_op_bs v ");
//strSql.Append(" left join op_seae e on e.bsno=v.bsno ");
//strSql.Append(" left join op_seai i on i.bsno=v.bsno ");
if (!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" where " + strCondition);
}
var sortstring = DatasetSort.Getsortstring(sort);
if (!string.IsNullOrEmpty(sortstring))
{
strSql.Append(" order by " + sortstring);
}
return SetAuditData(strSql);
}
#region 合同列表
private static List<VWSettlement> SetAuditData(StringBuilder strSql)
{
var headList = new List<VWSettlement>();
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
VWSettlement data = new VWSettlement();
#region Set DB data to Object
data.BSNO = Convert.ToString(reader["BSNO"]);
data.CORPID = Convert.ToString(reader["CORPID"]);
data.OPLB = Convert.ToString(reader["OPLB"]);
data.OPLBNAME = Convert.ToString(reader["OPLBNAME"]);
data.CUSTOMERNAME = Convert.ToString(reader["CUSTOMERNAME"]);
data.CUSTNO = Convert.ToString(reader["CUSTNO"]);
data.ORDERNO = Convert.ToString(reader["ORDERNO"]);
data.MBLNO = Convert.ToString(reader["MBLNO"]);
data.VESSEL = Convert.ToString(reader["VESSEL"]);
data.VOYNO = Convert.ToString(reader["VOYNO"]);
data.INPUTBY = Convert.ToString(reader["INPUTBY"]);
data.ETD = Convert.ToString(reader["ETD"]);
data.ETA = Convert.ToString(reader["ETA"]);
data.SALEINFO = Convert.ToString(reader["SALEINFO"]);
data.OP = Convert.ToString(reader["OP"]);
data.CUSTOMNO = Convert.ToString(reader["CUSTOMNO"]);
#endregion
headList.Add(data);
}
reader.Close();
}
return headList;
}
#endregion
#region 参照部分
#endregion
}
}