Esempio n. 1
0
 private void radDataForm_EditEnding(object sender, Telerik.Windows.Controls.Data.DataForm.EditEndingEventArgs e)
 {
     if (e.EditAction == Telerik.Windows.Controls.Data.DataForm.EditAction.Commit)
     {
         e.Cancel = !((Models.CatalogViewModel)DataContext).CommitChanges();
     }
     else
     {
         if (IsNew)
         {
             ((Models.CatalogViewModel)DataContext).CancelAddItem();
         }
     }
     IsNew   = false;
     Editing = false;
 }
 private void radDataForm_EditEnding(object sender, Telerik.Windows.Controls.Data.DataForm.EditEndingEventArgs e)
 {
     /*
      * if (e.EditAction == Telerik.Windows.Controls.Data.DataForm.EditAction.Commit)
      * {
      *  e.Cancel = !((Models.ToGoClientCatalogViewModel)DataContext).CommitChanges();
      * }
      * else
      * {
      *  if (IsNew)
      *  {
      *      ((Models.ToGoClientCatalogViewModel)DataContext).CancelAddItem();
      *  }
      * }
      * IsNew = false;
      * Editing = false;
      */
 }
 private void myRadDataForm_EditEnding(object sender, Telerik.Windows.Controls.Data.DataForm.EditEndingEventArgs e)
 {
     UIHelper.AddOrUpdateRecord <OrganizationAllocationGrade>(myRadDataForm, _dataContext, e);
 }
Esempio n. 4
0
        private void Data_EditEnding(object sender, Telerik.Windows.Controls.Data.DataForm.EditEndingEventArgs e)
        {
            ClasseEtudiant student = radDataForm1.CurrentItem as ClasseEtudiant;

            var x = (from etudiant in db.etudiant
                     join filiere in db.Filiere
                     on etudiant.id_fil equals filiere.Id_filiere
                     where etudiant.cne == student.Cne
                     select etudiant).SingleOrDefault();

            if (x != null)
            {
                x.nom        = student.Nom;
                x.prenom     = student.Prenom;
                x.date_naiss = student.Date_naiss;
                if (student.Sexe == Gender.Femme)
                {
                    x.sexe = 'F';
                }
                else if (student.Sexe == Gender.Homme)
                {
                    x.sexe = 'H';
                }
                else
                {
                    x.sexe = 'X';
                }

                db.SubmitChanges();
            }
            else
            {
                bool           erreur = false;
                ClasseEtudiant item   = radDataForm1.CurrentItem as ClasseEtudiant;
                etudiant       et     = new etudiant();
                et.cne        = item.Cne;
                et.nom        = item.Nom;
                et.prenom     = item.Prenom;
                et.date_naiss = item.Date_naiss;
                if (et.image == null)
                {
                    et.image = "default.png";
                }
                if (student.Sexe == Gender.Femme)
                {
                    et.sexe = 'F';
                }
                else if (student.Sexe == Gender.Homme)
                {
                    et.sexe = 'H';
                }
                else
                {
                    et.sexe = 'X';
                }

                bool find = false;
                int  id   = 0;

                var fil = from f in db.Filiere
                          select f;
                foreach (Filiere f in fil)
                {
                    if (f.Nom_filiere.Equals(item.Filiere))
                    {
                        find = true;
                        id   = f.Id_filiere;
                    }
                }

                if (find)
                {
                    et.id_fil = id;
                }

                else
                {
                    MessageBox.Show("Veuillez Entrer une filiere valide !");
                    erreur = true;
                }

                if (!erreur)
                {
                    db.etudiant.InsertOnSubmit(et);
                    db.SubmitChanges();
                }
            }
        }
Esempio n. 5
0
 private void StudentsForm_EditEnding(object sender, Telerik.Windows.Controls.Data.DataForm.EditEndingEventArgs e)
 {
     studentsGridView.Items.Refresh();
 }
 private void SLDataForm_EditEnding(object sender, Telerik.Windows.Controls.Data.DataForm.EditEndingEventArgs e)
 {
 }