Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count == 0)
            {
                MessageBox.Show("Odaberite koordinatora");
                return;
            }

            int odId            = Int32.Parse(listView1.SelectedItems[0].SubItems[0].Text);
            KoordinatorBasic ob = DTOManager.GetKoordinatorBasic(odId);

            Izmena_Glasackog_Mesta edbForm = new Izmena_Glasackog_Mesta(ob);

            if (edbForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                //MessageBox.Show("snimanje podataka");
                DTOManager.UpdateKoordinatorBasic(edbForm.kBasic);
                PopulateInfos();
            }
        }
Exemple #2
0
        public static KoordinatorBasic GetKoordinatorBasic(int odId)
        {
            KoordinatorBasic ob = new KoordinatorBasic();

            try
            {
                ISession s = DataLayer.GetSession();

                Koordinator_Opstine o = s.Load <Koordinator_Opstine>(odId);
                ob = new KoordinatorBasic(o.Id, o.PratiGlasackoMesto.Naziv, o.PratiGlasackoMesto.Broj_biraca);

                s.Close();
            }
            catch (Exception ec)
            {
                //handle exceptions
            }

            return(ob);
        }
Exemple #3
0
        public static KoordinatorBasic UpdateKoordinatorBasic(KoordinatorBasic ob)
        {
            try
            {
                ISession s = DataLayer.GetSession();

                Koordinator_Opstine o = s.Load <Koordinator_Opstine>(ob.KoordinatorId);
                o.PratiGlasackoMesto.Naziv       = ob.Glasacko_Mesto_Naziv;
                o.PratiGlasackoMesto.Broj_biraca = ob.Glasacko_Mesto_Broj;

                s.Update(o);
                s.Flush();

                s.Close();
            }
            catch (Exception ec)
            {
                //handle exceptions
            }

            return(ob);
        }
 public Izmena_Glasackog_Mesta(KoordinatorBasic kb)
 {
     this.kBasic = kb;
     InitializeComponent();
     PopulateData();
 }