예제 #1
0
        private void Realizuj_Click(object sender, RoutedEventArgs e)
        {
            using (AptekaDataDataContext con = new AptekaDataDataContext())
            {

                //try
               // {
                    Dostawa dost = new Dostawa();
                    Lek lektmp = new Lek();
                    dost.Data_zam = DateTime.Today;
                    dost.Data_realizacji = DateTime.Today;
                    con.Dostawas.InsertOnSubmit(dost);
                    con.SubmitChanges();
                    for (int i = 0; i <= ile - 1; i++)
                    {
                        lektmp = (from l in con.Leks where l.LekID == lista[i].lekitem.LekID select l).FirstOrDefault();
                        lektmp.Ilosc = lektmp.Ilosc + lista[i].ile;
                        con.SubmitChanges();
                        Dost_ilosc di = new Dost_ilosc();
                        di.LekID = lista[i].lekitem.LekID;
                        di.DostawaID = dost.DostawaID;
                        di.Ilosc = lista[i].ile;
                        con.Dost_iloscs.InsertOnSubmit(di);
                        con.SubmitChanges();
                    }
                    MessageBox.Show("Dostawa została zrealizowana!");
                    DialogResult = true;
               /* }
                catch
                {
                    MessageBox.Show("Wystapił bląd pod czas łaczenia sie z bazą!");
                    DialogResult = false;
                }*/
            }
        }
예제 #2
0
		private void detach_Dost_iloscs(Dost_ilosc entity)
		{
			this.SendPropertyChanging();
			entity.Dostawa = null;
		}
예제 #3
0
		private void attach_Dost_iloscs(Dost_ilosc entity)
		{
			this.SendPropertyChanging();
			entity.Dostawa = this;
		}
예제 #4
0
 partial void DeleteDost_ilosc(Dost_ilosc instance);
예제 #5
0
 partial void UpdateDost_ilosc(Dost_ilosc instance);
예제 #6
0
 partial void InsertDost_ilosc(Dost_ilosc instance);