Пример #1
0
        public void Delete(int ID)
        {
            JurnalRabot pac = db5.JurnalRabot.Where(c => c.ID == ID).FirstOrDefault();

            db5.JurnalRabot.DeleteOnSubmit(pac);
            db5.SubmitChanges();
            var ec = from n in db2.IspolOborud
                     where n.IDRabot == ID
                     select n;

            foreach (var i in ec)
            {
                IspolOborud pac2 = db2.IspolOborud.Where(c => c.IDRabot == ID).FirstOrDefault();
                db2.IspolOborud.DeleteOnSubmit(pac2);
                db2.SubmitChanges();
            }
            var ec2 = from n in db2.IspolOborud
                      where n.IDRabot == ID
                      select n;

            foreach (var i in ec2)
            {
                IspolPabot pac3 = db3.IspolRabot.Where(c => c.IDRabot == ID).FirstOrDefault();
                db3.IspolRabot.DeleteOnSubmit(pac3);
                db3.SubmitChanges();
            }
        }
Пример #2
0
        public void Edit(int ID, int IDZapisi, int Cena, int Skidka, int Itog)
        {
            JurnalRabot pac = db5.JurnalRabot.Where(c => c.ID == ID).FirstOrDefault();

            pac.IDZapisi = IDZapisi;
            pac.Cena     = Cena;
            pac.Skidka   = Skidka;
            pac.Itog     = Itog;
            db5.SubmitChanges();
        }
Пример #3
0
        public void ADD(int IDZapisi, int Cena, int Skidka, int Itog)
        {
            JurnalRabot pac = new JurnalRabot();

            pac.IDZapisi = IDZapisi;
            pac.Cena     = Cena;
            pac.Skidka   = Skidka;
            pac.Itog     = Itog;
            db5.JurnalRabot.InsertOnSubmit(pac);
            db5.SubmitChanges();
        }