using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using System.Web.Script.Serialization;
using Newtonsoft.Json.Linq;
using Model;
using DBUtility;
namespace DAL
{
public class POInStockBillServices
{
public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
///
/// 要货通知单
///
///
public DataSet GetPOInStockBill()
{
try
{
DataSet dataSet = oCn.RunProcReturn("select * from h_v_Cg_POInStockBillList ", "ClsCg_POInStockBill"); //where hmaterid=" + sqlWhere
return dataSet;
}
catch (Exception)
{
throw;
}
}
///
/// 采购订单列表
///
///
public DataSet GetPOOrderBill()
{
try
{
DataSet dataSet = oCn.RunProcReturn("select * from h_v_Cg_POOrderBillList ", "h_v_Cg_POOrderBillList"); //where hmaterid=" + sqlWhere
return dataSet;
}
catch (Exception)
{
throw;
}
}
///
/// 委外订单列表
///
///
public DataSet GetICSubContractBill()
{
try
{
DataSet dataSet = oCn.RunProcReturn("select * from h_v_Kf_EntrustInBillList ", "h_v_Kf_EntrustInBillList"); //where hmaterid=" + sqlWhere
return dataSet;
}
catch (Exception)
{
throw;
}
}
///
/// 条码档案列表
///
///
public DataSet GetBarCodeBill()
{
try
{
DataSet dataSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill ", "h_v_Gy_BarCodeBill"); //where hmaterid=" + sqlWhere
return dataSet;
}
catch (Exception)
{
throw;
}
}
public List GetLabelPrintDetail(long sqlWhere)
{
List POInStockBillList = new List();
try
{
SqlParameter[] param = new SqlParameter[]
{
//new SqlParameter("@sqlWhere", sqlWhere)
//new SqlParameter("@JDInterID",""),
//new SqlParameter("@JDEntryID","")
};
SqlDataReader reader = SQLHelpers.GetReaderByProcedure("ClsCg_POInStockBill", param);
while (reader.Read())
{
POInStockBillList.Add(new ClsCg_POInStockBill()
{
HInterID = DBUtility.ClsPub.isLong(reader["HInterID"]),
HEntryID = DBUtility.ClsPub.isLong(reader["HEntryID"]),
HDateForWeb = DBUtility.ClsPub.isStrNull(reader["HDateForWeb"]),
HAddress = DBUtility.ClsPub.isStrNull(reader["HAddress"]),// varchar(200) --交货地点
HSupID = DBUtility.ClsPub.isLong(reader["HSupID"]),// int --供应商 (Gy_Supplier)
HCurID = DBUtility.ClsPub.isLong(reader["HCurID"]),// int --币别 (Gy_Currency)
HWHID = DBUtility.ClsPub.isLong(reader["HWHID"]),// int --仓库
HExRate = DBUtility.ClsPub.isLong(reader["HExRate"]),// money --汇率 (选择完币别带出)
HEmpID = DBUtility.ClsPub.isLong(reader["HEmpID"]),// int --业务员 (Gy_Employee)
HMangerID = DBUtility.ClsPub.isLong(reader["HMangerID"]),// int --主管 (Gy_Employee)
HDeptID = DBUtility.ClsPub.isLong(reader["HDeptID"]),// int --部门 (Gy_Employee)
HExplanation = DBUtility.ClsPub.isStrNull(reader["HExplanation"]),// varchar(200) --摘要
HInnerBillNo = DBUtility.ClsPub.isStrNull(reader["HInnerBillNo"]),// varchar(50) --内部单据号
HMaterID = DBUtility.ClsPub.isLong(reader["HMaterID"]),// int --物料ID (Gy_Material)
HUnitID = DBUtility.ClsPub.isLong(reader["HUnitID"]),// int --计量单位 (Gy_Unit)
HQty = DBUtility.ClsPub.isLong(reader["HQty"]),// dec(18,8) --要货数量
HCheckQty = DBUtility.ClsPub.isLong(reader["HCheckQty"]), //检验数
HPassQty = DBUtility.ClsPub.isLong(reader["HPassQty"]), //合格数
HBadQty = DBUtility.ClsPub.isLong(reader["HBadQty"]), //不合格数
HPrice = DBUtility.ClsPub.isLong(reader["HPrice"]),// dec(18,8) --原币单价
HMoney = DBUtility.ClsPub.isLong(reader["HMoney"]),// dec(18,8) --原币金额
// HWHID// --收料仓库
HPOOrderInterID = DBUtility.ClsPub.isLong(reader["HPOOrderInterID"]),//
HPOOrderEntryID = DBUtility.ClsPub.isLong(reader["HPOOrderEntryID"]),//
HPOOrderBillNo = DBUtility.ClsPub.isStrNull(reader["HPOOrderBillNo"]),//
HDate = DBUtility.ClsPub.isDate(reader["HDate"]), //要货时间
HState = DBUtility.ClsPub.isLong(reader["HState"]),
HBackDate = DBUtility.ClsPub.isStrNull(reader["HBackDate"]),
HBacker = DBUtility.ClsPub.isStrNull(reader["HBacker"]),
HBillerID = DBUtility.ClsPub.isLong(reader["HBillerID"]),
HBillNo = DBUtility.ClsPub.isStrNull(reader["HBillNo"]),
HBillStatus = DBUtility.ClsPub.isInt(reader["HBillStatus"]),
HBillSubType = DBUtility.ClsPub.isStrNull(reader["HBillSubType"]),
HBillType = DBUtility.ClsPub.isStrNull(reader["HBillType"]),
HCheckDate = DBUtility.ClsPub.isStrNull(reader["HCheckDate"]),
HChecker = DBUtility.ClsPub.isStrNull(reader["HChecker"]),
HCheckFlowID = DBUtility.ClsPub.isLong(reader["HCheckFlowID"]),
HCheckItemNextID = DBUtility.ClsPub.isLong(reader["HCheckItemNextID"]),
HCheckItemNowID = DBUtility.ClsPub.isLong(reader["HCheckItemNowID"]),
HCloseDate = DBUtility.ClsPub.isStrNull(reader["HCloseDate"]),
// HCloseMan= DBUtility.ClsPub.isLong(reader["HEntryID"]),
HCloseType = DBUtility.ClsPub.isBool(reader["HCloseType"]),
//HDate= DBUtility.ClsPub.isLong(reader["HEntryID"]),
HDeleteDate = DBUtility.ClsPub.isStrNull(reader["HDeleteDate"]),
HDeleteMan = DBUtility.ClsPub.isStrNull(reader["HDeleteMan"]),
HEmpCode = DBUtility.ClsPub.isStrNull(reader["HEmpCode"]),
HMainSourceBillNo = DBUtility.ClsPub.isStrNull(reader["HMainSourceBillNo"]),
HMainSourceBillType = DBUtility.ClsPub.isStrNull(reader["HMainSourceBillType"]),
HMainSourceEntryID = DBUtility.ClsPub.isLong(reader["HMainSourceEntryID"]),
HMainSourceInterID = DBUtility.ClsPub.isLong(reader["HMainSourceInterID"]),
HMakeDate = DBUtility.ClsPub.isStrNull(reader["HMakeDate"]),
HMaker = DBUtility.ClsPub.isStrNull(reader["HMaker"]),
HPeriod = DBUtility.ClsPub.isLong(reader["HPeriod"]),
HRemark = DBUtility.ClsPub.isStrNull(reader["HRemark"]),
HUpDateDate = DBUtility.ClsPub.isStrNull(reader["HUpDateDate"]),
HUpDater = DBUtility.ClsPub.isStrNull(reader["HUpDater"]),
HYear = DBUtility.ClsPub.isLong(reader["HYear"]),
// HCloseMan= DBUtility.ClsPub.isLong(reader["HEntryID"]),
// HCloseType= DBUtility.ClsPub.isLong(reader["HEntryID"]),
HEntryCloseDate = DBUtility.ClsPub.isDate(reader["HEntryCloseDate"]),
HRelationMoney = DBUtility.ClsPub.isLong(reader["HRelationMoney"]),
HRelationQty = DBUtility.ClsPub.isLong(reader["HRelationQty"]),
// HRemark= DBUtility.ClsPub.isStrNull(reader["HEntryID"]),
HSourceBillNo = DBUtility.ClsPub.isStrNull(reader["HSourceBillNo"]),
HSourceBillType = DBUtility.ClsPub.isStrNull(reader["HSourceBillType"]),
HSourceEntryID = DBUtility.ClsPub.isLong(reader["HSourceEntryID"]),
HSourceInterID = DBUtility.ClsPub.isLong(reader["HSourceInterID"]),
});
}
reader.Close();
return POInStockBillList;
}
catch (Exception ex)
{
throw ex;
}
}
}
}