Esempio n. 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();
        }
 partial void DeleteCiag(Ciag instance);
 partial void UpdateCiag(Ciag instance);
 partial void InsertCiag(Ciag instance);
		private void detach_Ciags(Ciag entity)
		{
			this.SendPropertyChanging();
			entity.TypStudiow = null;
		}
		private void attach_Ciags(Ciag entity)
		{
			this.SendPropertyChanging();
			entity.TypStudiow = this;
		}