Exemplo n.º 1
0
        public static void AddItemToListView(ListView lv, ProgramItem prog)
        {
            ListViewItem item = new ListViewItem(prog.Godina);

            item.SubItems.Add(prog.ImeMape);
            item.SubItems.Add(prog.VrstaPrograma);
            item.SubItems.Add(prog.IzvrsnaDatoteka);
            item.SubItems.Add(prog.OpisPrograma);

            lv.Items.Add(item);
        }
Exemplo n.º 2
0
        public static string GetDbfFolder(ProgramItem selectedProgram, Korisnik selectedKorisnik)
        {
            string dbfFolderName = "";

            if ((selectedProgram != null) && (selectedKorisnik != null))
            {
                dbfFolderName = selectedProgram.ImeMape + "\\" + selectedKorisnik.SifraKor;
            }

            return dbfFolderName;
        }
Exemplo n.º 3
0
        public static string GetDbfFolderKonta(ProgramItem selectedProgram, Korisnik selectedKorisnik)
        {
            string dbfKontaFolderName = "";

            if ((selectedProgram != null) && (selectedKorisnik != null))
            {

                if (selectedKorisnik.KontniPl == "Z")
                    dbfKontaFolderName = selectedProgram.ImeMape;
                else
                    dbfKontaFolderName = selectedProgram.ImeMape + "\\" + selectedKorisnik.SifraKor;

            }

            return dbfKontaFolderName;
        }
        public frmBrutoBilansPoGrupama(SortableSearchableList<BrutoBilans> bb, DateTime odDatuma, DateTime doDatuma, ProgramItem selectedProgram, Korisnik selectedKorisnik )
        {
            InitializeComponent();
            txtOdDatuma.Text = odDatuma.ToShortDateString();
            txtDoDatuma.Text = doDatuma.ToShortDateString();

            this.txtProgram.Text = selectedProgram.ImeMape;
            this.txtKorisnik.Text = selectedKorisnik.SifraKor + ": " + selectedKorisnik.NazivKor;
            this.selectedKorisnik = selectedKorisnik;

            brutoBilans = bb;

            brutoBilansDataGridView.Focus();

            cboGrupa.SelectedIndex = 0;
        }
Exemplo n.º 5
0
        public void FillStatusBar(ProgramItem selProgram)
        {
            if (selProgram != null)
            {
                toolStripStatusLabel1.Text = "Program je izabran";
                toolStripStatusLabel1.BorderSides = ToolStripStatusLabelBorderSides.Right;

                toolStripStatusLabel2.Text = selProgram.Godina;
                toolStripStatusLabel2.BorderSides = ToolStripStatusLabelBorderSides.Right;

                toolStripStatusLabel3.Text = selProgram.VrstaPrograma;
                toolStripStatusLabel3.BorderSides = ToolStripStatusLabelBorderSides.Right;

                toolStripStatusLabel4.Text = selProgram.ImeMape;
                toolStripStatusLabel4.BorderSides = ToolStripStatusLabelBorderSides.Right;

                toolStripStatusLabel5.Text = selProgram.IzvrsnaDatoteka;
                toolStripStatusLabel5.BorderSides = ToolStripStatusLabelBorderSides.Right;

                toolStripStatusLabel6.Text = selProgram.OpisPrograma;
                toolStripStatusLabel6.BorderSides = ToolStripStatusLabelBorderSides.Right;
            }
            else
            {
                toolStripStatusLabel1.Text = "Program nije izabran";
                toolStripStatusLabel1.BorderSides = ToolStripStatusLabelBorderSides.Right;

                toolStripStatusLabel2.Text = "";
                toolStripStatusLabel2.BorderSides = ToolStripStatusLabelBorderSides.None;

                toolStripStatusLabel3.Text = "";
                toolStripStatusLabel3.BorderSides = ToolStripStatusLabelBorderSides.None;

                toolStripStatusLabel4.Text = "";
                toolStripStatusLabel4.BorderSides = ToolStripStatusLabelBorderSides.None;

                toolStripStatusLabel5.Text = "";
                toolStripStatusLabel5.BorderSides = ToolStripStatusLabelBorderSides.None;

                toolStripStatusLabel6.Text = "";
                toolStripStatusLabel6.BorderSides = ToolStripStatusLabelBorderSides.None;
            }
        }
