Esempio n. 1
0
        private void Back_Click(object sender, EventArgs e)
        {
            UserWall userWall = new UserWall(true, "Client", MyClient);

            userWall.Show();
            Close();
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (Client)
            {
                try
                {
                    Client Log_Client = new Client(UName.Text, 0, 0, "a", 0, "a", UPassword.Text, "Dormitory");

                    ClientRepository repository = new ClientRepository();

                    if (repository.FindById(Log_Client))
                    {
                        Log_Client.Construct();

                        UserWall myUserWall = new UserWall(Client, StrTextBox, Log_Client);

                        myUserWall.Show();

                        Close();
                    }
                    else
                    {
                        MessageBox.Show("Incorrect User Name or Password");
                    }
                }
                catch (Exception E) {
                    MessageBox.Show("Error:" + E);
                }
            }
            if (!Client)
            {
                try {
                    Seller log_Seller = new Seller(UName.Text, UPassword.Text, 0, 0, "a", 0, "Email", "Dormitory");

                    SellerRepository repository = new SellerRepository();

                    if (repository.FindById(log_Seller))
                    {
                        log_Seller.Construct();

                        SellerWall mySellerWall = new SellerWall(log_Seller);

                        mySellerWall.Show();

                        Close();
                    }
                    else
                    {
                        MessageBox.Show("Incorrect User Name or Password");
                    }
                }catch {
                    MessageBox.Show("Please fill up the forum correctly");
                }
            }
        }