コード例 #1
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="Col_Ord_GuidID">[To be supplied.]</param>
        public void Remove(System.Data.SqlTypes.SqlGuid Col_Ord_GuidID)
        {
            bool alreadyOpened = false;

            Params.spD_tblOrder Param = new Params.spD_tblOrder(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_Ord_GuidID = Col_Ord_GuidID;

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

            Sp.Execute(ref Param);

            CloseConnection(Sp.Connection, alreadyOpened);
        }
コード例 #2
0
        public void Execute(WSGuid Ord_GuidID, WSInt32 Ord_LngCustomerID)
        {
            Params.spD_tblOrder param = new Params.spD_tblOrder(true);
            param.SetUpConnection(string.Empty);

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

            if (Ord_LngCustomerID == null || Ord_LngCustomerID.UseNull)
            {
                param.Param_Ord_LngCustomerID = SqlInt32.Null;
            }
            else if (!Ord_LngCustomerID.UseDefault)
            {
                param.Param_Ord_LngCustomerID = Ord_LngCustomerID.Value;
            }

            using (SPs.spD_tblOrder sp = new SPs.spD_tblOrder(true)) {
                sp.Execute(ref param);
                param.Dispose();
            }
        }
コード例 #3
0
        public void Delete_tblOrder_Record(Guid id)
        {
            Params.spD_tblOrder param = new Params.spD_tblOrder(true);

            param.SetUpConnection(string.Empty);

            param.Param_Ord_GuidID = id;

            using (SPs.spD_tblOrder sp = new SPs.spD_tblOrder(true)) {
                sp.Execute(ref param);
                param.Dispose();
            }
        }
コード例 #4
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="record">[To be supplied.]</param>
        public void Remove(IBusinessComponentRecord record)
        {
            tblOrder_Record recordToDelete = record as tblOrder_Record;

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

            bool alreadyOpened = false;

            Params.spD_tblOrder Param = new Params.spD_tblOrder(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_Ord_GuidID = recordToDelete.Col_Ord_GuidID;

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

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

            if (internalRecords != null)
            {
                internalRecords.Remove(recordToDelete);
            }
        }
コード例 #5
0
        private void cmdDelete_Click(object sender, System.EventArgs e)
        {
            Params.spD_tblOrder Param = null;
            SPs.spD_tblOrder    SP    = null;

            Param = new Params.spD_tblOrder();

            Param.SetUpConnection(ConnectionString);

            Param.Param_Ord_GuidID = CurrentID;

            SP = new SPs.spD_tblOrder();

            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;
                }
            }
        }