/// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="Col_Oit_GuidID">[To be supplied.]</param>
        public void Remove(System.Data.SqlTypes.SqlGuid Col_Oit_GuidID)
        {
            bool alreadyOpened = false;

            Params.spD_tblOrderItem Param = new Params.spD_tblOrderItem(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_Oit_GuidID = Col_Oit_GuidID;

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

            Sp.Execute(ref Param);

            CloseConnection(Sp.Connection, alreadyOpened);
        }
Пример #2
0
        public void Delete_tblOrderItem_Record(Guid id)
        {
            Params.spD_tblOrderItem param = new Params.spD_tblOrderItem(true);

            param.SetUpConnection(string.Empty);

            param.Param_Oit_GuidID = id;

            using (SPs.spD_tblOrderItem sp = new SPs.spD_tblOrderItem(true)) {
                sp.Execute(ref param);
                param.Dispose();
            }
        }
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="record">[To be supplied.]</param>
        public void Remove(IBusinessComponentRecord record)
        {
            tblOrderItem_Record recordToDelete = record as tblOrderItem_Record;

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

            bool alreadyOpened = false;

            Params.spD_tblOrderItem Param = new Params.spD_tblOrderItem(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_Oit_GuidID = recordToDelete.Col_Oit_GuidID;

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

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

            if (internalRecords != null)
            {
                internalRecords.Remove(recordToDelete);
            }
        }
Пример #4
0
        private void cmdDelete_Click(object sender, System.EventArgs e)
        {
            Params.spD_tblOrderItem Param = null;
            SPs.spD_tblOrderItem    SP    = null;

            Param = new Params.spD_tblOrderItem();

            Param.SetUpConnection(ConnectionString);

            Param.Param_Oit_GuidID = CurrentID;

            SP = new SPs.spD_tblOrderItem();

            if (SP.Execute(ref Param))
            {
                Param.Dispose();
                SP.Dispose();

                MainDisplay.Visible  = false;
                ErrorDisplay.Visible = true;
                lab_Error.Text       = String.Format("Record with ID: {0} was successfully deleted!", CurrentID.ToString());

                return;
            }
            else
            {
                if (Param.SqlException != null)
                {
                    throw Param.SqlException;
                }

                if (Param.OtherException != null)
                {
                    throw Param.OtherException;
                }
            }
        }
Пример #5
0
        public void Execute(WSGuid Oit_GuidID, WSGuid Oit_GuidOrderID, WSGuid Oit_GuidProductID)
        {
            Params.spD_tblOrderItem param = new Params.spD_tblOrderItem(true);
            param.SetUpConnection(string.Empty);

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

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

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

            using (SPs.spD_tblOrderItem sp = new SPs.spD_tblOrderItem(true)) {
                sp.Execute(ref param);
                param.Dispose();
            }
        }