///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5DO_GaDOHfOT_1502_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5DO_GaDOHfOT_1502 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5DO_GaDOHfOT_1502_Array functionReturn = new FR_L5DO_GaDOHfOT_1502_Array(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, Parameter, securityTicket); #region Cleanup Connection/Transaction //Commit the transaction if (cleanupTransaction == true) { Transaction.Commit(); } //Close the connection if (cleanupConnection == true) { Connection.Close(); } #endregion } catch (Exception ex) { try { if (cleanupTransaction == true && Transaction != null) { Transaction.Rollback(); } } catch { } try { if (cleanupConnection == true && Connection != null) { Connection.Close(); } } catch { } throw new Exception("Exception occured in method cls_Get_all_DistributionOrder_Headers_for_OrderTracking", ex); } return(functionReturn); }
protected static FR_L5DO_GaDOHfOT_1502_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5DO_GaDOHfOT_1502 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5DO_GaDOHfOT_1502_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_Zugseil_DistributionOrder.Atomic.Retrieval.SQL.cls_Get_all_DistributionOrder_Headers_for_OrderTracking.sql"; command.CommandText = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(commandLocation)).ReadToEnd(); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ticket", securityTicket); command.CommandTimeout = QueryTimeout; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "OrderNumber", Parameter.OrderNumber); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "StartDate", Parameter.StartDate); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "EndDate", Parameter.EndDate); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "CostCenter", Parameter.CostCenter); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Office", Parameter.Office); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Warehouse", Parameter.Warehouse); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Employee", Parameter.Employee); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "LanguageID", Parameter.LanguageID); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "IsCanceled", Parameter.IsCanceled); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "IsPartiallyFullfilled", Parameter.IsPartiallyFullfilled); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "IsFullyFullfilled", Parameter.IsFullyFullfilled); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "IsNew", Parameter.IsNew); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "PageSize", Parameter.PageSize); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ActivePage", Parameter.ActivePage); List <L5DO_GaDOHfOT_1502> results = new List <L5DO_GaDOHfOT_1502>(); var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); try { reader.SetOrdinals(new string[] { "ORD_DIS_DistributionOrder_HeaderID", "DistributionOrderDate", "DistributionOrderNumber", "IsCanceled", "IsPartiallyFullfilled", "IsFullyFullfilled", "CostCenterName_DictID", "OfficeName_DictID", "EmployeeName", "WarehouseName" }); while (reader.Read()) { L5DO_GaDOHfOT_1502 resultItem = new L5DO_GaDOHfOT_1502(); //0:Parameter ORD_DIS_DistributionOrder_HeaderID of type Guid resultItem.ORD_DIS_DistributionOrder_HeaderID = reader.GetGuid(0); //1:Parameter DistributionOrderDate of type DateTime resultItem.DistributionOrderDate = reader.GetDate(1); //2:Parameter DistributionOrderNumber of type string resultItem.DistributionOrderNumber = reader.GetString(2); //3:Parameter IsCanceled of type bool resultItem.IsCanceled = reader.GetBoolean(3); //4:Parameter IsPartiallyFullfilled of type bool resultItem.IsPartiallyFullfilled = reader.GetBoolean(4); //5:Parameter IsFullyFullfilled of type bool resultItem.IsFullyFullfilled = reader.GetBoolean(5); //6:Parameter CostCenterName of type Dict resultItem.CostCenterName = reader.GetDictionary(6); resultItem.CostCenterName.SourceTable = "cmn_str_costcenters"; loader.Append(resultItem.CostCenterName); //7:Parameter OfficeName of type Dict resultItem.OfficeName = reader.GetDictionary(7); resultItem.OfficeName.SourceTable = "cmn_str_offices"; loader.Append(resultItem.OfficeName); //8:Parameter EmployeeName of type string resultItem.EmployeeName = reader.GetString(8); //9:Parameter WarehouseName of type string resultItem.WarehouseName = reader.GetString(9); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_all_DistributionOrder_Headers_for_OrderTracking", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }