예제 #1
0
        private void PregledDana_Load(object sender, EventArgs e)
        {
            magacin_cmb.DataSource    = Komercijalno.UcitajMagacine();
            magacin_cmb.DisplayMember = "_string";
            magacin_cmb.ValueMember   = "_int";

            NamestiGrafikon();
            UcitajPodatke();
            lokalCiljMagacina.Initialize(Korisnik.korisnikId, (int)magacin_cmb.SelectedValue);
            magacin_cmb.SelectedValue = Korisnik.magacinId;
        }
예제 #2
0
        private void UcitajPodatke()
        {
            lokalCiljMagacina.Initialize(Korisnik.korisnikId, (int)magacin_cmb.SelectedValue);
            globalniCiljMagacina.Initialize(-1, (int)magacin_cmb.SelectedValue);

            double mesecniPromet = Komercijalno.PrometMagacina((int)magacin_cmb.SelectedValue, M.Godina.MesecGet(dateTimePicker1.Value.Month), dateTimePicker1.Value.Year);
            double proslogodisnjiMesecniPromet = Komercijalno.PrometMagacina((int)magacin_cmb.SelectedValue, M.Godina.MesecGet(dateTimePicker1.Value.Month), dateTimePicker1.Value.Year - 1);

            double lokalniCilj  = 0;
            double globalniCilj = 0;

            if (lokalCiljMagacina.procentualno == true)
            {
                lokalniCilj = proslogodisnjiMesecniPromet + (proslogodisnjiMesecniPromet * lokalCiljMagacina.godisnjiRast / 100);
            }
            else
            {
                lokalniCilj = lokalCiljMagacina.godisnjiRast;
            }
            if (globalniCiljMagacina.procentualno == true)
            {
                globalniCilj = proslogodisnjiMesecniPromet + (proslogodisnjiMesecniPromet * globalniCiljMagacina.godisnjiRast / 100);
            }
            else
            {
                globalniCilj = globalniCiljMagacina.godisnjiRast;
            }

            ukupanPromet_txt.Text = String.Format("{0:n} RSD", Komercijalno.PrometMagacina((int)magacin_cmb.SelectedValue, dateTimePicker1.Value));
            gotovina_txt.Text     = String.Format("{0:n} RSD", Komercijalno.PrometMagacina((int)magacin_cmb.SelectedValue, dateTimePicker1.Value, NacinUplate.Gotovina));
            virman_txt.Text       = String.Format("{0:n} RSD", Komercijalno.PrometMagacina((int)magacin_cmb.SelectedValue, dateTimePicker1.Value, NacinUplate.Virman));
            kartica_txt.Text      = String.Format("{0:n} RSD", Komercijalno.PrometMagacina((int)magacin_cmb.SelectedValue, dateTimePicker1.Value, NacinUplate.Kartica));
            odlozeno_txt.Text     = String.Format("{0:n} RSD", Komercijalno.PrometMagacina((int)magacin_cmb.SelectedValue, dateTimePicker1.Value, NacinUplate.Odlozeo));

            ukupanPrometM_txt.Text = String.Format("{0:n} RSD", mesecniPromet);
            globalCilj_txt.Text    = String.Format("{0:n} RSD", globalniCilj);
            lokalniCilj_txt.Text   = String.Format("{0:n} RSD", lokalniCilj);

            label6.Text = dateTimePicker1.Value.ToShortDateString();

            lokalniCilj_txt.BackColor = (lokalniCilj > mesecniPromet) ? Color.Pink : Color.LightGreen;
            globalCilj_txt.BackColor  = (globalniCilj > mesecniPromet) ? Color.Pink : Color.LightGreen;
        }
예제 #3
0
        private void UcitajLokalniCilj()
        {
            cm.Initialize((int)korisnikId, (int)magacinId);
            switch (magacinId)
            {
            case 12:
                m12_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 13:
                m13_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 14:
                m14_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 15:
                m15_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 16:
                m16_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 17:
                m17_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 18:
                m18_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 19:
                m19_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 20:
                m20_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 21:
                m21_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 22:
                m22_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 23:
                m23_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 24:
                m24_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 25:
                m25_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 26:
                m26_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 27:
                m27_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;

            case 28:
                m28_txt.Text = String.Format("{0:##}", cm.godisnjiRast);
                break;
            }
        }
예제 #4
0
        private void UcitajGlobalniCilj()
        {
            for (int i = 12; i < 29; i++)
            {
                CiljMagacina c = new CiljMagacina();
                c.Initialize(-1, i);

                cm_g.Add(c);

                switch (i)
                {
                case 12:
                    m12_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m12_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 13:
                    m13_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m13_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 14:
                    m14_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m14_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 15:
                    m15_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m15_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 16:
                    m16_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m16_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 17:
                    m17_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m17_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 18:
                    m18_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m18_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 19:
                    m19_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m19_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 20:
                    m20_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m20_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 21:
                    m21_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m21_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 22:
                    m22_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m22_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 23:
                    m23_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m23_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 24:
                    m24_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m24_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 25:
                    m25_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m25_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 26:
                    m26_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m26_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 27:
                    m27_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m27_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;

                case 28:
                    m28_txt.Text          = String.Format("{0:##}", c.godisnjiRast);
                    m28_cmb.SelectedIndex = (c.procentualno) ? 1 : 0;
                    break;
                }
            }
        }