public void editStanowisko(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strz = new StrzelnicaEntities())
            {
                int        id         = (int)ESStanNum.Value;
                STANOWISKA stanowisko = strz.STANOWISKA.Find(id);

                if (!ESKuloGrid.SelectedCells[0].RowIndex.Equals(null))
                {
                    stanowisko.KULOCHWYT = ESKuloGrid.SelectedCells[0].RowIndex;
                }

                if (!ESOdleNum.Value.Equals(null))
                {
                    stanowisko.ODLEGLOSC_OD_CELU = (int)ESOdleNum.Value;
                }

                if (!ESCenaNum.Value.Equals(null))
                {
                    stanowisko.CENA_WYNAJMU = ESCenaNum.Value;
                }

                strz.SaveChanges();
                this.Close();
            }
        }
Exemple #2
0
        public void editKlient(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strz = new StrzelnicaEntities())
            {
                int     id     = (int)EKKlieNum.Value;
                KLIENCI klient = strz.KLIENCI.Find(id);

                if (EKImieBox.Text != "")
                {
                    klient.IMIE = EKImieBox.Text.ToUpper();
                }

                if (EKNazwiskoBox.Text != "")
                {
                    klient.NAZWISKO = EKNazwiskoBox.Text.ToUpper();
                }

                if (!EKKarnetGrid.SelectedCells[0].RowIndex.Equals(null))
                {
                    klient.ID_KARNETU = EKKarnetGrid.SelectedCells[0].RowIndex;
                }

                if (!EKWiekNum.Value.Equals(null))
                {
                    klient.WIEK = (int)EKWiekNum.Value;
                }

                strz.SaveChanges();
                this.Close();
            }
        }
Exemple #3
0
 public void RemoveKarner(object sender, EventArgs e)
 {
     using (StrzelnicaEntities strzelnicaEntities = new StrzelnicaEntities())
     {
         int id = dataGridView3.SelectedCells[0].RowIndex;
         strzelnicaEntities.KARNETY.Remove(strzelnicaEntities.KARNETY.Find(id));
         strzelnicaEntities.SaveChanges();
     }
 }
Exemple #4
0
 public void RemoveStanowisko(object sender, EventArgs e)
 {
     using (StrzelnicaEntities strzelnicaEntities = new StrzelnicaEntities())
     {
         int id = dataGridView4.SelectedCells[0].RowIndex;
         strzelnicaEntities.STANOWISKA.Remove(strzelnicaEntities.STANOWISKA.Find(id));
         strzelnicaEntities.SaveChanges();
     }
 }
Exemple #5
0
 public void RemoveBron(object sender, EventArgs e)
 {
     using (StrzelnicaEntities strzelnicaEntities = new StrzelnicaEntities())
     {
         int id = dataGridView5.SelectedCells[0].RowIndex;
         strzelnicaEntities.BRONIE.Remove(strzelnicaEntities.BRONIE.Find(id));
         strzelnicaEntities.SaveChanges();
     }
 }
Exemple #6
0
 public void RemoveWypozyczenie(object sender, EventArgs e)
 {
     using (StrzelnicaEntities strzelnicaEntities = new StrzelnicaEntities())
     {
         int id = dataGridView1.SelectedCells[0].RowIndex;
         strzelnicaEntities.WYPOZYCZENIA.Remove(strzelnicaEntities.WYPOZYCZENIA.Find(id));
         strzelnicaEntities.SaveChanges();
     }
 }
Exemple #7
0
        private void refreshGridBr(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strz = new StrzelnicaEntities())
            {
                List <BRONIE> bronie = strz.BRONIE.ToList();

                bRONIEBindingSource.DataSource = bronie;
                dataGridView5.DataSource       = bRONIEBindingSource;
            }
        }
Exemple #8
0
        private void refreshGridKa(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strz = new StrzelnicaEntities())
            {
                List <KARNETY> karnety = strz.KARNETY.ToList();

                kARNETYBindingSource.DataSource = karnety;
                dataGridView3.DataSource        = kARNETYBindingSource;
            }
        }
