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();
            }
        }
        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();
            }
        }
Beispiel #3
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;
                }
            }
        }