/// <summary> /// 根据发票号查询单据信息 /// </summary> /// <param name="invoiceInputSysNos"></param> /// <returns></returns> public List <EIMSInvoiceInputExtendInfo> QueryEIMSInvoiceInputExtendByInvoiceInputSysNo(params int[] invoiceInputSysNos) { if (invoiceInputSysNos == null || invoiceInputSysNos.Length == 0) { return(new List <EIMSInvoiceInputExtendInfo>()); } CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("EIMS_Query_ExtendListByInvoiceInputSysNo"); string InvoiceInputSysNo = string.Empty; for (int i = 0; i < invoiceInputSysNos.Length; i++) { if (i > 0) { InvoiceInputSysNo += ","; } InvoiceInputSysNo += string.Format("{0}", invoiceInputSysNos[i]); } command.CommandText = command.CommandText.Replace("#InvoiceInputSysNo#", InvoiceInputSysNo); List <EIMSInvoiceInputExtendInfo> list = new List <EIMSInvoiceInputExtendInfo>(); using (IDataReader reader = command.ExecuteDataReader()) { EIMSInvoiceInputExtendInfo model = null; while (reader.Read()) { model = new EIMSInvoiceInputExtendInfo(); model.SysNo = Convert.ToInt32(reader["SysNo"]); model.InvoiceNumber = reader["InvoiceNumber"].ToString(); model.InvoiceInputSysNo = Convert.ToInt32(reader["InvoiceInputSysNo"]); list.Add(model); } } return(list); }
/// <summary> /// 根据发票号查询发票信息 /// </summary> /// <param name="invoiceInputSysNos"></param> /// <returns></returns> public List <EIMSInvoiceInfoEntity> QueryEIMSInvoiceInputByInvoiceInputSysNo(List <string> invoiceInputSysNos) { if (invoiceInputSysNos == null || invoiceInputSysNos.Count == 0) { return(new List <EIMSInvoiceInfoEntity>()); } CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("EIMS_Query_InvoiceListByInvoiceInputSysNo"); string InvoiceInputNo = string.Empty; for (int i = 0; i < invoiceInputSysNos.Count; i++) { if (i > 0) { InvoiceInputNo += ","; } InvoiceInputNo += string.Format("'{0}'", invoiceInputSysNos[0]); } command.CommandText = command.CommandText.Replace("#InvoiceInputNo#", InvoiceInputNo); List <EIMSInvoiceInfoEntity> list = new List <EIMSInvoiceInfoEntity>(); using (IDataReader reader = command.ExecuteDataReader()) { EIMSInvoiceInfoEntity model = null; while (reader.Read()) { model = new EIMSInvoiceInfoEntity(); model.SysNo = Convert.ToInt32(reader["SysNo"]); model.InvoiceInputNo = reader["InvoiceInputNo"].ToString(); list.Add(model); } } return(list); }
/// <summary> /// 获取指定商品列表的总库存 /// </summary> /// <param name="productIDList">商品编号列表</param> /// <returns>ProductInventoryEntityList</returns> public virtual List <ProductInventoryInfo> GetProductTotalInventoryInfoByProductList(List <int> productSysNoList) { CustomDataCommand cmd = DataCommandManager.CreateCustomDataCommandFromConfig("Inventory_GetProductTotalInventoryInfo"); using (var sqlBuilder = new DynamicQuerySqlBuilder(cmd, "a.ProductSysNo DESC")) { sqlBuilder.ConditionConstructor.AddInCondition(QueryConditionRelationType.AND, "a.ProductSysNo", DbType.Int32, productSysNoList); cmd.CommandText = sqlBuilder.BuildQuerySql(); using (IDataReader reader = cmd.ExecuteDataReader()) { return(DataMapper.GetEntityList <ProductInventoryInfo, List <ProductInventoryInfo> >(reader)); } } }