public List<GenericItem> GetItemList(Warehouse warehouse) { StringBuilder oSQL = new StringBuilder(); oSQL.Append("SELECT T0.ItemCode, T0.ItemName "); oSQL.Append("FROM OITM T0 "); oSQL.Append("INNER JOIN OITW T1 "); oSQL.Append("ON T0.ItemCode = T1.ItemCode "); oSQL.Append("AND T1.WhsCode = @warehouse"); DbCommand dbCommand = this.dataBase.GetSqlStringCommand(oSQL.ToString()); this.dataBase.AddInParameter(dbCommand, "warehouse", DbType.String, warehouse.WhsCode); List<GenericItem> items = new List<GenericItem>(); using (this.reader = this.dataBase.ExecuteReader(dbCommand)) { while (this.reader.Read()) { GenericItem item = new GenericItem(); item.ItemCode = this.reader.IsDBNull(0) ? "" : this.reader.GetValue(0).ToString(); item.ItemName = this.reader.IsDBNull(1) ? "" : this.reader.GetValue(1).ToString(); items.Add(item); } } return items; }
public List<GenericItem> GetItemList(Warehouse warehouse, AppConnData oAppConnData) { return bizInventory.GetItemList(warehouse, oAppConnData); }
public List<GenericItem> GetItemList(Warehouse warehouse, AppConnData oAppConnData) { try { if (!BizUtilities.ValidateServiceConnection(oAppConnData)) throw new BusinessException(15, "Nombre de Usuario o Contraseña incorrecta para el Servicio"); oAppConnData = BizUtilities.GetDataConnection(oAppConnData); InventoryAccess = new InventoryData(oAppConnData.adoConnString); return InventoryAccess.GetItemList(warehouse); } catch (DbException ex) { Exception outEx; if (ExceptionPolicy.HandleException(ex, "Politica_SQLServer", out outEx)) { outEx.Data.Add("1", "14"); outEx.Data.Add("2", "NA"); outEx.Data.Add("3", outEx.Message + " Descripción: " + ex.Message); throw outEx; } else { throw ex; } } catch (BusinessException ex) { BizUtilities.ProcessBusinessException(ex); } catch (Exception ex) { Exception outEx; if (ExceptionPolicy.HandleException(ex, "Politica_ExcepcionGenerica", out outEx)) { outEx.Data.Add("1", "3"); outEx.Data.Add("2", "NA"); outEx.Data.Add("3", outEx.Message); throw outEx; } else { throw ex; } } return null; }
public List<GenericItem> GetItemList(Warehouse warehouse, AppConnData oAppConnData) { try { facade = new BizFacade(BusinessClass.BizInventory); return facade.GetItemList(warehouse, oAppConnData); } catch (Exception ex) { DataAccessFault detalleError = new DataAccessFault(); foreach (string valores in ex.Data.Keys) { switch (valores) { case "1": detalleError.ErrorID = ex.Data[valores].ToString(); break; case "2": detalleError.ErrorSAP = ex.Data[valores].ToString(); break; case "3": detalleError.Description = ex.Data[valores].ToString(); break; default: detalleError.ErrorID = ex.Data[valores].ToString(); break; } } throw new FaultException<DataAccessFault>(detalleError, "Error al Procesar la solicitud"); } }