protected static FR_L5AWSAR_GSCNfSC_1454_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5AWSAR_GSCNfSC_1454 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5AWSAR_GSCNfSC_1454_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_APOWebShop_ShoppingCart.Atomic.Retrieval.SQL.cls_Get_ShoppingCart_Notes_for_ShoppingCartID.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, "ShoppingCartID", Parameter.ShoppingCartID); List <L5AWSAR_GSCNfSC_1454> results = new List <L5AWSAR_GSCNfSC_1454>(); 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[] { "ShoppingCartID", "ShoppingCartNoteID", "CreatedBy_Account_RefID", "FirstName", "LastName", "Memo_Text", "UpdatedOn", "IsNoteForProcurementOrder" }); while (reader.Read()) { L5AWSAR_GSCNfSC_1454 resultItem = new L5AWSAR_GSCNfSC_1454(); //0:Parameter ShoppingCartID of type Guid resultItem.ShoppingCartID = reader.GetGuid(0); //1:Parameter ShoppingCartNoteID of type Guid resultItem.ShoppingCartNoteID = reader.GetGuid(1); //2:Parameter CreatedBy_Account_RefID of type Guid resultItem.CreatedBy_Account_RefID = reader.GetGuid(2); //3:Parameter FirstName of type String resultItem.FirstName = reader.GetString(3); //4:Parameter LastName of type String resultItem.LastName = reader.GetString(4); //5:Parameter Memo_Text of type String resultItem.Memo_Text = reader.GetString(5); //6:Parameter UpdatedOn of type DateTime resultItem.UpdatedOn = reader.GetDate(6); //7:Parameter IsNoteForProcurementOrder of type Boolean resultItem.IsNoteForProcurementOrder = reader.GetBoolean(7); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_ShoppingCart_Notes_for_ShoppingCartID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5AWSAR_GSCNfSC_1454_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5AWSAR_GSCNfSC_1454 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5AWSAR_GSCNfSC_1454_Array functionReturn = new FR_L5AWSAR_GSCNfSC_1454_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_ShoppingCart_Notes_for_ShoppingCartID", ex); } return(functionReturn); }