Example #1
0
        protected static FR_L5AI_GSIbC_1341_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5AI_GSIbC_1341 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L5AI_GSIbC_1341_Array();

            var productIds = new List <Guid>();
            productIds.Add(Parameter.ProductID);
            //var param = new P_L3WH_GSPfT_1107
            //{
            //    ProductIDs = productIds.ToArray()
            //};
            //var p = cls_Get_StoragePlaces_for_TenantID.Invoke(Connection, Transaction, param, securityTicket).Result;
            var filterCriteria = new P_L3WH_GSPfFC_1504()
            {
                WarehouseGroupID    = null,
                WarehouseID         = null,
                AreaID              = null,
                RackID              = null,
                UseShelfIDList      = false,
                ShelfIDs            = new Guid[] { Guid.Empty },
                UseProductIDList    = productIds.Count > 0,
                ProductIDs          = productIds.ToArray(),
                BottomShelfQuantity = null,
                TopShelfQuantity    = null,
                UseProductTrackingInstanceIDList = false,
                ProductTrackingInstanceIDs       = new Guid[] { Guid.Empty },
                StartExpirationDate = null,
                EndExpirationDate   = null
            };
            var p = cls_Get_StoragePlaces_for_FilterCriteria.Invoke(
                Connection,
                Transaction,
                filterCriteria,
                securityTicket).Result;

            var list = new List <L5AI_GSIbC_1341>();

            var item = new L5AI_GSIbC_1341();

            item.CompanyID              = Guid.NewGuid();
            item.CompanyName            = "-";
            item.CurrentQuantityOnStock = 0;
            item.AMO = "-";

            list.Add(item);

            returnValue.Result = list.ToArray();
            return(returnValue);

            #endregion UserCode
        }
Example #2
0
 ///<summary>
 /// Ivokes the method with the given Connection, leaving it open if no exceptions occured
 ///<summary>
 public static FR_L5AI_GSIbC_1341_Array Invoke(DbConnection Connection, P_L5AI_GSIbC_1341 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, null, null, Parameter, securityTicket));
 }
Example #3
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L5AI_GSIbC_1341_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5AI_GSIbC_1341 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L5AI_GSIbC_1341_Array functionReturn = new FR_L5AI_GSIbC_1341_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_StockInfo_by_Companies", ex);
            }
            return(functionReturn);
        }