Ejemplo n.º 1
0
        private void MyCmdDelete_Click()
        {
            try
            {
                var response = MessageBox.Show("!!!Do you really want to Delete this Partido?\r\n" + txtNumPartido, "Deleting...", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);

                if (response == MessageBoxResult.No)
                {
                    return;
                }

                string myWhere = string.Empty;
                myWhere = txtNumPartido;
                bool myDelete = false;

                using (SqlExcuteCommand mySqlExe = new SqlExcuteCommand()
                {
                    DBCnnStr = _DBEndososCnnStr
                })
                {
                    myDelete = mySqlExe.MyDeletePartidos(myWhere);
                }

                if (!myDelete)
                {
                    throw new Exception("Error en la Base de Data");
                }

                MessageBox.Show("Done...", "Delete", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            catch (Exception ex)
            {
                MethodBase site = ex.TargetSite;
                MessageBox.Show(ex.Message, site.Name, MessageBoxButton.OK, MessageBoxImage.Error);
            }finally
            {
                MyRefresh();
                MyReset();
            }
        }