Exemplo n.º 1
0
        public void Execute(WSGuid Spr_GuidProductID, WSGuid Spr_GuidSupplierID)
        {
            Params.spD_tblSupplierProduct param = new Params.spD_tblSupplierProduct(true);
            param.SetUpConnection(string.Empty);

            if (Spr_GuidProductID == null || Spr_GuidProductID.UseNull)
            {
                param.Param_Spr_GuidProductID = SqlGuid.Null;
            }
            else if (!Spr_GuidProductID.UseDefault)
            {
                param.Param_Spr_GuidProductID = Spr_GuidProductID.Value;
            }

            if (Spr_GuidSupplierID == null || Spr_GuidSupplierID.UseNull)
            {
                param.Param_Spr_GuidSupplierID = SqlGuid.Null;
            }
            else if (!Spr_GuidSupplierID.UseDefault)
            {
                param.Param_Spr_GuidSupplierID = Spr_GuidSupplierID.Value;
            }

            using (SPs.spD_tblSupplierProduct sp = new SPs.spD_tblSupplierProduct(true)) {
                sp.Execute(ref param);
                param.Dispose();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="Col_Spr_GuidProductID">[To be supplied.]</param>
        /// <param name="Col_Spr_GuidSupplierID">[To be supplied.]</param>
        public void Remove(System.Data.SqlTypes.SqlGuid Col_Spr_GuidProductID, System.Data.SqlTypes.SqlGuid Col_Spr_GuidSupplierID)
        {
            bool alreadyOpened = false;

            Params.spD_tblSupplierProduct Param = new Params.spD_tblSupplierProduct(true);
            Param.CommandTimeOut = this.deleteCommandTimeOut;
            switch (this.lastKnownConnectionType)
            {
            case OlymarsDemo.DataClasses.ConnectionType.ConnectionString:
                Param.SetUpConnection(this.connectionString);
                break;

            case OlymarsDemo.DataClasses.ConnectionType.SqlConnection:
                Param.SetUpConnection(this.sqlConnection);
                alreadyOpened = (this.sqlConnection.State == System.Data.ConnectionState.Open);
                break;

            case OlymarsDemo.DataClasses.ConnectionType.SqlTransaction:
                Param.SetUpConnection(this.sqlTransaction);
                break;
            }

            Param.Param_Spr_GuidProductID = Col_Spr_GuidProductID;

            Param.Param_Spr_GuidSupplierID = Col_Spr_GuidSupplierID;

            SPs.spD_tblSupplierProduct Sp = new SPs.spD_tblSupplierProduct(true);

            Sp.Execute(ref Param);

            CloseConnection(Sp.Connection, alreadyOpened);
        }
Exemplo n.º 3
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="record">[To be supplied.]</param>
        public void Remove(IBusinessComponentRecord record)
        {
            tblSupplierProduct_Record recordToDelete = record as tblSupplierProduct_Record;

            if (recordToDelete == null)
            {
                throw new ArgumentException("Invalid record type. Must be 'OlymarsDemo.BusinessComponents.tblSupplierProduct_Record'.", "record");
            }

            bool alreadyOpened = false;

            Params.spD_tblSupplierProduct Param = new Params.spD_tblSupplierProduct(true);
            Param.CommandTimeOut = this.deleteCommandTimeOut;
            switch (this.lastKnownConnectionType)
            {
            case OlymarsDemo.DataClasses.ConnectionType.ConnectionString:
                Param.SetUpConnection(this.connectionString);
                break;

            case OlymarsDemo.DataClasses.ConnectionType.SqlConnection:
                Param.SetUpConnection(this.sqlConnection);
                alreadyOpened = (this.sqlConnection.State == System.Data.ConnectionState.Open);
                break;

            case OlymarsDemo.DataClasses.ConnectionType.SqlTransaction:
                Param.SetUpConnection(this.sqlTransaction);
                break;
            }

            Param.Param_Spr_GuidProductID = recordToDelete.Col_Spr_GuidProductID;

            Param.Param_Spr_GuidSupplierID = recordToDelete.Col_Spr_GuidSupplierID;

            SPs.spD_tblSupplierProduct Sp = new SPs.spD_tblSupplierProduct(true);

            Sp.Execute(ref Param);
            CloseConnection(Sp.Connection, alreadyOpened);

            if (internalRecords != null)
            {
                internalRecords.Remove(recordToDelete);
            }
        }