Exemple #9
0
        private void refreshGridTr(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strz = new StrzelnicaEntities())
            {
                List <TRENERZY> trenerzy = strz.TRENERZY.ToList();

                tRENERZYBindingSource.DataSource = trenerzy;
                dataGridView2.DataSource         = tRENERZYBindingSource;
            }
        }
Exemple #10
0
        private void refreshGridKl(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strz = new StrzelnicaEntities())
            {
                List <KLIENCI> Klienci = strz.KLIENCI.ToList();

                kLIENCIBindingSource.DataSource = Klienci;
                dataGridView1.DataSource        = kLIENCIBindingSource;
            }
        }
Exemple #11
0
        private void refreshGridWyp(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strz = new StrzelnicaEntities())
            {
                List <WYPOZYCZENIA> wypożyczenia = strz.WYPOZYCZENIA.ToList();

                wYPOZYCZENIABindingSource.DataSource = wypożyczenia;
                dataGridView6.DataSource             = wYPOZYCZENIABindingSource;
            }
        }
Exemple #12
0
        private void refreshGridSt(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strz = new StrzelnicaEntities())
            {
                List <STANOWISKA> stanowiska = strz.STANOWISKA.ToList();

                sTANOWISKABindingSource.DataSource = stanowiska;
                dataGridView4.DataSource           = sTANOWISKABindingSource;
            }
        }
Exemple #13
0
        public void insertNewTrener(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strzelnicaEntities = new StrzelnicaEntities())
            {
                TRENERZY trener = new TRENERZY()
                {
                    IMIE     = NTImieText.Text.ToUpper(),
                    NAZWISKO = NTNazwiskoText.Text.ToUpper(),
                };

                strzelnicaEntities.TRENERZY.Add(trener);
                strzelnicaEntities.SaveChanges();
            }
        }
Exemple #14
0
        public void insertNewkARNET(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strzelnicaEntities = new StrzelnicaEntities())
            {
                KARNETY karnet = new KARNETY()
                {
                    RODZAJ_KARNETU = NKGrid.SelectedCells[0].RowIndex,
                    DATA_WAZNOSCI  = NKDate.Value,
                };

                strzelnicaEntities.KARNETY.Add(karnet);
                strzelnicaEntities.SaveChanges();
            }
        }
Exemple #15
0
        public void insertNewKlient(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strzelnicaEntities = new StrzelnicaEntities())
            {
                KLIENCI Klient = new KLIENCI()
                {
                    IMIE     = NKImieText.Text.ToUpper(),
                    NAZWISKO = NKNazwiskoText.Text.ToUpper(),
                    WIEK     = (int)NKWiekNum.Value
                };

                strzelnicaEntities.KLIENCI.Add(Klient);
                strzelnicaEntities.SaveChanges();
            }
        }
Exemple #16
0
        public void insertNewStanowisko(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strzelnicaEntities = new StrzelnicaEntities())
            {
                STANOWISKA stanowisko = new STANOWISKA()
                {
                    KULOCHWYT         = NSKuloGrid.SelectedCells[0].RowIndex,
                    ODLEGLOSC_OD_CELU = (int)NSOdlegNum.Value,
                    CENA_WYNAJMU      = NSCenaNum.Value
                };

                strzelnicaEntities.STANOWISKA.Add(stanowisko);
                strzelnicaEntities.SaveChanges();
            }
        }
Exemple #17
0
        public void insertNewBron(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strzelnicaEntities = new StrzelnicaEntities())
            {
                BRONIE bron = new BRONIE
                {
                    PRODUCENT         = NBProdText.Text.ToUpper(),
                    MODEL             = NBModText.Text.ToUpper(),
                    TYP               = NBTypGrid.SelectedCells[0].RowIndex,
                    AMUNICJA          = NBAmuGrid.SelectedCells[0].RowIndex,
                    CENA_WYPOZYCZENIA = NBCenaNum.Value
                };

                strzelnicaEntities.BRONIE.Add(bron);
                strzelnicaEntities.SaveChanges();
            }
        }
