private void Button_Click(object sender, RoutedEventArgs e) { if (index == 0) { name = MahiberName.Text.ToString(); description = Description.Text.ToString(); thirdPage = new ThirdPage(); MainContent.Children.Clear(); MainContent.Children.Add(thirdPage); thirdPage.Initialize(name, description); index++; } else if (index == 1) { thirdPage.returner(); finalPage = new FinalPage(); MainContent.Children.Clear(); MainContent.Children.Add(finalPage); cont_btn.Text = "Create Super Admin"; index++; } else if (index == 2) { thirdPage.FinishBtn_Click(); user = new UserAccount(); user.Username = finalPage.username.Text.ToString(); user.Password = finalPage.password.Password; user.RoleId = 1; _context.UserAccounts.Add(user); _context.SaveChanges(); } }
private void NextBtn_Click(object sender, RoutedEventArgs e) { if (index == 0) { info = essentials.save(); this.EdirName = info[0]; this.Description = info[1]; MainContent.Children.Clear(); MainContent.Children.Add(nextPage); index = 1; } else if (index == 1) { try { payments = nextPage.Save(); this.PayMem = payments[0]; this.PaySib = payments[1]; this.PayChild = payments[2]; this.PayParent = payments[3]; this.EventFin = payments[4]; } catch (Exception) { this.PayMem = this.PaySib = this.PayChild = this.PayParent = this.EventFin = 0; } MainContent.Children.Clear(); MainContent.Children.Add(thirdPage); thirdPage.Initialize(EdirName, Description, PayMem, PaySib, PayChild, PayParent, EventFin); index = 2; NextBtn.Visibility = Visibility.Hidden; } }