Example #1
0
        protected override void requiredFieldsAndFormatValidation(Notification notification)
        {
            SifraGrupe dummy;

            if (txtSifra.Text.Trim() == String.Empty)
            {
                notification.RegisterMessage("Sifra", "Sifra grupe je obavezan.");
            }
            else if (!SifraGrupe.TryParse(txtSifra.Text, out dummy))
            {
                notification.RegisterMessage(
                    "Sifra", String.Format("Neispravan format za sifru grupe. Sifra " +
                                           "grupe mora da zapocne sa brojem, i moze da sadrzi " +
                                           "maksimalno {0} znakova.", Grupa.SIFRA_MAX_LENGTH));
            }

            if (txtNaziv.Text.Trim() == String.Empty)
            {
                notification.RegisterMessage(
                    "Naziv", "Naziv grupe je obavezan.");
            }

            if (SelectedFinCelina == null && finansijskeCeline.Count > 0)
            {
                notification.RegisterMessage(
                    "FinansijskaCelina", "Finansijska celina je obavezna.");
            }
        }
Example #2
0
        private void txtSifraGrupe_TextChanged(object sender, System.EventArgs e)
        {
            SifraGrupe sifra;

            if (SifraGrupe.TryParse(txtSifraGrupe.Text.Trim(), out sifra))
            {
                SelectedGrupa = findGrupa(sifra);
            }
            else
            {
                SelectedGrupa = null;
            }
        }