///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L3PR_GAwSPfAL_1021_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L3PR_GAwSPfAL_1021 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L3PR_GAwSPfAL_1021_Array functionReturn = new FR_L3PR_GAwSPfAL_1021_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_Articles_with_StandardPrices_for_ArticleList", ex); } return(functionReturn); }
protected static FR_L3PR_GAwSPfAL_1021_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3PR_GAwSPfAL_1021 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L3PR_GAwSPfAL_1021_Array(); //Put your code here List <Guid> productList = new List <Guid>(); var paramArticles = new CL3_Articles.Atomic.Retrieval.P_L3AR_GAfAL_0942 { ProductID_List = Parameter.ProductListParameter.ProductID_List }; List <L3AR_GAfAL_0942> articles = cls_Get_Articles_for_ArticleList.Invoke(Connection, Transaction, paramArticles, securityTicket).Result.ToList(); foreach (var item in articles) { productList.Add(item.CMN_PRO_ProductID); } List <L3PR_GAwSPfAL_1021> results = new List <L3PR_GAwSPfAL_1021>(); if (productList.Count > 0) { var paramPrices = new CL3_Price.Complex.Retrieval.P_L3PR_GSPfPIL_1645 { ProductIDList = productList.ToArray() }; var prices = CL3_Price.Complex.Retrieval.cls_Get_StandardPrices_for_ProductIDList.Invoke(Connection, Transaction, paramPrices, securityTicket).Result.ToList(); foreach (var articl in articles) { var articlesWithPrices = new L3PR_GAwSPfAL_1021(); articlesWithPrices.Article = articl; articlesWithPrices.Prices = prices.Where(x => x.ProductID == articl.CMN_PRO_ProductID).Single(); results.Add(articlesWithPrices); } } returnValue.Result = results.ToArray(); return(returnValue); #endregion UserCode }