Exemple #1
0
        public void InventoryStatus(string ChannelId, string ChannelRef, string TransactionId, InventoryStatusDoc aInventoryStatusDoc)
        {
            EnterProc();

            InventoryStatusInsert aInventoryStatusHandler;

            try
            {
                MessageTransaction mt = BeginWebmethod(ChannelId, ChannelRef, TransactionId, "IS");

                try
                {
                    aInventoryStatusHandler = new InventoryStatusInsert(this);
                }
                catch (Exception e)
                {
                    Exception InternalError = new Exception("InternalError: Building insert handler", e);
                    throw (InternalError);
                }

                try
                {
                    if (aInventoryStatusDoc == null)
                    {
                        Exception InternalError = new Exception("DataError: Root object cannot be null");
                        throw (InternalError);
                    }
                    aInventoryStatusHandler.Process(ref mt, null, aInventoryStatusDoc);
                    GetDataBase().Commit();
                }
                catch (Exception e)
                {
                    try
                    {
                        GetDataBase().Rollback();
                    }
                    catch (Exception)
                    {}
                    Exception InternalError = new Exception("DataError: Error processing data", e);
                    throw (InternalError);
                }
            }

            finally
            {
                EndWebmethod();
            }

            ExitProc();

            return;
        }
Exemple #2
0
        public void ProductStockGroup(string ChannelId, string ChannelRef, string TransactionId, ProductStockGroupDoc aProductStockGroupDoc)
        {
            EnterProc();

            ProductStockGroupInsert aProductStockGroupHandler;

            try
            {
                MessageTransaction mt = BeginWebmethod(ChannelId, ChannelRef, TransactionId, "PSG");

                try
                {
                    aProductStockGroupHandler = new ProductStockGroupInsert(this);
                }
                catch (Exception e)
                {
                    Exception InternalError = new Exception("InternalError: Building insert handler", e);
                    throw (InternalError);
                }

                try
                {
                    if (aProductStockGroupDoc == null)
                    {
                        Exception InternalError = new Exception("DataError: Root object cannot be null");
                        throw (InternalError);
                    }
                    aProductStockGroupHandler.Process(ref mt, null, aProductStockGroupDoc);
                    GetDataBase().Commit();
                }
                catch (Exception e)
                {
                    try
                    {
                        GetDataBase().Rollback();
                    }
                    catch (Exception)
                    {}
                    Exception InternalError = new Exception("DataError: Error processing data", e);
                    throw (InternalError);
                }
            }

            finally
            {
                EndWebmethod();
            }

            ExitProc();

            return;
        }
Exemple #3
0
        public void TransportPlanOrder(string ChannelId, string ChannelRef, string TransactionId, TransportPlanOrderHeadDoc aTransportPlanOrderHeadDoc)
        {
            EnterProc();

            TransportPlanOrderHeadInsert aTransportPlanOrderHeadHandler;

            try
            {
                MessageTransaction mt = BeginWebmethod(ChannelId, ChannelRef, TransactionId, "TPO");

                try
                {
                    aTransportPlanOrderHeadHandler = new TransportPlanOrderHeadInsert(this);
                }
                catch (Exception e)
                {
                    Exception InternalError = new Exception("InternalError: Building insert handler", e);
                    throw (InternalError);
                }

                try
                {
                    if (aTransportPlanOrderHeadDoc == null)
                    {
                        Exception InternalError = new Exception("DataError: Root object cannot be null");
                        throw (InternalError);
                    }
                    aTransportPlanOrderHeadHandler.Process(ref mt, null, aTransportPlanOrderHeadDoc);
                    GetDataBase().Commit();
                }
                catch (Exception e)
                {
                    try
                    {
                        GetDataBase().Rollback();
                    }
                    catch (Exception)
                    {}
                    Exception InternalError = new Exception("DataError: Error processing data", e);
                    throw (InternalError);
                }
            }

            finally
            {
                EndWebmethod();
            }

            ExitProc();

            return;
        }
Exemple #4
0
        protected MessageTransaction BeginWebmethod(string ChannelId, string ChannelRef, string TransactionId, string HAPIObjectName)
        {
            string ConnectionString;

            try
            {
                ConnectionString = GetWebConfig(ChannelId);
            }
            catch (Exception e)
            {
                Exception WebConfigError = new Exception("WebConfigError: File format error", e);
                throw (WebConfigError);
            }

            if (ConnectionString == null)
            {
                Exception WebConfigContentsMissing = new Exception("WebConfigError: No ConnectionString matches ExternalId");
                throw (WebConfigContentsMissing);
            }

            try
            {
                db = new Database(ConnectionString);
            }
            catch (Exception e)
            {
                Exception WebConfigContentsError = new Exception("WebConfigError: Database connection failed", e);
                throw (WebConfigContentsError);
            }

            db.StartTransaction();

            MessageTransaction mt = new MessageTransaction(ChannelId, TransactionId, HAPIObjectName, db);

            return(mt);
        }