Beispiel #1
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L6SO_GPDfPC_1049 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6SO_GPDfPC_1049 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L6SO_GPDfPC_1049 functionReturn = new FR_L6SO_GPDfPC_1049();

            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 ex;
            }
            return(functionReturn);
        }
Beispiel #2
0
        protected static FR_L6SO_GPDfPC_1049 Execute(DbConnection Connection, DbTransaction Transaction, P_L6SO_GPDfPC_1049 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L6SO_GPDfPC_1049();
            //Put your code here

            returnValue.Result           = new L6SO_GPDfPC_1049();
            returnValue.Result.BasicInfo = new L5SO_GSHfH_1040();

            //positions
            returnValue.Result.Positions = cls_Get_AllShippingPositions_for_PickingControlFlags_and_ShippingHeaderID.
                                           Invoke(Connection, Transaction, new P_L6SO_GASPfPCFaSH_1202 {
                ShippmentHeaderID = Parameter.ShipmentHeaderID
            }, securityTicket).Result;

            //basic info
            returnValue.Result.BasicInfo = cls_Get_ShippingHeader_for_HeaderID.
                                           Invoke(Connection, Transaction, new P_L5SO_GSHfH_1040 {
                HeaderID = Parameter.ShipmentHeaderID
            }, securityTicket).Result;

            //organizationunitid
            ORM_ORD_CUO_CustomerOrder_Position_2_ShipmentPosition       assignment      = new ORM_ORD_CUO_CustomerOrder_Position_2_ShipmentPosition();
            ORM_ORD_CUO_CustomerOrder_Position_2_ShipmentPosition.Query assignmentQuery = new ORM_ORD_CUO_CustomerOrder_Position_2_ShipmentPosition.Query();
            assignmentQuery.LOG_SHP_Shipment_Position_RefID = returnValue.Result.Positions.First().LOG_SHP_Shipment_PositionID;
            assignmentQuery.Tenant_RefID = securityTicket.TenantID;
            assignmentQuery.IsDeleted    = false;

            assignment = ORM_ORD_CUO_CustomerOrder_Position_2_ShipmentPosition.Query.Search(Connection, Transaction, assignmentQuery).Single();

            returnValue.Result.OrganizationUnitID = assignment.CMN_BPT_CTM_OrganizationalUnit_RefID;



            return(returnValue);

            #endregion UserCode
        }