Example #1
0
        protected static FR_L5SC_GAwASfAL_0909_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5SC_GAwASfAL_0909 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5SC_GAwASfAL_0909_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_APOWebShop_ShoppingCart.Atomic.Retrieval.SQL.cls_Get_Articles_with_ActiveSupstances_for_ArticleList.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;

            command.CommandText = System.Text.RegularExpressions.Regex.Replace(command.CommandText, "=[ \t]*@ProductID_List", " IN $$ProductID_List$$");
            CSV2Core_MySQL.Support.DBSQLSupport.AppendINStatement(command, "$ProductID_List$", Parameter.ProductID_List);
            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ProducingBusinessParticipant", Parameter.ProducingBusinessParticipant);

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ProductGroupID", Parameter.ProductGroupID);



            List <L5SC_GAwASfAL_0909_raw> results = new List <L5SC_GAwASfAL_0909_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[] { "Product_Name_DictID", "Product_Number", "CMN_PRO_ProductID", "PackageInfo_RefID", "Product_Description_DictID", "ProductGroup", "ProductType_Name_DictID", "Abbreviation_DictID", "Label_DictID", "IsPlaceholderArticle", "ProductITL", "UnitAmount", "UnitAmount_DisplayLabel", "UnitIsoCode", "DossageFormName", "ProducerName", "ProducerId", "IsStorage_BatchNumberMandatory", "IsStorage_ExpiryDateMandatory", "TaxRate", "TaxName_DictID", "EconomicRegion_RefID", "ACC_TAX_TaxeID", "HEC_PRO_ComponentID", "Component_Name_DictID", "Component_SimpleName", "HEC_PRO_Component_SubstanceIngredientID", "HEC_SUB_SubstanceID", "IsActiveComponent", "SubstanceName" });
                while (reader.Read())
                {
                    L5SC_GAwASfAL_0909_raw resultItem = new L5SC_GAwASfAL_0909_raw();
                    //0:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(0);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //1:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(1);
                    //2:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(2);
                    //3:Parameter PackageInfo_RefID of type Guid
                    resultItem.PackageInfo_RefID = reader.GetGuid(3);
                    //4:Parameter Product_Description of type Dict
                    resultItem.Product_Description             = reader.GetDictionary(4);
                    resultItem.Product_Description.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Description);
                    //5:Parameter ProductGroup of type String
                    resultItem.ProductGroup = reader.GetString(5);
                    //6:Parameter ProductType_Name of type Dict
                    resultItem.ProductType_Name             = reader.GetDictionary(6);
                    resultItem.ProductType_Name.SourceTable = "cmn_pro_product_types";
                    loader.Append(resultItem.ProductType_Name);
                    //7:Parameter Abbreviation of type Dict
                    resultItem.Abbreviation             = reader.GetDictionary(7);
                    resultItem.Abbreviation.SourceTable = "cmn_units";
                    loader.Append(resultItem.Abbreviation);
                    //8:Parameter Label of type Dict
                    resultItem.Label             = reader.GetDictionary(8);
                    resultItem.Label.SourceTable = "cmn_units";
                    loader.Append(resultItem.Label);
                    //9:Parameter IsPlaceholderArticle of type bool
                    resultItem.IsPlaceholderArticle = reader.GetBoolean(9);
                    //10:Parameter ProductITL of type String
                    resultItem.ProductITL = reader.GetString(10);
                    //11:Parameter UnitAmount of type String
                    resultItem.UnitAmount = reader.GetString(11);
                    //12:Parameter UnitAmount_DisplayLabel of type String
                    resultItem.UnitAmount_DisplayLabel = reader.GetString(12);
                    //13:Parameter UnitIsoCode of type String
                    resultItem.UnitIsoCode = reader.GetString(13);
                    //14:Parameter DossageFormName of type String
                    resultItem.DossageFormName = reader.GetString(14);
                    //15:Parameter ProducerName of type String
                    resultItem.ProducerName = reader.GetString(15);
                    //16:Parameter ProducerId of type String
                    resultItem.ProducerId = reader.GetString(16);
                    //17:Parameter IsStorage_BatchNumberMandatory of type bool
                    resultItem.IsStorage_BatchNumberMandatory = reader.GetBoolean(17);
                    //18:Parameter IsStorage_ExpiryDateMandatory of type bool
                    resultItem.IsStorage_ExpiryDateMandatory = reader.GetBoolean(18);
                    //19:Parameter TaxRate of type double
                    resultItem.TaxRate = reader.GetDouble(19);
                    //20:Parameter TaxName of type Dict
                    resultItem.TaxName             = reader.GetDictionary(20);
                    resultItem.TaxName.SourceTable = "acc_tax_taxes";
                    loader.Append(resultItem.TaxName);
                    //21:Parameter EconomicRegion_RefID of type Guid
                    resultItem.EconomicRegion_RefID = reader.GetGuid(21);
                    //22:Parameter ACC_TAX_TaxeID of type Guid
                    resultItem.ACC_TAX_TaxeID = reader.GetGuid(22);
                    //23:Parameter HEC_PRO_ComponentID of type Guid
                    resultItem.HEC_PRO_ComponentID = reader.GetGuid(23);
                    //24:Parameter Component_Name of type Dict
                    resultItem.Component_Name             = reader.GetDictionary(24);
                    resultItem.Component_Name.SourceTable = "hec_pro_components";
                    loader.Append(resultItem.Component_Name);
                    //25:Parameter Component_SimpleName of type String
                    resultItem.Component_SimpleName = reader.GetString(25);
                    //26:Parameter HEC_PRO_Component_SubstanceIngredientID of type Guid
                    resultItem.HEC_PRO_Component_SubstanceIngredientID = reader.GetGuid(26);
                    //27:Parameter HEC_SUB_SubstanceID of type Guid
                    resultItem.HEC_SUB_SubstanceID = reader.GetGuid(27);
                    //28:Parameter IsActiveComponent of type bool
                    resultItem.IsActiveComponent = reader.GetBoolean(28);
                    //29:Parameter SubstanceName of type String
                    resultItem.SubstanceName = reader.GetString(29);

                    results.Add(resultItem);
                }
            }
            catch (Exception ex)
            {
                reader.Close();
                throw new Exception("Exception occured durng data retrieval in method cls_Get_Articles_with_ActiveSupstances_for_ArticleList", ex);
            }
            reader.Close();
            //Load all the dictionaries from the datatables
            loader.Load();

            returnStatus.Result = L5SC_GAwASfAL_0909_raw.Convert(results).ToArray();
            return(returnStatus);
        }
Example #2
0
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_L5SC_GAwASfAL_0909_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L5SC_GAwASfAL_0909 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
Example #3
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L5SC_GAwASfAL_0909_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5SC_GAwASfAL_0909 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L5SC_GAwASfAL_0909_Array functionReturn = new FR_L5SC_GAwASfAL_0909_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_ActiveSupstances_for_ArticleList", ex);
            }
            return(functionReturn);
        }
Example #4
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L5SC_GAwASfAL_0909_Array Invoke(string ConnectionString, P_L5SC_GAwASfAL_0909 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }