Ejemplo n.º 1
0
 private async void SaveFunc()
 {
     if (!NameText.Equals("") && !BiographyText.Equals(""))
     {
         using (var db = new PrototypingContext())
         {
             User findUser = db.Users.Single(u => u.UserId == user.UserId);
             findUser.Name      = NameText;
             findUser.Biography = BiographyText;
             db.Users.Update(findUser);
             db.SaveChanges();
         }
         GoBackFunc();
     }
     else
     {
         var message = new MessageDialog("Please fill in all the fields.");
         await message.ShowAsync();
     }
 }
Ejemplo n.º 2
0
 private async void CreateFunc()
 {
     if (!NameText.Equals("") && !BiographyText.Equals(""))
     {
         using (var db = new PrototypingContext())
         {
             db.Users.Add(new User()
             {
                 Name        = NameText,
                 Biography   = BiographyText,
                 AddedDate   = DateTime.Now,
                 PrototypeId = prototypeId
             });
             db.SaveChanges();
         }
         GoBackFunc();
     }
     else
     {
         var message = new MessageDialog("Please fill in all the fields.");
         await message.ShowAsync();
     }
 }