Exemplo n.º 6
0
        private void FormProgramItem()
        {
            prog = new ProgramItem();

            prog.Godina = cboGodina.Text;
            prog.ImeMape = txtImeMape.Text;
            prog.VrstaPrograma = cboVrstaPrograma.Text;
            prog.IzvrsnaDatoteka = txtIzvrsnaDatoteka.Text;
            prog.OpisPrograma = txtOpisPrograma.Text;

            if (prog.OpisPrograma == "")
            {
                prog.OpisPrograma = prog.VrstaPrograma + prog.Godina;
            }
        }
        private void frmAnalitickiKontniPlan_Load(object sender, EventArgs e)
        {
            selectedProgram = ProgramItem.GetSelectedProgramFromXml();
            Korisnik korisnikFromXml = KorisnikXML.GetSelectedKorisnikFromXml();
            if (korisnikFromXml != null)
            {
                try
                {
                    selectedKorisnik = KorisnikDB.GetKorisnik(korisnikFromXml.Lokacija, korisnikFromXml.SifraKor);
                }
                catch (Exception ex)
                {

                    MessageBox.Show("Greška u toku čitanja baze korisnika." + "\n" +
                    ex.Message,
                    "Greška tokom čitanja podataka",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);

                }
            }

            if ((selectedProgram != null) && (selectedKorisnik != null))
            {
                this.txtProgram.Text = selectedProgram.ImeMape;
                this.txtKorisnik.Text = selectedKorisnik.SifraKor + ": " + selectedKorisnik.NazivKor;

                dbfFolderName = Utility.GetDbfFolderKonta(selectedProgram, selectedKorisnik);

                this.txtDbfFajl.Text = dbfFolderName + "\\" + AnalitickiKontoDB.DbfFileName;

                if (SintetickiKontoDB.DbfFileExists(dbfFolderName))
                {

                    try
                    {
                        listaAKP = AnalitickiKontoDB.GetAnalitickiKontniPlan(dbfFolderName);
                        this.analitickiKontoBindingSource.DataSource = listaAKP;

                        this.bindingNavigatorKonto.ComboBox.DataSource = listaAKP;
                        this.bindingNavigatorKonto.ComboBox.DisplayMember = "Konto";
                        this.bindingNavigatorKonto.ComboBox.ValueMember = "Konto";

                        List<String> listaAOP = AnalitickiKontoDB.GetAOPOznake(listaAKP);

                        this.bindingNavigatorAOP.ComboBox.DataSource = listaAOP;

                    }
                    catch (Exception ex)
                    {

                        MessageBox.Show("Greška u toku čitanja analitičkog kontnog plana." + "\n" +
                                        ex.Message,
                                        "Greška tokom čitanja podataka",
                                        MessageBoxButtons.OK,
                                        MessageBoxIcon.Error);
                    }

                }
            }
        }
        private void frmSpecijalniNaloziGk_Load(object sender, EventArgs e)
        {
            selectedProgram = ProgramItem.GetSelectedProgramFromXml();
            Korisnik korisnikFromXml = KorisnikXML.GetSelectedKorisnikFromXml();
            if (korisnikFromXml != null)
            {
                try
                {
                    selectedKorisnik = KorisnikDB.GetKorisnik(korisnikFromXml.Lokacija, korisnikFromXml.SifraKor);
                }
                catch (Exception ex)
                {

                    MessageBox.Show("Greška u toku čitanja baze korisnika." + "\n" +
                    ex.Message,
                    "Greška tokom čitanja podataka",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);

                }
            }

            if ((selectedProgram != null) && (selectedKorisnik != null))
            {
                this.txtProgram.Text = selectedProgram.ImeMape;
                this.txtKorisnik.Text = selectedKorisnik.SifraKor + ": " + selectedKorisnik.NazivKor;

                dbfFolderName = Utility.GetDbfFolder(selectedProgram, selectedKorisnik);
                dbfKontaFolderName = Utility.GetDbfFolderKonta(selectedProgram, selectedKorisnik);

               cboVrstaNaloga.SelectedIndex = 0;
               progressBar.Visible = false;

            }
        }
