예제 #1
0
        private void AddCiagCommand(object parameter)
        {
            DataClasses1DataContext context = new DataClasses1DataContext();

            Guid idStopien = StopienStudiow.FindStupienStudiowIdByName(_selectedStopien);
            Guid idTyp     = TypStudiow.FindTypStudiowIdByName(_selectedTyp);

            string firstLetterOfStopien = _selectedStopien[0].ToString();
            string firstLetterOfTyp     = _selectedTyp[0].ToString();
            string ciagName             = firstLetterOfStopien.ToUpper() + firstLetterOfTyp.ToUpper();

            var ciag = new Ciag
            {
                Id_Stopien_Studiow = idStopien,
                Id_Typ_Studiow     = idTyp,
                Ciag_Nazwa         = ciagName,
            };

            context.Ciags.InsertOnSubmit(ciag);
            context.SubmitChanges();

            Window frm = (Window)parameter;

            frm.Close();
        }
예제 #2
0
 public AddCiagVM()
 {
     ExecuteAddCiagCommand = new Commanding(AddCiagCommand, CanAddCiagCommand);
     StopienStudiowNazwa   = StopienStudiow.GetStopienStudiows();
     TypStudiowNazwa       = TypStudiow.GetTypStudiows();
 }