//Button Exit Click
 private void DatabaseSettingButtonExitClick(object sender, System.Windows.RoutedEventArgs e)
 {
     MessageBoxResult messBoxResult = new MessageBoxResult();
     messBoxResult = Microsoft.Windows.Controls.MessageBox.Show(Variables.ERROR_MESSAGES[1, 1], Variables.ERROR_MESSAGES[0, 0], MessageBoxButton.YesNo, MessageBoxImage.Question);
     if (messBoxResult.Equals(MessageBoxResult.Yes))
     {
         Application.Current.Shutdown();
     }
 }
 //Window On closing
 protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
 {
     MessageBoxResult messBoxResult = new MessageBoxResult();
     messBoxResult = Microsoft.Windows.Controls.MessageBox.Show(Variables.ERROR_MESSAGES[1, 1], Variables.ERROR_MESSAGES[0, 0], MessageBoxButton.YesNo, MessageBoxImage.Question);
     if (messBoxResult.Equals(MessageBoxResult.Yes))
     {
         Application.Current.Shutdown();
     }
     else
     {
         e.Cancel = true;
     }
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         MainWindow.BL.UpdateHostingUnit(unitUserControl.hu);
         MessageBoxResult result = MessageBox.Show("[Key:" + unitUserControl.hu.HostingUnitKey + "] Unit has been updated.\n\nWould you like to close this window?", "System", MessageBoxButton.YesNo, MessageBoxImage.Information);
         if (result.Equals(MessageBoxResult.Yes))
         {
             this.Close();
         }
     }
     catch (Exception err)
     {
         MessageBox.Show(err.Message, "System", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (Mode == GameMode.Mode.Online)
     {
         if (!MatchFinish)
         {
             MessageBoxResult userChoice = MessageBox.Show("Are you sure you want to surrender?", "Notice", MessageBoxButton.YesNo, MessageBoxImage.Information);
             if (userChoice.Equals(MessageBoxResult.Yes))
             {
                 Thread notifySurrender = new Thread(() => Client.PlayerLose(Match.HomePlayer,
                                                                             Match.AwayPlayer, UserName));
                 notifySurrender.Start();
             }
         }
     }
 }
 /// <summary>
 /// Removes the customer
 /// </summary>
 private void delete( )
 {
     try
     {
         MessageBoxResult dialogResult = MessageBox.Show(Properties.Resources.AreYouSure, "Delete", MessageBoxButton.YesNo, MessageBoxImage.Warning);
         if (dialogResult.Equals(MessageBoxResult.Yes))
         {
             CustomerManager.DeleteCustomer(this.Kunde);
             this.Close();
         }
     }
     catch (Exception ex)
     {
         ExceptionHelper.Handle(ex);
     }
 }
示例#6
0
 private void btndelete_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         MessageBoxResult Result = MessageBox.Show("Do You Really Want To Delete?", "Delete", MessageBoxButton.YesNo, MessageBoxImage.Information);
         if (Result.Equals(MessageBoxResult.Yes))
         {
             SetParameters();
             DeleteSubject();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
示例#7
0
        /// <summary>
        ///     The click event of the restart button.
        ///     This restarts the game to start over.
        /// </summary>
        /// <param name="sender">The object that is being clicked on.</param>
        /// <param name="args">The event arguments.</param>
        private void RestartButton_Click(object sender, RoutedEventArgs args)
        {
            MessageBoxResult result = MessageBox.Show("Weet je zeker dat je opnieuw wilt beginnen? Als je dit doet kom je niet op het scorebord.", "Opnieuw beginnen", MessageBoxButton.YesNo);

            if (result.Equals(MessageBoxResult.Yes))
            {
                grid = new MemoryGrid(this, cardHolder, player1, player2, colSize, rowSize);

                player1.SetScore(0);
                player2.SetScore(0);

                player1.SetTurn(true);
                player2.SetTurn(false);

                UpdateLabels(player1, player2);
            }
        }
示例#8
0
        private void Delete_car_btn_Click(object sender, RoutedEventArgs e)
        {
            if (dataGrid.SelectedIndex != -1)
            {
                DataRowView view          = (DataRowView)dataGrid.SelectedItem;
                String      license_plate = view.Row["license_plate"].ToString();

                String message = "Möchten Sie das Fahrzeug mit den Kennzeichen " + license_plate + " wirklich löschen?";

                MessageBoxResult result = MessageBox.Show(message, "Löschen", MessageBoxButton.YesNo);

                if (result.Equals(MessageBoxResult.Yes))
                {
                    Sql.DeleteCar(license_plate);
                }
            }
        }
 private void ClickExcluirVendedor(object sender, RoutedEventArgs e)
 {
     try {
         MessageBoxResult result = MessageBox.Show("Deseja excluir",
                                                   "Confirma", MessageBoxButton.OKCancel, MessageBoxImage.Information);
         if (result.Equals(MessageBoxResult.OK))
         {
             Vendedor           vend        = ((FrameworkElement)sender).DataContext as Vendedor;
             VendedorController vController = new VendedorController();
             vController.ExcluirVendedor(vend.VendedorId);
             MessageBox.Show("Vendedor Excluído com sucesso");
             carregarVendedores();
         }
     } catch (Exception s) {
         MessageBox.Show(s.Message);
     }
 }
        private void SaveWorldFile()
        {
            if (CurrentWorld == null)
            {
                return;
            }

            if (CurrentWorld.LastSave < File.GetLastWriteTimeUtc(CurrentFile))
            {
                MessageBoxResult overwrite = MessageBox.Show(_currentWorld.Title + " was externally modified since your last save.\r\nDo you wish to overwrite?", "World Modified", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
                if (overwrite.Equals(MessageBoxResult.Cancel))
                {
                    return;
                }
            }
            SaveWorldThreaded(CurrentFile);
        }
示例#11
0
        private void eliminarCitaButton_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult mensaje = MessageBox.Show("¿Seguro que deseas eliminar la cita?", "Aviso", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (mensaje.Equals(MessageBoxResult.Yes))
            {
                unidadTrabajo.RepositorioCita.eliminar(cita);
                cita = new Citas();
                citasGrid.DataContext         = cita;
                citasDataGrid.ItemsSource     = "";
                citasDataGrid.ItemsSource     = unidadTrabajo.RepositorioCita.getGeneral();
                anadirCitaButton.IsEnabled    = true;
                modificarCitaButton.IsEnabled = false;
                eliminarCitaButton.IsEnabled  = false;
                MessageBox.Show("Ya eliminado cita", "Información", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
示例#12
0
        //Перегружаем кнопку, чтобы из данного окна выходить из приложения
        protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
        {
            //Проверка, уверен ли пользователь, что хочет выйти
            MessageBoxResult answer = MessageBox.Show("Вы действиетльно хотите выйти из приложения?", "подтверждение выхода", MessageBoxButton.OKCancel);

            if (answer.Equals(MessageBoxResult.OK))
            {
                if (NavigationService.CanGoBack)
                {
                    while (NavigationService.RemoveBackEntry() != null)
                    {
                        NavigationService.RemoveBackEntry();
                    }
                }
                base.OnBackKeyPress(e);
            }
        }
示例#13
0
        private void eliminarHistorialButton_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult mensaje = MessageBox.Show("¿Seguro que deseas eliminar el historial?", "Aviso", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (mensaje.Equals(MessageBoxResult.Yes))
            {
                unidadTrabajo.RepositorioHistorial.eliminar(historial);
                historial = new Historiales();
                historialesGrid.DataContext        = historial;
                idHistorialTextBox.Text            = "";
                historialesDataGrid.ItemsSource    = "";
                historialesDataGrid.ItemsSource    = unidadTrabajo.RepositorioHistorial.getGeneral();
                crearHistorialButton.IsEnabled     = true;
                modificarHistorialButton.IsEnabled = false;
                eliminarHistorialButton.IsEnabled  = false;
                MessageBox.Show("Ya eliminado historial", "Información", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
示例#14
0
        private void eliminarPacienteButton_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult mensaje = MessageBox.Show("¿Seguro que deseas eliminar el usuario?", "Aviso", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (mensaje.Equals(MessageBoxResult.Yes))
            {
                unidadTrabajo.RepositorioPaciente.eliminar(paciente);
                paciente = new Usuarios();
                pacientesGrid.DataContext         = paciente;
                pacientesDataGrid.ItemsSource     = "";
                pacientesDataGrid.ItemsSource     = unidadTrabajo.RepositorioPaciente.getGeneral();
                crearPacienteButton.IsEnabled     = true;
                modificarPacienteButton.IsEnabled = false;
                eliminarPacienteButton.IsEnabled  = false;
                buscarPacienteButton.IsEnabled    = true;
                MessageBox.Show("Ya eliminado paciente", "Información", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
示例#15
0
        private void supprimerCompteServeur(CompteServeur pCptServ)
        {
            MessageBoxResult res = MessageBox.Show("Etes vous sûr de vouloir supprimer le compte " + pCptServ.Fournisseur + " ?", "SIMAIL", MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (res.Equals(MessageBoxResult.Yes))
            {
                if (currentCompteMessagerie != null & currentCompteMessagerie.isAuthenticated())
                {
                    if (IT_CompteServeur.SelectedIndex != -1)
                    {
                        if (IT_CompteServeur.SelectedItem.GetType().Equals(typeof(CompteServeur)))
                        {
                            if (IT_CompteServeur.SelectedItem.Equals(pCptServ))
                            {
                                if (Directory.Exists(getPathFolder()))
                                {
                                    String vPath = getPathFolder();
                                    foreach (String vFile in Directory.GetFiles(vPath))
                                    {
                                        FileInfo f = new FileInfo(vFile);
                                        if (f.Name.Equals(pCptServ.Fournisseur + ".xml"))
                                        {
                                            f.Delete();
                                            gListComptesServ.Remove(pCptServ);
                                            IT_CompteServeur.ItemsSource = null;
                                            IT_CompteServeur.ItemsSource = gListComptesServ;
                                        }
                                    }
                                }
                                else
                                {
                                    MessageBox.Show("Répertoire des comptes serveur introuvable.");
                                }
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Veuillez sélectionner un compte de connexion dans la liste ci dessus ! ");
                    }
                }
            }
        }
示例#16
0
 /*
  * Created By:-
  * Created Date:-
  * Purpose
  */
 #region -------------------------btndelete_Click-------------------------------
 private void btndelete_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         MessageBoxResult Result = MessageBox.Show("Do You Really Want To Delete?", "Delete", MessageBoxButton.YesNo, MessageBoxImage.Information);
         if (Result.Equals(MessageBoxResult.Yes))
         {
             SetParameters();
             DeleteClass();
             //BindBranchName();
             //cbBranchName.IsEnabled = true;
             //btnGo.Content = "Go";
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
示例#17
0
        void listManagement_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (listManagement.SelectedIndex == -1)
            {
                return;
            }
            MessageBoxResult result = MessageBox.Show("Are you sure you want to delete this Management Item?", "Confirm Delete", MessageBoxButton.OKCancel);

            if (result.Equals(MessageBoxResult.OK))
            {
                List <string> m = d.Management.ToList();
                m.RemoveAt(listManagement.SelectedIndex);
                d.Management = m;
                d.SaveAsync();
            }

            listManagement.ItemsSource = null;
            listManagement.ItemsSource = d.Management;
        }
示例#18
0
        /// <summary>
        /// Abre una conexión Web a una reconocida página de información sobre comandos SQL,
        /// previa petición de permiso al usuario.
        /// </summary>
        private void Ayuda()
        {
            MessageBoxResult opcionElegir =
                MessageBox.Show("Se abrirá una conexión a la web W3SCHOOLS\r\n"
                                + "¿Desea permitirlo?", "Información", MessageBoxButton.YesNo,
                                MessageBoxImage.Information);

            if (opcionElegir.Equals(MessageBoxResult.Yes))
            {
                try
                {
                    Process.Start("https://www.w3schools.com/sql/default.asp");
                }
                catch (Exception)
                {
                    Msj.Aviso("Navegador por defecto no encontrado");
                }
            }
        }
        //This method handle the event raised by the click on the create new configuration button
        private void Create_New_Configuration_button_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("There is the possibility to auto configure the system!\nDo you want to proceed?",
                                                      "Auto-setup option available", MessageBoxButton.YesNo);

            if (result.Equals(MessageBoxResult.Yes))
            {
                try
                {
                    StartSetup();
                }catch (Exception ex)
                {
                    Synchronizer.StopSetup();
                    Mouse.OverrideCursor = null;

                    Console.WriteLine(ex.StackTrace);
                    Console.WriteLine(ex.Message);

                    MessageBoxResult result3 = MessageBox.Show("There was an error during the listening of the boards\nWould you try again?",
                                                               "Auto-setup error", MessageBoxButton.YesNo);
                    if (result3.Equals(MessageBoxResult.Yes))
                    {
                        StartSetup();
                    }
                    else
                    {
                        this.createConfiguration.IsEnabled = true;
                        this.loadConfiguration.IsEnabled   = true;
                        this.modifyConfiguration.IsEnabled = true;
                        this.removeConfiguration.IsEnabled = true;
                    }
                }
            }
            else
            {
                this.Hide();
                Setup_Window nSetup = new Setup_Window(Features.Window_Mode.Create);
                nSetup.Show();
                this.Close();
            }

            return;
        }
示例#20
0
        /* Created By:- Pranjali Vidhate
         * Created Date :- 10 Dec 2015
         * Purpose:- Delete Button Coding */

        #region --------------------------Delete()-------------------------------------
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (Validate())
                {
                    MessageBoxResult Result = MessageBox.Show("Do You Want To Delete?", "Delete Record", MessageBoxButton.YesNo, MessageBoxImage.Question);
                    if (Result.Equals(MessageBoxResult.Yes))
                    {
                        Setparameter();
                        Delete();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
示例#21
0
        private void ClickExcluirCliente(object sender, RoutedEventArgs e)
        {
            try
            {
                MessageBoxResult result = MessageBox.Show("Deseja excluir",
                                                          "Confirma", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                if (result.Equals(MessageBoxResult.OK))
                {
                    Cliente cliente = ((FrameworkElement)sender).DataContext as Cliente;
                    clienteController.ExclirCliente(cliente.ClienteId);

                    MessageBox.Show("Cliente Excluído com sucesso");
                    carregarClientes();
                }
            }
            catch (Exception s)
            {
                MessageBox.Show(s.Message);
            }
        }
 private void goButton_Click(object sender, RoutedEventArgs e)
 {
     if (ValidateProfile())
     {
         if (edit)
         {
             MessageBoxResult mbr = MessageBox.Show("Are you sure you want to start over with these new settings?", "Restart?", MessageBoxButton.YesNo);
             if (mbr.Equals(MessageBoxResult.No))
             {
                 return;
             }
         }
         CompleteProfile();
         if (!edit)
         {
             parent.AddProfile(profile);
         }
         parent.ReturnAndSave();
     }
 }
示例#23
0
        /// <summary>
        /// Deletes a device from trusted devices list
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void deleteTrustedDeviceBtn_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result1 = MessageBox.Show("Do you want to delete " + listBoxTrustedDevices.SelectedItem.ToString() + "?", "Delete an authentication key?", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (result1.Equals(MessageBoxResult.Yes))
            {
                if (Files.Count > 0)
                {
                    MessageBoxResult result2 = MessageBox.Show("You want to delete a key with associated files with it. " +
                                                               "They will no longer be protected! Are you sure?", "Associated files found!", MessageBoxButton.YesNo, MessageBoxImage.Warning);

                    if (result2.Equals(MessageBoxResult.Yes))
                    {
                        Files.Clear();
                        IOClass.SaveFilesList(Files, this.UserFilesFilepath);
                        bindFilesListBox();
                        bindDeviceListBoxes();

                        if (deleteTrustedDevice(listBoxTrustedDevices.SelectedItem.ToString()))
                        {
                            MessageBox.Show("The authentication key has been deleted.", "Deleting successful", MessageBoxButton.OK, MessageBoxImage.Information);
                        }
                        else
                        {
                            MessageBox.Show("Couldn't delete an authentication key.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                        }
                    }
                }
                else
                {
                    if (deleteTrustedDevice(listBoxTrustedDevices.SelectedItem.ToString()))
                    {
                        MessageBox.Show("The authentication key has been deleted.", "Deleting successful", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                    else
                    {
                        MessageBox.Show("Couldn't delete an authentication key.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }
            }
        }
示例#24
0
        private void InitializeWatcher()
        {
            if (!settings.Contains("gpsflag"))
            {
                settings.Add("gpsflag", false);
            }


            // Reinitialize the GeoCoordinateWatcher
            watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
            watcher.MovementThreshold = 100;//distance in metres

            // Add event handlers for StatusChanged and PositionChanged events
            watcher.StatusChanged   += new EventHandler <GeoPositionStatusChangedEventArgs>(watcher_StatusChanged);
            watcher.PositionChanged += new EventHandler <GeoPositionChangedEventArgs <GeoCoordinate> >(watcher_PositionChanged);


            settings.TryGetValue <bool>("gpsflag", out gpsFlag);

            if (gpsFlag)
            {
                // Start data acquisition
                watcher.Start();
            }
            else
            {
                MessageBoxResult result = MessageBox.Show("This app need your location data to track your location and altitude.", "GPS Permission request", MessageBoxButton.OKCancel);
                if (result.Equals(MessageBoxResult.OK))
                {
                    // Start data acquisition
                    watcher.Start();

                    gpsFlag             = true;
                    settings["gpsflag"] = gpsFlag;
                }
                else
                {
                    tbStatus.Text = "GPS data: OFF";
                }
            }
        }
        private void btnSaveAllSparesPurchase_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Please verify the Purchase Invoice by Clicking View Invoice Once. Because Wrong entry might consume extra efforts or Loss of Data for Future Edit. You want to Proceed? ", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (result.Equals(MessageBoxResult.No))
            {
                return;
            }

            SparePurchaseInvoice.INVOICE_NO             = txtInvoiceNo.Text;
            SparePurchaseInvoice.INVOICE_DATE           = dateTimeInvoiceDate.SelectedDate.Value;
            SparePurchaseInvoice.INVOICE_VAT_PERCENT    = Convert.ToDecimal(lblVatInPercentage.Content);
            SparePurchaseInvoice.PURCHASE_TYPE          = data.GetMasterId(CommonLayer.TYPE.SPARE.ToString());
            SparePurchaseInvoice.INVOICE_DISCOUNT       = Convert.ToDecimal(txtDiscountAmount.Text);
            SparePurchaseInvoice.INVOICE_GRANDTOTAL     = Convert.ToDecimal(txtGrandTotalOfInvoice.Text);
            SparePurchaseInvoice.EXPENDITURE_ON_SUBTOAL = Convert.ToDecimal(txtExpOnTotalAmount.Text);

            data.Insert <INVOICE>(SparePurchaseInvoice);

            MessageBox.Show("Spares Details Added Successfully");
        }
示例#26
0
        /*
         * Created By:- Sameer Shinde
         * Ctreated Date :- 5 Nov 2015
         * Purpose:- Delete Record
         */
        #region ------------------DeleteClick()---------------------------
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (Validate())
                {
                    MessageBoxResult result = MessageBox.Show("Do You Want to delete?", "Delete", MessageBoxButton.YesNoCancel);
                    if (result.Equals(MessageBoxResult.Yes))
                    {
                        SetParameters();
                        DeleteBranch();
                        BindGridview();
                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
示例#27
0
        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult value = MessageBox.Show("This will wipe all sim setup done so far. Are you sure you want to continue?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);

            if (value.Equals(MessageBoxResult.Yes))
            {
                SimDataManager.ResetSimData();
            }
            else
            {
                return;
            }

            var window = new MainWindow();

            window.Top             = App.Current.MainWindow.Top;
            window.Left            = App.Current.MainWindow.Left;
            App.Current.MainWindow = window;
            this.Close();
            window.Show();
        }
        private void Button_AddCost_Click(object sender, RoutedEventArgs e)
        {
            var              number   = Int32.Parse(CostPriceTextBox.Text);
            List <bill>      listBill = new List <bill>();
            MessageBoxResult result   = result = MessageBox.Show("bạn có muốn thêm chi phí của lộ trình?", "Confirm", MessageBoxButton.OKCancel, MessageBoxImage.Information);

            if (result.Equals(MessageBoxResult.OK))
            {
                _Tour.bill.Add(new bill {
                    CostName = CostTextBox.Text, Cost = number
                });
                this.CostList.Items.Add(new bill {
                    CostName = CostTextBox.Text, Cost = number
                });
                //CostList.ItemsSource = _Tour.bill;

                CostTextBox.Text      = string.Empty;
                CostPriceTextBox.Text = string.Empty;
                Update();
            }
        }
示例#29
0
        private void Delete_btn_Click(object sender, RoutedEventArgs e)
        {
            //TODO
            MyGarageDataSet ds = new MyGarageDataSet();

            MyGarageDataSet.repairsRow row = ds.repairs.NewrepairsRow();
            DataRowView view          = (DataRowView)dataGrid.SelectedItem;
            String      license_plate = view.Row["license_plate"].ToString();
            DateTime    date          = (DateTime)view.Row["repair_date"];

            String message = "Möchten Sie die Reparatur wirklich löschen?";

            MessageBoxResult result = MessageBox.Show(message, "Löschen", MessageBoxButton.YesNo);

            if (result.Equals(MessageBoxResult.Yes))
            {
                repairsTableAdapter.DeleteRepair(license_plate, date);
                MyGarageDataSet.repairsDataTable repairsTable = repairsTableAdapter.GetRepairByLicensePlate(license_plate);
                dataGrid.ItemsSource = repairsTable;
            }
        }
        private void updt_b_Click(object sender, RoutedEventArgs e)
        {
            String mesg, mesg2;

            mesg2 = ServiceClientObject.SupplierDetails(Convert.ToInt32(suplIDtxt.Text));
            MessageBoxResult re = MessageBox.Show(mesg2, "You are going to Update Supplier", MessageBoxButton.OKCancel, MessageBoxImage.Information);

            if (re.Equals(MessageBoxResult.OK))
            {
                Suppliers_tbl SupplierInfo = new Suppliers_tbl();
                SupplierInfo.Supplier_Id   = Convert.ToInt32(suplIDtxt.Text);
                SupplierInfo.Supplier_Name = suplNametxt.Text;
                SupplierInfo.Phone_No      = Convert.ToInt32(suplTeletxt.Text);
                mesg = ServiceClientObject.UpdateSupplierDetails(SupplierInfo);
                MessageBox.Show(mesg);
            }
            else
            {
                cleartxt();
            }
        }
示例#31
0
 private bool IsAcAdapterNotExist()
 {
     while (PublicFunction.IsCharging)
     {
         if (IsFixtureExisted)
         {
             if (!PublicFunction.EnableRTS())
             {
                 return(false);
             }
         }
         else
         {
             MessageBoxResult Result = ShowDialogMessageBox("Please un-plug an AC adapter.", "Attention", MessageBoxButton.YesNo, MessageBoxImage.Information);
             if (Result.Equals(MessageBoxResult.No))
             {
                 return(false);
             }
         }
     }
     return(true);
 }
        private void DeleteClient(Customer client)
        {
            if (client == null)
            {
                MessageBox.Show("Wählen Sie bitte einen Kunden in der Liste aus");
                return;
            }

            MessageBoxResult result = MessageBox.Show("Sind Sie sicher, dass Sie diesen Kunden löschen möchten?", "", MessageBoxButton.YesNo);

            if (result.Equals(MessageBoxResult.Yes))
            {
                if (AppViewModel.DeleteClient(client))
                {
                    PullAllClients();
                }
                else
                {
                    throw new Exception("Delete Client Failed!");
                }
            }
        }