예제 #1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            int broj = Convert.ToInt32(tb_sifraRacuna.Text);
            ServisRacunaraDataContext DC = new ServisRacunaraDataContext();
            RacunVlasnika             rc = (from x in DC.RacunVlasnikas where x.sifraRacuna == broj select x).SingleOrDefault();

            DC.RacunVlasnikas.DeleteOnSubmit(rc);
            DC.SubmitChanges();

            MessageBox.Show("Racuna je uspesno obrisan!", "Obavestenje", MessageBoxButton.OK, MessageBoxImage.Information);
            this.Close();
        }
예제 #2
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            bool pom = false;

            ServisRacunaraDataContext DC = new ServisRacunaraDataContext();

            try
            {
                RacunVlasnika rv = new RacunVlasnika();

                rv.sifraNaloga = Convert.ToInt32(cb.SelectedValue.ToString());
                rv.radnik      = tb_imeRadnika.Text;
                rv.vreme       = tb_vreme.Text;

                rv.imePrezime = tb_imePrezime.Text;
                rv.brLicne    = Convert.ToInt32(tb_brLicne.Text);
                rv.telefon    = tb_telefon.Text;
                rv.mail       = tb_mail.Text;
                rv.sifraRac   = tb_sifRacunara.Text;

                rv.opisKva     = new TextRange(rtb_opisKvara.Document.ContentStart, rtb_opisKvara.Document.ContentEnd).Text;
                rv.spisPoslova = new TextRange(rtb_SpisakPoslova.Document.ContentStart, rtb_SpisakPoslova.Document.ContentEnd).Text;
                rv.rezDel      = new TextRange(rtb_SpisakRezDel.Document.ContentStart, rtb_SpisakRezDel.Document.ContentEnd).Text;


                rv.cenaDelova = tb_cenaDelova.Text;
                rv.cenaUsluga = tb_cenaUsluga.Text;
                rv.cenaUkupna = tb_ukupnaCena.Text;

                DC.RacunVlasnikas.InsertOnSubmit(rv);
                DC.SubmitChanges();
                pom = true;
            }
            catch (Exception)
            {
                MessageBox.Show("Doslo je do greskee!");
            }
            if (pom)
            {
                MessageBox.Show("Uspesno ste kreirali racun!", "Obavestenje", MessageBoxButton.OK, MessageBoxImage.Information);
                this.Close();
            }
        }
예제 #3
0
 partial void DeleteRacunVlasnika(RacunVlasnika instance);
예제 #4
0
 partial void UpdateRacunVlasnika(RacunVlasnika instance);
예제 #5
0
 partial void InsertRacunVlasnika(RacunVlasnika instance);
예제 #6
0
 private void detach_RacunVlasnikas(RacunVlasnika entity)
 {
     this.SendPropertyChanging();
     entity.RadNalog = null;
 }