public PregledElemenataForm()
        {
            InitializeComponent();
            this.Size = new Size(this.Size.Width, 550);
            try
            {
                using (ISession session = NHibernateHelper.OpenSession())
                    using (session.BeginTransaction())
                    {
                        CurrentSessionContext.Bind(session);

                        List <Element> sviElementi = new List <Element>(DAOFactoryFactory.DAOFactory.GetElementDAO().FindAll());
                        grupe = DAOFactoryFactory.DAOFactory.GetGrupaDAO().FindAll();

                        Graphics g             = CreateGraphics();
                        float    elementSizeMM = Math.Min(210 / 4, 297 / 6);
                        elementSizePxl = (Size)Point.Round(
                            Utils.mmToPixel(g, new PointF(elementSizeMM, elementSizeMM)));

                        tabela       = new TabelaElemenata(sviElementi, elementSizePxl);
                        currentIndex = -1;

                        //initUI();

                        g.Dispose();

                        //panelTabela.MouseWheel += new MouseEventHandler(panelTabela_MouseWheel);
                    }
            }
            finally
            {
                CurrentSessionContext.Unbind(NHibernateHelper.SessionFactory);
            }
        }
        public PregledElemenataForm()
        {
            InitializeComponent();
            this.Size = new Size(this.Size.Width, 550);
            try
            {
                using (ISession session = NHibernateHelper.OpenSession())
                using (session.BeginTransaction())
                {
                    CurrentSessionContext.Bind(session);

                    List<Element> sviElementi = new List<Element>(DAOFactoryFactory.DAOFactory.GetElementDAO().FindAll());
                    grupe = DAOFactoryFactory.DAOFactory.GetGrupaDAO().FindAll();

                    Graphics g = CreateGraphics();
                    float elementSizeMM = Math.Min(210 / 4, 297 / 6);
                    elementSizePxl = (Size)Point.Round(
                        Utils.mmToPixel(g, new PointF(elementSizeMM, elementSizeMM)));

                    tabela = new TabelaElemenata(sviElementi, elementSizePxl);
                    currentIndex = -1;

                    //initUI();

                    g.Dispose();

                    //panelTabela.MouseWheel += new MouseEventHandler(panelTabela_MouseWheel);
                }
            }
            finally
            {
                CurrentSessionContext.Unbind(NHibernateHelper.SessionFactory);
            }
        }
Esempio n. 3
0
        public TabelaIzvestaj(TabelaElemenata tabela)
        {
            this.tabela = tabela;
            DocumentName = "Tabela Elemenata";

            gimnasticarFont = new Font("Arial", 10, FontStyle.Bold);
            nazivVezbeFont = new Font("Arial", 12);
            spravaFont = new Font("Arial", 10, FontStyle.Bold);
            datumFont = new Font("Arial", 8);
        }
Esempio n. 4
0
 public ElementTableItem(Sprava sprava, GrupaElementa grupa, int broj,
     Element element, PointF location, SizeF size, TabelaElemenata tabela)
 {
     this.sprava = sprava;
     this.grupa = grupa;
     this.broj = broj;
     this.element = element;
     this.location = location;
     this.size = size;
     selected = false;
     selectedImage = null;
     this.tabela = tabela;
     cutted = false;
 }
Esempio n. 5
0
 public ElementTableItem(Sprava sprava, GrupaElementa grupa, int broj,
                         Element element, PointF location, SizeF size, TabelaElemenata tabela)
 {
     this.sprava   = sprava;
     this.grupa    = grupa;
     this.broj     = broj;
     this.element  = element;
     this.location = location;
     this.size     = size;
     selected      = false;
     selectedImage = null;
     this.tabela   = tabela;
     cutted        = false;
 }
