예제 #1
0
 private void iconButtonEdytujDane_Click(object sender, EventArgs e)
 {
     _form.ActivateButton(_form.iconButtonAccount);
     _form.OpenChildForm(new FormEditProfile(_form));
     _form.labelTitleChildForm.Text = "Edycja profilu";
     _form.iconButtonAccount.Text   = "Konto";
 }
예제 #2
0
 private void iconButtonWroc_Click(object sender, EventArgs e)
 {
     _form.ActivateButton(_form.iconButtonAccount);
     _form.OpenChildForm(new FormProfile(_form));
     _form.labelTitleChildForm.Text = "Profil użytkownika";
     _form.iconButtonAccount.Text   = "Konto";
 }
예제 #3
0
 private void iconButtonWroc_Click(object sender, EventArgs e)
 {
     _form.ActivateButton(_form.iconButtonAccount);
     _form.OpenChildForm(new FormSeller(_form));
     _form.labelTitleChildForm.Text = "Panel sprzedawcy";
     _form.iconButtonAccount.Text   = "Konto";
 }
예제 #4
0
 private void iconButtonWroc_Click(object sender, EventArgs e)
 {
     _form.ActivateButton(_form.iconButtonAccount);
     _form.OpenChildForm(new FormLogIn(_form));
     _form.labelTitleChildForm.Text = "Zaloguj";
     _form.iconButtonAccount.Text   = "Zaloguj";
 }
예제 #5
0
        private void DodajDoKoszyka_Click(object sender, EventArgs e)
        {
            Button btn       = (Button)sender;
            string idProdukt = btn.Name.Replace("iconButton", "");

            products.Add(int.Parse(idProdukt));
            produktyWKoszyku = products;
            DialogResult result = MessageBox.Show("Pomyslnie dodano do koszyka, chcesz kontynuowac zakupy?", "Potwierdzenie", MessageBoxButtons.YesNo, MessageBoxIcon.Information);

            if (result == DialogResult.No)
            {
                _form.ActivateButton(_form.iconButtonCart);
                _form.OpenChildForm(new FormCart(products, _form));
                _form.labelTitleChildForm.Text = "Koszyk";
            }
        }
예제 #6
0
        public void Zaloguj(string login, string haslo)
        {
            Uzytkownik uzytkownik = new Uzytkownik();

            BazaTableAdapters.UzytkownikTableAdapter tableadapterUzytkownik = new BazaTableAdapters.UzytkownikTableAdapter();
            Baza.UzytkownikDataTable tableUzytkownik = new Baza.UzytkownikDataTable();

            foreach (Baza.UzytkownikRow row in tableadapterUzytkownik.GetData().Rows)
            {
                string[] elementy = row.UserLogin.Split('|');
                if (elementy[0] == login && row.UserHaslo.Trim() == haslo)
                {
                    tableadapterUzytkownik.GetUser(tableUzytkownik, row.UserLogin, haslo);
                    foreach (Baza.UzytkownikRow item in tableUzytkownik.Rows)
                    {
                        uzytkownik._login     = login;
                        uzytkownik._haslo     = item.UserHaslo;
                        uzytkownik._isAdmin   = item.UserAdmin;
                        uzytkownik._isSeller  = item.UserSprzedawca;
                        uzytkownik._IDAddress = item.IsUserAdrIDNull() ? -1 : item.UserAdrID;
                    }
                }
            }
            if (uzytkownik._login != null)
            {
                if (uzytkownik._isAdmin == true)
                {
                    _form.isAdmin = true;
                }
                if (uzytkownik._isSeller == true)
                {
                    _form.isSeller = true;
                }

                _form.isLoggedIn = true;
                _form.ActivateButton(_form.iconButtonShop);
                _form.OpenChildForm(new FormShop(_form));
                _form.labelTitleChildForm.Text = "Sklep";
                _form.iconButtonAccount.Text   = " Konto";
                _form.login = login;
            }
            else
            {
                MessageBox.Show("Podano błędne dane", "Uwaga!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
예제 #7
0
 private void dataGridViewZamowienia_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex != -1)
     {
         int idZamowienia = int.Parse(dataGridViewZamowienia.Rows[e.RowIndex].Cells[0].Value.ToString().Trim());
         _form.ActivateButton(_form.iconButtonOrders);
         _form.OpenChildForm(new FormOrderDetails(_form, idZamowienia));
         _form.labelTitleChildForm.Text = "Szczegoly zamowienia";
     }
 }
예제 #8
0
 private void iconButtonWroc_Click(object sender, EventArgs e)
 {
     _form.ActivateButton(_form.iconButtonOrders);
     _form.OpenChildForm(new FormOrders(_form));
     _form.labelTitleChildForm.Text = "Zamówienia";
 }
예제 #9
0
 private void iconButtonWroc_Click(object sender, EventArgs e)
 {
     _form.ActivateButton(_form.iconButtonShop);
     _form.OpenChildForm(new FormShop(_form));
     _form.labelTitleChildForm.Text = "Sklep";
 }