private void EnsureNonNullPerson() { Person p = DataContext as Person; if (p == null) { p = Ctors.NewPerson((string)txtBxName.Content, (string)txtBxEmail.Content); } }
private void EnsureNonNullPerson() { Person p = DataContext as Person; if (p == null) { p = Ctors.NewPerson(txtBxName.Text, txtBxEmail.Text); } }
public static void EnsureModerExists() { var ctx = PublicBoardCtx.Get(); var q = from p in ctx.Person where p.Name.IndexOf(MODER_SUBNAME) != -1 select p; if (q.Count() == 0) { ctx.AddToPerson(Ctors.NewPerson("moderator", "moder-mail")); ctx.SaveChanges(); } }
private void btnAdd_Click(object sender, RoutedEventArgs e) { persons.Add(Ctors.NewPerson("New user", "email")); changesExist = true; }