예제 #1
0
 public static bool inserir(AvatarView item)
 {
     try
     {
         App thisApp = Application.Current as App;
         thisApp.LINDADB.AvatarItems.InsertOnSubmit(item);
         thisApp.LINDADB.SubmitChanges();
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message, "Erro", MessageBoxButton.OK);
         return(false);
     }
     return(true);
 }
예제 #2
0
 public static bool Alterar(AvatarView av)
 {
     try
     {
         AvatarView update = (from com in App.Current.LINDADB.AvatarItems
                              where com.Id == av.Id
                              select com).First();
         update.Name   = av.Name;
         update.Avatar = av.Avatar;
         App.Current.LINDADB.SubmitChanges();
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }