///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5DO_GDOHDfOT_1654 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5DO_GDOHDfOT_1654 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5DO_GDOHDfOT_1654 functionReturn = new FR_L5DO_GDOHDfOT_1654(); 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_DistributionOrder_Header_Details_for_OrderTracking", ex); } return(functionReturn); }
protected static FR_L5DO_GDOHDfOT_1654 Execute(DbConnection Connection, DbTransaction Transaction, P_L5DO_GDOHDfOT_1654 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5DO_GDOHDfOT_1654(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_Zugseil_DistributionOrder.Atomic.Retrieval.SQL.cls_Get_DistributionOrder_Header_Details_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, "DistributionOrderHeaderID", Parameter.DistributionOrderHeaderID); List <L5DO_GDOHDfOT_1654_raw> results = new List <L5DO_GDOHDfOT_1654_raw>(); 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", "CreatedBy_BusinessParticipantID", "CreatedBy_BusinessParticipantDisplayName", "ORD_DIS_DistributionOrder_PositionID", "Quantity", "Position_OrdinalNumber", "CMN_PRO_ProductID", "Product_Name_DictID", "Product_Number", "CMN_PRO_Product_VariantID", "IsStandardProductVariant", "VariantName_DictID" }); while (reader.Read()) { L5DO_GDOHDfOT_1654_raw resultItem = new L5DO_GDOHDfOT_1654_raw(); //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); //10:Parameter CreatedBy_BusinessParticipantID of type Guid resultItem.CreatedBy_BusinessParticipantID = reader.GetGuid(10); //11:Parameter CreatedBy_BusinessParticipantDisplayName of type string resultItem.CreatedBy_BusinessParticipantDisplayName = reader.GetString(11); //12:Parameter ORD_DIS_DistributionOrder_PositionID of type Guid resultItem.ORD_DIS_DistributionOrder_PositionID = reader.GetGuid(12); //13:Parameter Quantity of type double resultItem.Quantity = reader.GetDouble(13); //14:Parameter Position_OrdinalNumber of type int resultItem.Position_OrdinalNumber = reader.GetInteger(14); //15:Parameter CMN_PRO_ProductID of type Guid resultItem.CMN_PRO_ProductID = reader.GetGuid(15); //16:Parameter Product_Name of type Dict resultItem.Product_Name = reader.GetDictionary(16); resultItem.Product_Name.SourceTable = "cmn_pro_products"; loader.Append(resultItem.Product_Name); //17:Parameter Product_Number of type string resultItem.Product_Number = reader.GetString(17); //18:Parameter CMN_PRO_Product_VariantID of type Guid resultItem.CMN_PRO_Product_VariantID = reader.GetGuid(18); //19:Parameter IsStandardProductVariant of type bool resultItem.IsStandardProductVariant = reader.GetBoolean(19); //20:Parameter VariantName of type Dict resultItem.VariantName = reader.GetDictionary(20); resultItem.VariantName.SourceTable = "cmn_pro_product_variants"; loader.Append(resultItem.VariantName); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_DistributionOrder_Header_Details_for_OrderTracking", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5DO_GDOHDfOT_1654_raw.Convert(results).FirstOrDefault(); return(returnStatus); }