Exemplo n.º 9
0
        public static List<ProgramItem> GetItemsFromListView(ListView lv)
        {
            List<ProgramItem> lista = new List<ProgramItem>();

            foreach (ListViewItem item in lv.Items)
            {
                ProgramItem prog = new ProgramItem();

                prog.Godina = item.Text;
                prog.ImeMape = item.SubItems[1].Text;
                prog.VrstaPrograma = item.SubItems[2].Text;
                prog.IzvrsnaDatoteka = item.SubItems[3].Text;
                prog.OpisPrograma = item.SubItems[4].Text;

                lista.Add(prog);

            }

            return lista;
        }
Exemplo n.º 10
0
        public static void SaveSelectedToXml(ProgramItem prog)
        {
            if (prog != null)
            {

                XmlWriterSettings settings = new XmlWriterSettings();
                settings.Indent = true;
                settings.IndentChars = "    ";

                XmlWriter xmlOut = XmlWriter.Create(SelectedXmlFileName, settings);

                xmlOut.WriteStartDocument();
                xmlOut.WriteStartElement("Programi");

                    xmlOut.WriteStartElement("SelectedProgram");
                    xmlOut.WriteElementString("Godina", prog.Godina);
                    xmlOut.WriteElementString("ImeMape", prog.ImeMape);
                    xmlOut.WriteElementString("VrstaPrograma", prog.VrstaPrograma);
                    xmlOut.WriteElementString("IzvrsnaDatoteka", prog.IzvrsnaDatoteka);
                    xmlOut.WriteElementString("OpisPrograma", prog.OpisPrograma);
                    xmlOut.WriteEndElement();

                xmlOut.WriteEndElement();

                xmlOut.Close();

            }
            else
            {
                if (File.Exists(SelectedXmlFileName))
                {
                    File.Delete(SelectedXmlFileName);
                }

            }
        }
Exemplo n.º 11
0
 public static bool IsEqual(ProgramItem prog, ListViewItem item)
 {
     return (prog.Godina == item.Text) &&
         (prog.ImeMape == item.SubItems[1].Text) &&
         (prog.VrstaPrograma == item.SubItems[2].Text) &&
         (prog.IzvrsnaDatoteka == item.SubItems[3].Text) &&
         (prog.OpisPrograma == item.SubItems[4].Text);
 }
Exemplo n.º 12
0
        public static ProgramItem GetSelectedProgramFromXml()
        {
            ProgramItem prog = null;

            if (File.Exists(SelectedXmlFileName))
            {
                XmlReaderSettings settings = new XmlReaderSettings();
                settings.IgnoreWhitespace = true;
                settings.IgnoreComments = true;

                XmlReader xmlIn = XmlReader.Create(SelectedXmlFileName, settings);

                if (xmlIn.ReadToDescendant("SelectedProgram"))
                {

                        prog = new ProgramItem();
                        xmlIn.ReadStartElement("SelectedProgram");

                        prog.Godina = xmlIn.ReadElementContentAsString();
                        prog.ImeMape = xmlIn.ReadElementContentAsString();
                        prog.VrstaPrograma = xmlIn.ReadElementContentAsString();
                        prog.IzvrsnaDatoteka = xmlIn.ReadElementContentAsString();
                        prog.OpisPrograma = xmlIn.ReadElementContentAsString();

                }

                xmlIn.Close();

            }

            return prog;
        }
Exemplo n.º 13
0
        public static ProgramItem GetProgramFromListViewItem(ListViewItem item)
        {
            ProgramItem prog = null;

            if (item != null)
            {
                prog = new ProgramItem();

                prog.Godina = item.Text;
                prog.ImeMape = item.SubItems[1].Text;
                prog.VrstaPrograma = item.SubItems[2].Text;
                prog.IzvrsnaDatoteka = item.SubItems[3].Text;
                prog.OpisPrograma = item.SubItems[4].Text;

            }

            return prog;
        }
Exemplo n.º 14
0
        public static List<ProgramItem> GetItemsFromXml()
        {
            List<ProgramItem> lista = new List<ProgramItem>();

            if (File.Exists(XmlFileName))
            {
                XmlReaderSettings settings = new XmlReaderSettings();
                settings.IgnoreWhitespace = true;
                settings.IgnoreComments = true;

                XmlReader xmlIn = XmlReader.Create(XmlFileName, settings);

                if (xmlIn.ReadToDescendant("Program"))
                {
                    do
                    {
                        ProgramItem prog = new ProgramItem();
                        xmlIn.ReadStartElement("Program");

                        prog.Godina = xmlIn.ReadElementContentAsString();
                        prog.ImeMape = xmlIn.ReadElementContentAsString();
                        prog.VrstaPrograma = xmlIn.ReadElementContentAsString();
                        prog.IzvrsnaDatoteka = xmlIn.ReadElementContentAsString();
                        prog.OpisPrograma = xmlIn.ReadElementContentAsString();

                        lista.Add(prog);

                    } while (xmlIn.ReadToNextSibling("Program"));
                }

                xmlIn.Close();

            }

            return lista;
        }
