public DnevniPrihodiGrupeIzvestaj(DateTime from, DateTime to,
                                          List <Grupa> grupe, FinansijskaCelina finCelina)
        {
            this.fromDate  = from.Date;
            this.toDate    = to.Date;
            this.grupe     = grupe;
            this.finCelina = finCelina;

            System.Resources.ResourceManager resourceManager = new
                                                               System.Resources.ResourceManager("Soko.Resources.PreviewResursi", this.GetType().Assembly);
            Title    = resourceManager.GetString("prihodi_izvestaj_dnevni_title");
            SubTitle = fromDate.ToShortDateString() + " - " +
                       toDate.ToShortDateString();
            DocumentName = Title;

            ukupanPrihodCaptionFont = new Font("Arial", 10);
            ukupanPrihodIznosFont   = new Font("Courier New", 10, FontStyle.Bold);

            Font itemFont        = new Font("Courier New", 9);
            Font itemsHeaderFont = new Font("Courier New", 9);
            Font groupTitleFont  = new Font("Courier New", 10, FontStyle.Bold);

            lista = new DnevniPrihodiGrupeLista(fromDate, toDate, grupe, this, 1, 0f,
                                                itemFont, itemsHeaderFont, groupTitleFont);
        }
Exemple #2
0
        protected override void updateUIFromEntity(DomainObject entity)
        {
            Grupa g = (Grupa)entity;

            txtSifra.Text = g.Sifra.Value;
            txtNaziv.Text = g.Naziv;
            chbImaGodisnjuClanarinu.Checked = g.ImaGodisnjuClanarinu;
            SelectedKategorija = g.Kategorija;
            SelectedFinCelina  = g.FinansijskaCelina;
        }
Exemple #3
0
        protected override void checkBusinessRulesOnAdd(DomainObject entity)
        {
            FinansijskaCelina f            = (FinansijskaCelina)entity;
            Notification      notification = new Notification();

            FinansijskaCelinaDAO finCelDAO = DAOFactoryFactory.DAOFactory.GetFinansijskaCelinaDAO();

            if (finCelDAO.existsFinansijskaCelinaNaziv(f.Naziv))
            {
                notification.RegisterMessage("Naziv", "Finansijska celina sa datim nazivom vec postoji.");
                throw new BusinessException(notification);
            }
        }
Exemple #4
0
        protected override void checkBusinessRulesOnUpdate(DomainObject entity)
        {
            FinansijskaCelina f            = (FinansijskaCelina)entity;
            Notification      notification = new Notification();

            FinansijskaCelinaDAO finCelDAO = DAOFactoryFactory.DAOFactory.GetFinansijskaCelinaDAO();
            bool nazivChanged = (f.Naziv.ToUpper() != oldNaziv.ToUpper()) ? true : false;

            if (nazivChanged && finCelDAO.existsFinansijskaCelinaNaziv(f.Naziv))
            {
                notification.RegisterMessage("Naziv", "Finansijska celina sa datim nazivom vec postoji.");
                throw new BusinessException(notification);
            }
        }
Exemple #5
0
 public virtual bool existsGrupa(FinansijskaCelina f)
 {
     try
     {
         IQuery q = Session.CreateQuery("select count(*) from Grupa g where g.FinansijskaCelina = :f");
         q.SetEntity("f", f);
         return((long)q.UniqueResult() > 0);
     }
     catch (HibernateException ex)
     {
         string message = String.Format(
             "{0} \n\n{1}", Strings.DatabaseAccessExceptionMessage, ex.Message);
         throw new InfrastructureException(message, ex);
     }
 }
