private void LoginmetroButton_Click(object sender, EventArgs e)
 {
     UserInfo.UserID   = int.Parse(TxtUsernamemetroTextBox.Text);
     UserInfo.Password = TxtPasswordmetroTextBox.Text;
     try
     {
         if (ComUserTypemetroComboBox.Text == "Buyer")
         {
             if (EventHandler.LoginCheck(UserInfo.UserID, UserInfo.Password, "Buyer"))
             {
                 this.Hide();
                 BuyerForm ob = new BuyerForm();
                 ob.Show();
                 MetroMessageBox.Show(this, "Log in Success As a" + ComUserTypemetroComboBox.Text + "!!!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
         else if (ComUserTypemetroComboBox.Text == "Seller")
         {
             if (EventHandler.LoginCheck(UserInfo.UserID, UserInfo.Password, "Seller"))
             {
                 this.Hide();
                 SellerForm ob = new SellerForm();
                 ob.Show();
                 MetroMessageBox.Show(this, "Log in Success As a" + ComUserTypemetroComboBox.Text + "!!!!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch (Exception ex)
     {
         MetroMessageBox.Show(this, "Login Fail!!!!", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
     }
 }
        override protected void homeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            SellerForm ob = new SellerForm();

            ob.Show();
        }
        private void TilCatagorymetroTile_Click(object sender, EventArgs e)
        {
            this.Close();
            SellerForm ob = new SellerForm();

            ob.Show();
        }
Ejemplo n.º 4
0
        private void ButHomemetroButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            SellerForm ob = new SellerForm();

            ob.Show();
        }
Ejemplo n.º 5
0
        private void SellerAddToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            var form = new SellerForm();

            if (form.ShowDialog() == DialogResult.OK)
            {
                db.Sellers.Add(form.Seller);
                db.SaveChanges();
            }
        }
Ejemplo n.º 6
0
        private void Button2_Click(object sender, EventArgs e)
        {
            var id = dataGridView.SelectedRows[0].Cells[0].Value;

            if (typeof(T) == typeof(Product))
            {
                var product = set.Find(id) as Product;

                if (product != null)
                {
                    var form = new ProductForm(product);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        product = form.Product;
                        db.SaveChanges();
                        dataGridView.Update();
                    }
                }
            }
            else if (typeof(T) == typeof(Seller))
            {
                var seller = set.Find(id) as Seller;

                if (seller != null)
                {
                    var form = new SellerForm(seller);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        seller = form.Seller;
                        db.SaveChanges();
                        dataGridView.Update();
                    }
                }
            }
            else if (typeof(T) == typeof(Customer))
            {
                var customer = set.Find(id) as Customer;

                if (customer != null)
                {
                    var form = new CustomerForm(customer);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        customer = form.Customer;
                        db.SaveChanges();
                        dataGridView.Update();
                    }
                }
            }
        }