private void btnLogin_Click(object sender, EventArgs e) { var context = new OLXDataContext(); string email = tboxEmail.Text; string hash = Program.makeHash(tboxPassword.Text); if (LoginPageTRANSACTION(email, hash) == true) { MessageBox.Show("Esti logat!"); Program.OLXusername = email; if (actiune == "ADD") { AddAnunt a = new AddAnunt(); a.Show(); } if (actiune == "FAV") { context.spAddToFavorite(Program.OLXusername, anunt); } if (actiune == "CHAT") { CasutaChat c = new CasutaChat(Program.OLXusername, corespondent); c.Show(); } this.Close(); OLX.MainPage.load_LogOutButton(); } }
private void AddAnunt_Click(object sender, EventArgs e) { var dbContext = new OLXDataContext(); var result = from u in dbContext.DB_USERs where u.ID == Program.OLXusername select u.ID; List <string> t = new List <string>(); foreach (var item in result) { t.Add(item.ToString()); } if (t.Count != 0)//e in DB_USERS { AddAnunt a = new AddAnunt(); a.Show(); } else { Login l = new Login("ADD"); l.Show(); } }