示例#1
0
        private void Back_Click(object sender, EventArgs e)
        {
            SellerWall sellerWall = new SellerWall(Seller);

            sellerWall.Show();
            Close();
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            SellerWall userWall = new SellerWall(Myseller);

            userWall.Show();
            Close();
        }
示例#3
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");
                }
            }
        }
示例#4
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         Business           newBusiness = new Business(BusinessName.Text, BusinessDescription.Text, System.Convert.ToInt32(Price.Text), System.Convert.ToInt32(Nkomnata.Text), Myseller.Name, Myseller.Dormitory, Myseller.Phone);
         BusinessRepository repository  = new BusinessRepository();
         if (repository.Add(newBusiness))
         {
             MessageBox.Show("Registering proccess was succesful");
             SellerWall wall = new SellerWall(Myseller);
             wall.Show();
             Close();
         }
         else
         {
             MessageBox.Show("We could't register");
         }
     }
     catch {
         MessageBox.Show("Please fill up the form correctly");
     }
 }