Exemplo n.º 1
0
        private void BtnUpdateMaintenance_Click(object sender, RoutedEventArgs e)
        {
            if (String.IsNullOrEmpty(getTitre.Text) || String.IsNullOrEmpty(getDesc.Text) || String.IsNullOrEmpty(getDebut.Text) || String.IsNullOrEmpty(getFin.Text))
            {
                MessageBox.Show("Veuillez remplir tous les champs !");
            }
            else
            {
                Maintenance UneMaintenance = new Maintenance();

                UneMaintenance.Id_Maintenance = this.idMaintenance;
                UneMaintenance.Libelle        = getTitre.Text;
                UneMaintenance.Description    = getDesc.Text;
                UneMaintenance.Date_Debut     = getDebut.Text = getDebut.SelectedDate.Value.ToString("yyyy/MM/dd").Replace("/", "-");
                UneMaintenance.Date_Fin       = getFin.Text = getFin.SelectedDate.Value.ToString("yyyy/MM/dd").Replace("/", "-");
                UneMaintenance.Id_Incident    = this.idIncident;

                MaintenanceDAL ModifMaintenance = new MaintenanceDAL();
                ModifMaintenance.ModifierMaintenance(UneMaintenance);

                this.NavigationService.Navigate(new GestionMaintenance());
            }
        }