private void button1_Click(object sender, EventArgs e) { Console.WriteLine(this.textBox1.Text); Console.WriteLine(this.textBox2.Text); LocalStore.currentUser = DatabaseAPI.SelectUser(this.textBox1.Text); if (LocalStore.currentUser == null) { Console.WriteLine("Invalid username."); label3.Text = "Invalid username!"; this.textBox1.Text = ""; this.textBox2.Text = ""; } else { label3.Text = ""; string hashedPassword = sha256(this.textBox2.Text); if (LocalStore.currentUser.Password == hashedPassword) { FormStorer.Add("Dashboard", new Dashboard()); FormStorer.Get("Login").Visible = false; ((Dashboard)FormStorer.Get("Dashboard")).SetCurrentUser(); FormStorer.Get("Dashboard").Visible = true; } else { Console.WriteLine("Invalid password."); label3.Text = "Invalid password!"; this.textBox1.Text = ""; this.textBox2.Text = ""; } } }
private void button5_Click(object sender, EventArgs e) { this.Visible = false; TicketsPanel next = new TicketsPanel(); FormStorer.Add("TicketsPanel", next); next.HandlePlayerRole(); next.Visible = true; }
private void button3_Click(object sender, EventArgs e) { LocalStore.LoadUsersFromDB(); this.Visible = false; FormStorer.Add("CreateTicket", new CreateTicket()); FormStorer.Get("CreateTicket").Visible = true; // LocalStore.LoadTicketsFromDB(LocalStore.currentUser.Username); }
private void button2_Click(object sender, EventArgs e) { LocalStore.LoadUsersFromDB(); this.Visible = false; FormStorer.Add("UserPanel", new UserPanel()); ((UserPanel)FormStorer.Get("UserPanel")).LoadUsersInForm(); FormStorer.Get("UserPanel").Visible = true; }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); FormStorer.Add("Login", new Login()); Database.Instance().SetConnection("C:\\Madalin\\TicketManager\\database.mdf"); Database.Instance().ExecuteQueryFromFile("..\\..\\PopulateUsersTable.sql"); Database.Instance().ExecuteQueryFromFile("..\\..\\PopulateTicketsTable.sql"); ArrayList users = DatabaseAPI.SelectUsers(); foreach (User u in users) { Console.Write(u); } DatabaseAPI.SelectTickets(); Application.Run(FormStorer.Get("Login")); }
private void button1_Click(object sender, EventArgs e) { FormStorer.Pop(); FormStorer.Peek().Visible = true; this.Visible = false; }