예제 #1
0
        static void Main(string[] args)
        {
            Osoba o1 = new Osoba("Jan", "Kowalski", 1988, Plec.Mezczyzna);

            Console.WriteLine("Utworzyłeś osobę: {0}",
                              o1.ZwrocInformacje());
            Student s1 = new Student("Tomasz", "Nowak", 1989, Plec.Mezczyzna, 1234);

            Console.WriteLine("Utworzyłeś studenta: {0}",
                              s1.ZwrocInformacje());
            Stypendysta st1 = new Stypendysta("Joanna", "Zielińska", 1987, Plec.Kobieta, 1235, 500);

            Console.WriteLine("Utworzyłeś stypendystę: {0}",
                              st1.ZwrocInformacje());
            Wykladowca w1 = new Wykladowca("Maria", "Skłodowska-Curie", 1867, Plec.Kobieta, Wykladowca.Tytuly.prof);

            Console.WriteLine("Urworzyłeś wykładowcę: {0}",
                              w1.ZwrocInformacje());
            Console.ReadKey();

            Osoba o2 = s1, o3 = st1, o4 = w1;

            Console.WriteLine("Urworzyłeś osobę: {0}", o2.ZwrocInformacje());
            Console.WriteLine("Urworzyłeś osobę: {0}", o3.ZwrocInformacje());
            Console.WriteLine("Urworzyłeś osobę: {0}", o4.ZwrocInformacje());
        }
예제 #2
0
        public AddNewPrzedmiotVM()
        {
            ExecuteAddPrzedmiotCommand     = new Commanding(AddPrzedmiotCommand, CanAddPrzedmiotCommand);
            ExecuteAddPrzedmiotNameCommand = new Commanding(AddPrzedmiotNameCommand, CanAddPrzedmiotNameCommand);
            ExecuteAddTypCommand           = new Commanding(AddTypNameCommand, CanAddTypNameCommand);
            ExecuteAddWykladowca           = new Commanding(AddWykladowcaCommand, CanAddWykladowcaCommand);

            TypName        = Typ_Zajec.GetZajecias();
            PrzedmiotName  = Przedmiot.GetPrzedmiotsNames();
            WykladowcaName = Wykladowca.GetWykladowcas();
        }
예제 #3
0
        public RegistrationLyricsVM(Guid idGrupa, Guid idSemestr)
        {
            _idGrupa   = idGrupa;
            _idSemestr = idSemestr;
            ExecuteAddPrzedmiotCommand         = new Commanding(AddPrzedmiotCommand, CanAddPrzedmiotCommand);
            ExecuteAddPrzedmiotContinueCommand = new Commanding(AddPrzedmiotAndContinueCommand, CanAddPrzedmiotAndContinueCommand);
            ExecuteAddPrzedmiotNameCommand     = new Commanding(AddPrzedmiotNameCommand, CanAddPrzedmiotNameCommand);
            ExecuteAddTypCommand        = new Commanding(AddTypNameCommand, CanAddTypNameCommand);
            ExecuteAddWykladowcaCommand = new Commanding(AddWykladowcaCommand, CanAddWykladowcaCommand);

            TypName        = Typ_Zajec.GetZajecias();
            PrzedmiotName  = Przedmiot.GetPrzedmiotsNames();
            WykladowcaName = Wykladowca.GetWykladowcas();
        }
예제 #4
0
        private void AddWykladowcaCommand(object parameter)
        {
            DataClasses1DataContext context = new DataClasses1DataContext();

            var wykladowca = new Wykladowca
            {
                Wykladowca_Imie     = _wykladowcaImie,
                Wykladowca_Nazwisko = _wykladowcaNazwisko,
                Wykladowca_E_Mail   = _email,
                Wykladowca_Telefon  = _telefon
            };

            context.Wykladowcas.InsertOnSubmit(wykladowca);
            context.SubmitChanges();

            Window frm = (Window)parameter;

            frm.Close();
        }
예제 #5
0
        private void dodaj_przedmiot()
        {
            DataClasses1DataContext context = new DataClasses1DataContext();

            Guid      idWykladowcy     = Wykladowca.FindWykladowcaIdByName(_selectedWykladowca);
            Guid      idTyp            = Typ_Zajec.FindZajeciasIdByName(_selectedTyp);
            Guid      PrzedmiotNazwaId = Przedmiot.FindPrzedmiotNazwaIdByNazwa(_selectedPrzedmiot);
            Przedmiot przedmiotExist   = Przedmiot.CheckPrzedmiotExist(idTyp, idWykladowcy, PrzedmiotNazwaId);

            if (przedmiotExist == null)
            {
                var newPrzedmiot = new Przedmiot
                {
                    Id_PrzedmiotNazwa = PrzedmiotNazwaId,
                    Id_Typ_Zajec      = idTyp,
                    PunktyETCS        = Convert.ToInt32(_punktyETCS),
                    Godziny           = Convert.ToInt32(_liczbaGodzin),
                    Id_Wykladowcy     = idWykladowcy
                };
                przedmiotExist = newPrzedmiot;
                context.Przedmiots.InsertOnSubmit(przedmiotExist);
                context.SubmitChanges();
            }

            if (!Semestr.CheckPrzedmiotExistInSemester(_idSemestr, _idGrupa, przedmiotExist.Id_Przedmiot))
            {
                var grupaPrzedmiotSemestr = new GrupaSemestrPrzedmiot
                {
                    Id_Grupa     = _idGrupa,
                    Id_Semestr   = _idSemestr,
                    Id_Przedmiot = przedmiotExist.Id_Przedmiot
                };
                context.GrupaSemestrPrzedmiots.InsertOnSubmit(grupaPrzedmiotSemestr);
                context.SubmitChanges();
            }
            else
            {
                MessageBox.Show("Przedmiot jest już na liście", "Uwaga", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
예제 #6
0
        private void AddPrzedmiotCommand(object parameter)
        {
            DataClasses1DataContext context = new DataClasses1DataContext();

            Guid idTyp            = Typ_Zajec.FindZajeciasIdByName(_selectedTyp);
            Guid idPrzedmiotNazwa = Przedmiot.FindPrzedmiotNazwaIdByNazwa(_selectedPrzedmiot);
            Guid idWykladowca     = Wykladowca.FindWykladowcaIdByName(_selectedWykladowca);
            var  przedmiot        = new Przedmiot
            {
                Id_PrzedmiotNazwa = idPrzedmiotNazwa,
                Id_Typ_Zajec      = idTyp,
                Godziny           = Convert.ToInt32(_liczbaGodzin),
                PunktyETCS        = Convert.ToInt32(_punktyETCS),
                Id_Wykladowcy     = idWykladowca
            };

            context.Przedmiots.InsertOnSubmit(przedmiot);
            context.SubmitChanges();

            Window frm = (Window)parameter;

            frm.Close();
        }
 private Wykladowca createWykladowca()
 {
     Wykladowca ret = new Wykladowca();
     return ret;
 }
예제 #8
0
    private Wykladowca createWykladowca()
    {
        Wykladowca ret = new Wykladowca();

        return(ret);
    }