Exemple #6
0
 public virtual IList <Grupa> findForFinansijskaCelina(FinansijskaCelina f)
 {
     try
     {
         IQuery q = Session.CreateQuery(@"from Grupa g
                                          left join fetch g.Kategorija
                                          left join fetch g.FinansijskaCelina f
                                          where f = :f");
         q.SetEntity("f", f);
         return(q.List <Grupa>());
     }
     catch (HibernateException ex)
     {
         string message = String.Format(
             "{0} \n\n{1}", Strings.DatabaseAccessExceptionMessage, ex.Message);
         throw new InfrastructureException(message, ex);
     }
 }
Exemple #7
0
        protected override bool refIntegrityDeleteDlg(DomainObject entity)
        {
            FinansijskaCelina f        = (FinansijskaCelina)entity;
            GrupaDAO          grupaDao = DAOFactoryFactory.DAOFactory.GetGrupaDAO();

            if (grupaDao.existsGrupa(f))
            {
                string msg = "Finansijsku celinu '{0}' nije moguce izbrisati zato sto postoje " +
                             "grupe za datu finansijsku celinu. \n\nDa bi neka finansijska celina mogla da se " +
                             "izbrise, uslov je da ne postoje grupe za tu finansijsku celinu. To " +
                             "znaci da morate najpre da pronadjete sve grupe za datu " +
                             "finansijsku celinu, i da zatim, u prozoru u kome " +
                             "se menjaju podaci o grupi, promenite finansijsku celinu za datu grupu. " +
                             "Nakon sto ste ovo uradili za sve " +
                             "grupe za datu finansijsku celinu, moci cete da izbrisete finansijsku celinu. ";
                MessageDialogs.showMessage(String.Format(msg, f), this.Text);
                return(false);
            }
            return(true);
        }
        public PeriodicniClanoviIzvestaj(DateTime from, DateTime to,
                                         List <Grupa> grupe, FinansijskaCelina finCelina)
        {
            this.fromDate  = from.Date;
            this.toDate    = to.Date;
            this.finCelina = finCelina;

            Title        = "Uplate po grupama";
            SubTitle     = fromDate.ToShortDateString() + " - " + toDate.ToShortDateString();
            DocumentName = Title;

            ukupnoClanovaCaptionFont = new Font("Arial", 10);
            ukupnoClanovaBrojFont    = new Font("Courier New", 10, FontStyle.Bold);

            Font itemFont        = new Font("Courier New", 9);
            Font itemsHeaderFont = null;
            Font groupTitleFont  = new Font("Courier New", 10, FontStyle.Bold);

            lista = new PeriodicniClanoviLista(fromDate, toDate, grupe, this, 1, 0f,
                                               itemFont, itemsHeaderFont, groupTitleFont);
        }
Exemple #9
0
        public DnevniPrihodiKategorijeIzvestaj(DateTime dat, List <Grupa> grupe, FinansijskaCelina finCelina)
        {
            datum          = dat.Date;
            this.grupe     = grupe;
            this.finCelina = finCelina;

            System.Resources.ResourceManager resourceManager = new
                                                               System.Resources.ResourceManager("Soko.Resources.PreviewResursi", this.GetType().Assembly);
            Title        = resourceManager.GetString("prihodi_izvestaj_dnevni_kategorije_title");
            SubTitle     = datum.ToShortDateString();
            DocumentName = Title;

            Font itemFont        = new Font("Times New Roman", 15);
            Font itemsHeaderFont = new Font("Times New Roman", 12);

            lista = new DnevniPrihodiKategorijeLista(datum, grupe,
                                                     this, 1, 0f, itemFont, itemsHeaderFont);

            createFormats();
            createFonts();
        }
Exemple #10
0
        public AktivniClanoviGrupeIzvestaj(DateTime from, DateTime to,
                                           List <Grupa> grupe, FinansijskaCelina finCelina)
        {
            this.fromDate  = from.Date;
            this.toDate    = to.Date;
            this.finCelina = finCelina;

            System.Resources.ResourceManager resourceManager = new
                                                               System.Resources.ResourceManager("Soko.Resources.PreviewResursi", this.GetType().Assembly);

            Title        = resourceManager.GetString("akt_clan_izvestaj_title") + " po grupama";
            SubTitle     = fromDate.ToShortDateString() + " - " + toDate.ToShortDateString();
            DocumentName = Title;

            ukupnoClanovaCaptionFont = new Font("Arial", 10);
            ukupnoClanovaBrojFont    = new Font("Courier New", 10, FontStyle.Bold);

            Font itemFont        = new Font("Courier New", 9);
            Font itemsHeaderFont = null;
            Font groupTitleFont  = new Font("Courier New", 10, FontStyle.Bold);

            lista = new AktivniClanoviGrupeLista(fromDate, toDate, grupe, this, 1, 0f,
                                                 itemFont, itemsHeaderFont, groupTitleFont);
        }
Exemple #11
0
        // TODO2: Biranje clana se pojavljuje na vise mesta u programu. Probaj da napravis kontrolu
        // koja to radi, i koja moze da se stavlja na form.

        public BiracIntervala(string naslov, bool izborGrupa, bool izborClana, bool months, FinansijskaCelina finCelina)
        {
            InitializeComponent();
            this.Text      = naslov;
            this.months    = months;
            this.finCelina = finCelina;

            string format;

            if (months)
            {
                format           = "MMMM yyyy";
                dtpOd.ShowUpDown = true;
                dtpDo.ShowUpDown = true;
            }
            else
            {
                format = "d.M.yyyy";
            }
            dtpOd.CustomFormat = format;
            dtpOd.Format       = DateTimePickerFormat.Custom;
            dtpDo.CustomFormat = format;
            dtpDo.Format       = DateTimePickerFormat.Custom;

            DateTime firstDayInMonth = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1, 0, 0, 0);

            dtpOd.Value = firstDayInMonth;
            dtpDo.Value = firstDayInMonth;

            currentDatumOd      = dtpOd.Value;
            currentDatumDo      = dtpDo.Value;
            dtpOd.ValueChanged += new System.EventHandler(dtpDatum_ValueChanged);
            dtpDo.ValueChanged += new System.EventHandler(dtpDatum_ValueChanged);

            this.izborClana = izborClana;

            cmbClan.DropDownStyle = ComboBoxStyle.DropDownList;

            try
            {
                using (ISession session = NHibernateHelper.Instance.OpenSession())
                    using (session.BeginTransaction())
                    {
                        CurrentSessionContext.Bind(session);
                        if (finCelina != null)
                        {
                            sveGrupe = new List <Grupa>(DAOFactoryFactory.DAOFactory.GetGrupaDAO()
                                                        .findForFinansijskaCelina(finCelina));
                        }
                        else
                        {
                            sveGrupe = new List <Grupa>(DAOFactoryFactory.DAOFactory.GetGrupaDAO().FindAll());
                        }
                        clanovi = loadClanovi();
                    }
            }
            finally
            {
                CurrentSessionContext.Unbind(NHibernateHelper.Instance.SessionFactory);
            }

            checkedListBoxGrupe.CheckOnClick = true;
            sveGrupe.Sort();
            fillCheckedListBoxGrupa(sveGrupe);
            rbtSveGrupe.Checked = true;

            setClanovi(clanovi);
            if (clanovi.Count > 0)
            {
                SelectedClan = clanovi[0];
            }
            else
            {
                SelectedClan = null;
            }
            rbtCeoIzvestaj.Checked = true;


            Font = Options.Instance.Font;
            if (!izborClana)
            {
                groupBox3.Visible = false;
                groupBox3.Enabled = false;
                int delta = groupBox3.Bottom - groupBox2.Bottom;
                btnOk.Location       = new Point(btnOk.Location.X, btnOk.Location.Y - delta);
                btnOdustani.Location = new Point(btnOdustani.Location.X, btnOdustani.Location.Y - delta);
                this.Size            = new Size(Size.Width, Size.Height - delta);
            }
            if (!izborGrupa)
            {
                groupBox2.Visible = false;
                groupBox2.Enabled = false;
                int delta = groupBox2.Bottom - groupBox1.Bottom;
                btnOk.Location       = new Point(btnOk.Location.X, btnOk.Location.Y - delta);
                btnOdustani.Location = new Point(btnOdustani.Location.X, btnOdustani.Location.Y - delta);
                this.Size            = new Size(Size.Width, Size.Height - delta);
            }
        }
