Ejemplo n.º 1
0
 void OnValidateRowDeletion(System.Object sender, DevExpress.Mvvm.Xpf.EditFormValidateRowDeletionArgs e)
 {
     using (var unitOfWork = new UnitOfWork()) {
         var key  = (int)e.Keys.Single();
         var item = unitOfWork.GetObjectByKey <Issue>(key);
         unitOfWork.Delete(item);
         unitOfWork.CommitChanges();
     }
 }
 public void ValidateRowDeletion(DevExpress.Mvvm.Xpf.EditFormValidateRowDeletionArgs args)
 {
     using (var unitOfWork = new UnitOfWork()) {
         var key  = (int)args.Keys.Single();
         var item = unitOfWork.GetObjectByKey <Issue>(key);
         unitOfWork.Delete(item);
         unitOfWork.CommitChanges();
     }
 }
Ejemplo n.º 3
0
        void OnValidateRowDeletion(System.Object sender, DevExpress.Mvvm.Xpf.EditFormValidateRowDeletionArgs e)
        {
            var key     = (int)e.Keys.Single();
            var context = new DataClassesDataContext();
            var item    = context.Items.Single(x => x.Id == key);

            context.Items.DeleteOnSubmit(item);
            context.SubmitChanges();
        }
        void OnValidateRowDeletion(System.Object sender, DevExpress.Mvvm.Xpf.EditFormValidateRowDeletionArgs e)
        {
            var key  = (int)e.Keys.Single();
            var item = new Issue()
            {
                Id = key
            };
            var context = new IssuesContext();

            context.Entry(item).State = EntityState.Deleted;
            context.SaveChanges();
        }
        public void ValidateRowDeletion(DevExpress.Mvvm.Xpf.EditFormValidateRowDeletionArgs args)
        {
            var key  = (int)args.Keys.Single();
            var item = new Issue()
            {
                Id = key
            };
            var context = new IssuesContext();

            context.Entry(item).State = EntityState.Deleted;
            context.SaveChanges();
        }