Ejemplo n.º 1
0
        public void Execute(WSGuid Pro_GuidID, WSInt32 Pro_LngCategoryID)
        {
            Params.spD_tblProduct param = new Params.spD_tblProduct(true);
            param.SetUpConnection(string.Empty);

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

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

            using (SPs.spD_tblProduct sp = new SPs.spD_tblProduct(true)) {
                sp.Execute(ref param);
                param.Dispose();
            }
        }
Ejemplo n.º 2
0
        public void Delete_Product(Guid id)
        {
            Params.spD_tblProduct param = new Params.spD_tblProduct(true);

            param.SetUpConnection(string.Empty);

            param.Param_Pro_GuidID = id;

            using (SPs.spD_tblProduct sp = new SPs.spD_tblProduct(true)) {
                sp.Execute(ref param);
                param.Dispose();
            }
        }
Ejemplo n.º 3
0
        private void cmdDelete_Click(object sender, System.EventArgs e)
        {
            Params.spD_tblProduct Param = null;
            SPs.spD_tblProduct    SP    = null;

            Param = new Params.spD_tblProduct();

            Param.SetUpConnection(ConnectionString);

            Param.Param_Pro_GuidID = CurrentID;

            SP = new SPs.spD_tblProduct();

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