Esempio n. 6
0
        public TabelaElemenataForm(TabelaElemenataFormRezimRada rezimRada, Sprava sprava)
        {
            InitializeComponent();
            MinimumSize = SystemInformation.MinimizedWindowSize +
                          new Size(0, panel1.Height + panelHeader.Height + 100);

            try
            {
                using (ISession session = NHibernateHelper.OpenSession())
                    using (session.BeginTransaction())
                    {
                        CurrentSessionContext.Bind(session);

                        List <Element> sviElementi = new List <Element>(DAOFactoryFactory.DAOFactory.GetElementDAO().FindAll());
                        grupe = DAOFactoryFactory.DAOFactory.GetGrupaDAO().FindAll();

                        Graphics g              = CreateGraphics();
                        float    elementSizeMM  = Math.Min(210 / 4, 297 / 6);
                        SizeF    elementSizePxl = (Size)Point.Round(
                            Utils.mmToPixel(g, new PointF(elementSizeMM, elementSizeMM)));

                        tabela = new TabelaElemenata(sviElementi, elementSizePxl);

                        initUI();

                        float tezineHeaderHeightMM = 7;
                        float grupaHeaderHeightMM  = 5;

                        tezineHeaderHeightPxl = Point.Round(
                            Utils.mmToPixel(g, new PointF(0, tezineHeaderHeightMM))).Y;
                        grupaHeaderHeightPxl = Point.Round(
                            Utils.mmToPixel(g, new PointF(0, grupaHeaderHeightMM))).Y;
                        g.Dispose();

                        panelHeader.Height = tezineHeaderHeightPxl + grupaHeaderHeightPxl + 1;

                        this.rezimRada = rezimRada;
                        if (rezimRada == TabelaElemenataFormRezimRada.Select)
                        {
                            setSpravaCombo(sprava);
                            cmbSprava.Enabled = false;
                            btnPrint.Enabled  = false;
                            btnPrint.Visible  = false;
                            btnClose.Enabled  = false;
                            btnClose.Visible  = false;
                        }
                        else
                        {
                            btnOK.Enabled = false;
                            btnOK.Visible = false;
                        }

                        cmbSprava.SelectedIndexChanged += cmbSprava_SelectedIndexChanged;
                        cmbGrupa.SelectedIndexChanged  += cmbGrupa_SelectedIndexChanged;

                        disableTrackBar();
                        promeniGrupu();
                        zumiraj(120);
                        panelTabela.MouseWheel += new MouseEventHandler(panelTabela_MouseWheel);
                    }
            }
            finally
            {
                CurrentSessionContext.Unbind(NHibernateHelper.SessionFactory);
            }
        }
Esempio n. 7
0
        public TabelaElemenataForm(TabelaElemenataFormRezimRada rezimRada, Sprava sprava)
        {
            InitializeComponent();
            MinimumSize = SystemInformation.MinimizedWindowSize +
                new Size(0, panel1.Height + panelHeader.Height + 100);

            try
            {
                using (ISession session = NHibernateHelper.OpenSession())
                using (session.BeginTransaction())
                {
                    CurrentSessionContext.Bind(session);

                    List<Element> sviElementi = new List<Element>(DAOFactoryFactory.DAOFactory.GetElementDAO().FindAll());
                    grupe = DAOFactoryFactory.DAOFactory.GetGrupaDAO().FindAll();

                    Graphics g = CreateGraphics();
                    float elementSizeMM = Math.Min(210 / 4, 297 / 6);
                    SizeF elementSizePxl = (Size)Point.Round(
                        Utils.mmToPixel(g, new PointF(elementSizeMM, elementSizeMM)));

                    tabela = new TabelaElemenata(sviElementi, elementSizePxl);

                    initUI();

                    float tezineHeaderHeightMM = 7;
                    float grupaHeaderHeightMM = 5;

                    tezineHeaderHeightPxl = Point.Round(
                        Utils.mmToPixel(g, new PointF(0, tezineHeaderHeightMM))).Y;
                    grupaHeaderHeightPxl = Point.Round(
                        Utils.mmToPixel(g, new PointF(0, grupaHeaderHeightMM))).Y;
                    g.Dispose();

                    panelHeader.Height = tezineHeaderHeightPxl + grupaHeaderHeightPxl + 1;

                    this.rezimRada = rezimRada;
                    if (rezimRada == TabelaElemenataFormRezimRada.Select)
                    {
                        setSpravaCombo(sprava);
                        cmbSprava.Enabled = false;
                        btnPrint.Enabled = false;
                        btnPrint.Visible = false;
                        btnClose.Enabled = false;
                        btnClose.Visible = false;
                    }
                    else
                    {
                        btnOK.Enabled = false;
                        btnOK.Visible = false;
                    }

                    cmbSprava.SelectedIndexChanged += cmbSprava_SelectedIndexChanged;
                    cmbGrupa.SelectedIndexChanged += cmbGrupa_SelectedIndexChanged;

                    disableTrackBar();
                    promeniGrupu();
                    zumiraj(120);
                    panelTabela.MouseWheel += new MouseEventHandler(panelTabela_MouseWheel);
                }
            }
            finally
            {
                CurrentSessionContext.Unbind(NHibernateHelper.SessionFactory);
            }
        }