Exemplo n.º 15
0
        private void frmBrutoBilans_Load(object sender, EventArgs e)
        {
            selectedProgram = ProgramItem.GetSelectedProgramFromXml();
            Korisnik korisnikFromXml = KorisnikXML.GetSelectedKorisnikFromXml();
            if (korisnikFromXml != null)
            {
                selectedKorisnik = KorisnikDB.GetKorisnik(korisnikFromXml.Lokacija, korisnikFromXml.SifraKor);
            }

            if ((selectedProgram != null) && (selectedKorisnik != null))
            {
                this.txtProgram.Text = selectedProgram.ImeMape;
                this.txtKorisnik.Text = selectedKorisnik.SifraKor + ": " + selectedKorisnik.NazivKor;

                dbfFolderName = Utility.GetDbfFolder(selectedProgram, selectedKorisnik);
                dbfKontaFolderName = Utility.GetDbfFolderKonta(selectedProgram, selectedKorisnik);

                if ((NalogGkDB.DbfFileExists(dbfFolderName)) && (ItemGkDB.DbfFileExists(dbfFolderName)))
                {

                    try
                    {
                        listaKontaGk = ItemGkDB.GetKontaGk(dbfFolderName);

                        listaDatumaGk = NalogGkDB.GetDatumeGk(dbfFolderName);

                        if (listaDatumaGk.Count == 2)
                        {
                            dtpOdDatuma.Value = listaDatumaGk[0];
                            dtpDoDatuma.Value = listaDatumaGk[1];
                        }

                    }
                    catch (Exception ex)
                    {

                        MessageBox.Show(ex.Message); ;
                    }

                }
            }
        }
        private void frmAnalitickaKartica_Load(object sender, EventArgs e)
        {
            selectedProgram = ProgramItem.GetSelectedProgramFromXml();
            Korisnik korisnikFromXml = KorisnikXML.GetSelectedKorisnikFromXml();
            if (korisnikFromXml != null)
            {
                selectedKorisnik = KorisnikDB.GetKorisnik(korisnikFromXml.Lokacija, korisnikFromXml.SifraKor);
            }

            if ((selectedProgram != null) && (selectedKorisnik != null))
            {
                this.txtProgram.Text = selectedProgram.ImeMape;
                this.txtKorisnik.Text = selectedKorisnik.SifraKor + ": " + selectedKorisnik.NazivKor;

                dbfFolderName = Utility.GetDbfFolder(selectedProgram, selectedKorisnik);
                dbfKontaFolderName = Utility.GetDbfFolderKonta(selectedProgram, selectedKorisnik);

                if ((NalogGkDB.DbfFileExists(dbfFolderName)) && (ItemGkDB.DbfFileExists(dbfFolderName)))

                {

                    try
                    {
                        listaKontaGk = ItemGkDB.GetKontaGk(dbfFolderName);
                        cboKonto.DataSource = listaKontaGk;

                        listaDatumaGk = NalogGkDB.GetDatumeGk(dbfFolderName);

                        if (listaDatumaGk.Count == 2)
                        {
                            dtpOdDatuma.Value = listaDatumaGk[0];
                            dtpDoDatuma.Value = listaDatumaGk[1];
                        }

                        if (externalInput)
                        {
                            cboKonto.Text = inputKonto;
                            dtpOdDatuma.Value = inputOdDatuma;
                            dtpDoDatuma.Value = inputDoDatuma;
                            btnPrikaziKarticu.PerformClick();
                        }

                    }
                    catch (Exception ex)
                    {

                        MessageBox.Show(ex.Message); ;
                    }

                }
            }
        }
Exemplo n.º 17
0
 private void GetSelectedProgram()
 {
     selectedProgram = ProgramItem.GetSelectedProgramFromXml();
     DisplaySelectedProgram();
     GetDbfFolder();
 }