Example #1
0
        private void btnZapamti_Click(object sender, EventArgs e)
        {
            if (txtID.Text == "")
            {
                MessageBox.Show("Niste kreirali ID!");
            }
            else if (txtIme.TextValue == "" || txtPrezime.TextValue == "" || txtTrajanjeUgovora.TextValue == "" ||
                     txtEmail.TextValue == "" || txtTelefon.TextValue == "")
            {
                kki.zapamtiIzvodjaca(int.Parse(txtID.Text), txtIme.TextValue, txtPrezime.TextValue, txtTrajanjeUgovora.TextValue, txtEmail.TextValue, txtTelefon.TextValue);
            }
            else
            {
                PorukaZapamti zapamti = new PorukaZapamti();
                zapamti.Show();
                kki.zapamtiIzvodjaca(int.Parse(txtID.Text), txtIme.TextValue, txtPrezime.TextValue, txtTrajanjeUgovora.TextValue, txtEmail.TextValue, txtTelefon.TextValue);

                this.Close();
            }
        }
        public Izvodjac izmeniIzvodjaca(Izvodjac izvodjac)
        {
            if (izvodjac.Ime == "")
            {
                MessageBox.Show("Niste uneli ime!");
                return(null);
            }

            if (izvodjac.Prezime == "")
            {
                MessageBox.Show("Niste uneli prezime!");
                return(null);
            }

            if (izvodjac.TrajanjeUgovora == "")
            {
                MessageBox.Show("Niste uneli trajanje ugovora!");
                return(null);
            }

            if (izvodjac.Email == "")
            {
                MessageBox.Show("Niste uneli E-mail!");
                return(null);
            }

            if (izvodjac.Telefon == "")
            {
                MessageBox.Show("Niste uneli broj telefona!");
                return(null);
            }

            var rezultat = Komunikacija.Instance.IzmeniIzvodjacaSO(izvodjac);

            PorukaZapamti zapamti = new PorukaZapamti();

            zapamti.Show();

            return(rezultat);
        }