Exemple #18
0
        public void insertNewWypo(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strzelnicaEntities = new StrzelnicaEntities())
            {
                WYPOZYCZENIA wypo = new WYPOZYCZENIA()
                {
                    ID_KLIENTA              = NWKlieGrid.SelectedCells[0].RowIndex,
                    ID_TRENERA              = NWTreGrid.SelectedCells[0].RowIndex,
                    ID_STANOWISKA           = NWStaGrid.SelectedCells[0].RowIndex,
                    ID_BRONI                = NWBroGrid.SelectedCells[0].RowIndex,
                    ILOSC_PAKIETOW_AMUNICJI = (int)NWAmoNum.Value,
                    DATA_POCZATEK           = NWDatPoczPick.Value,
                    DATA_KONIEC             = NWDatKonPick.Value
                };

                strzelnicaEntities.WYPOZYCZENIA.Add(wypo);
                strzelnicaEntities.SaveChanges();
            }
        }
Exemple #19
0
        public void editKarnet(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strz = new StrzelnicaEntities())
            {
                int     id     = (int)EKWybNum.Value;
                KARNETY karnet = strz.KARNETY.Find(id);

                if (!EKRodzajGrid.SelectedCells[0].RowIndex.Equals(null))
                {
                    karnet.RODZAJ_KARNETU = EKRodzajGrid.SelectedCells[0].RowIndex;
                }

                if (EKDataPick.Value != null)
                {
                    karnet.DATA_WAZNOSCI = EKDataPick.Value;
                }

                strz.SaveChanges();
                this.Close();
            }
        }
Exemple #20
0
        public void editTrener(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strz = new StrzelnicaEntities())
            {
                int      id     = (int)ETWybNum.Value;
                TRENERZY trener = strz.TRENERZY.Find(id);

                if (ETImieText.Text != "")
                {
                    trener.IMIE = ETImieText.Text.ToUpper();
                }

                if (ETNazwiskoText.Text != "")
                {
                    trener.NAZWISKO = ETNazwiskoText.Text.ToUpper();
                }


                strz.SaveChanges();
                this.Close();
            }
        }
Exemple #21
0
        public void editBron(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strz = new StrzelnicaEntities())
            {
                int    id     = (int)EBWybNum.Value;
                BRONIE bronie = strz.BRONIE.Find(id);

                if (EBAmuGrid.SelectedCells[0].RowIndex.Equals(null))
                {
                    bronie.AMUNICJA = EBAmuGrid.SelectedCells[0].RowIndex;
                }

                if (EBProdText.Text != "")
                {
                    bronie.PRODUCENT = EBProdText.Text;
                }

                if (EBModText.Text != "")
                {
                    bronie.MODEL = EBModText.Text;
                }

                if (!EBTypGrid.SelectedCells[0].RowIndex.Equals(null))
                {
                    bronie.TYP = EBTypGrid.SelectedCells[0].RowIndex;
                }

                if (!EBCenaNum.Value.Equals(null))
                {
                    bronie.CENA_WYPOZYCZENIA = EBCenaNum.Value;
                }

                strz.SaveChanges();
                this.Close();
            }
        }
Exemple #22
0
        private void editKlient(object sender, EventArgs e)
        {
            using (StrzelnicaEntities strz = new StrzelnicaEntities())
            {
                int          id           = (int)EWWybNum.Value;
                WYPOZYCZENIA wypozyczenia = strz.WYPOZYCZENIA.Find(id);

                if (!EWKlieGrid.SelectedCells[0].RowIndex.Equals(null))
                {
                    wypozyczenia.ID_KLIENTA = EWKlieGrid.SelectedCells[0].RowIndex;
                }

                if (!EWTrenGrid.SelectedCells[0].RowIndex.Equals(null))
                {
                    wypozyczenia.ID_TRENERA = EWTrenGrid.SelectedCells[0].RowIndex;
                }

                if (!EWStanGrid.SelectedCells[0].RowIndex.Equals(null))
                {
                    wypozyczenia.ID_STANOWISKA = EWStanGrid.SelectedCells[0].RowIndex;
                }

                if (EWBronGrid.SelectedCells[0].RowIndex.Equals(null))
                {
                    wypozyczenia.ID_BRONI = EWBronGrid.SelectedCells[0].RowIndex;
                }

                if (!EWIloscNum.Value.Equals(null))
                {
                    wypozyczenia.ILOSC_PAKIETOW_AMUNICJI = (int)EWIloscNum.Value;
                }

                strz.SaveChanges();
                this.Close();
            }
        }