Exemple #12
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     SelFinCelina = SelectedFinCelina;
 }
Exemple #13
0
        public AktivniClanoviIzvestaj(DateTime from, DateTime to, List <Grupa> grupe, FinansijskaCelina finCelina)
        {
            fromDate       = from.Date;
            toDate         = to.Date;
            this.finCelina = finCelina;

            System.Resources.ResourceManager resourceManager = new
                                                               System.Resources.ResourceManager("Soko.Resources.PreviewResursi", this.GetType().Assembly);

            Title        = resourceManager.GetString("akt_clan_izvestaj_title");
            SubTitle     = fromDate.ToShortDateString() + " - " + toDate.ToShortDateString();
            DocumentName = Title;

            Font itemFont        = new Font("Courier New", 9);
            Font itemsHeaderFont = new Font("Courier New", 9);

            lista = new AktivniClanoviLista(fromDate, toDate, grupe, this, 1, 0f, itemFont, itemsHeaderFont);
        }
Exemple #14
0
        protected override void updateEntityFromUI(DomainObject entity)
        {
            FinansijskaCelina f = (FinansijskaCelina)entity;

            f.Naziv = txtNaziv.Text.Trim();
        }
Exemple #15
0
        protected override void updateUIFromEntity(DomainObject entity)
        {
            FinansijskaCelina f = (FinansijskaCelina)entity;

            txtNaziv.Text = f.Naziv;
        }
Exemple #16
0
        protected override void saveOriginalData(DomainObject entity)
        {
            FinansijskaCelina f = (FinansijskaCelina)entity;

            oldNaziv = f.Naziv;
        }