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(); } }
private async void SaveFunc() { if (!UrlText.Equals("") && !NameText.Equals("") && !DescriptionText.Equals("")) { using (var db = new PrototypingContext()) { Prototype findPrototype = db.Prototypes.Single(p => p.PrototypeId == prototype.PrototypeId); findPrototype.Url = UrlText; findPrototype.Name = NameText; findPrototype.Description = DescriptionText; db.Prototypes.Update(findPrototype); db.SaveChanges(); } GoBackFunc(); } else { var message = new MessageDialog("Please fill in all the fields."); await message.ShowAsync(); } }
private async void CreateFunc() { if (!UrlText.Equals("") && !NameText.Equals("") && !DescriptionText.Equals("")) { using (var db = new PrototypingContext()) { db.Prototypes.Add(new Prototype() { Name = NameText, Url = UrlText, Description = DescriptionText, CreatedDate = DateTime.Now }); db.SaveChanges(); } GoBackFunc(); } else { var message = new MessageDialog("Please fill in all the fields."); await message.ShowAsync(); } }
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(); } }