Beispiel #1
0
        private void btnSpremiNovi_Click(object sender, EventArgs e)
        {
            BusinessLogic.pElement     = (int?)ucbElement.Value;
            BusinessLogic.pJOPPDOznaka = (int?)ucbJOPPDOznaka.Value;

            StringBuilder message = ValidateDataInput();

            if (message.Length == 0)
            {
                if (SaveData())
                {
                    ucbElement.Value     = null;
                    ucbJOPPDOznaka.Value = null;
                    FormEditMode         = Enums.FormEditMode.Insert;
                }
                else
                {
                    lblValidationMessages.Text = "Dogodila se greška prilikom upisa oznake primitka element.\nKontaktirajte administratora";
                }
            }
            else
            {
                lblValidationMessages.Text = message.ToString();
                return;
            }
        }
Beispiel #2
0
        private void btnSpremiNovi_Click(object sender, EventArgs e)
        {
            BusinessLogic.pOznaka     = txtOznaka.Text.Trim();
            BusinessLogic.pKratkiOpis = txtKratkiOpis.Text.Trim();
            BusinessLogic.pDugiOpis   = txtDugiOpis.Text.Trim();

            StringBuilder message = ValidateDataInput();

            if (message.Length == 0)
            {
                if (SaveData())
                {
                    txtOznaka.Text     = string.Empty;
                    txtKratkiOpis.Text = string.Empty;
                    txtDugiOpis.Text   = string.Empty;
                    FormEditMode       = Enums.FormEditMode.Insert;
                }
                else
                {
                    lblValidationMessages.Text = "Dogodila se greška prilikom upisa Oznake primitka.\nKontaktirajte administratora";
                }
            }
            else
            {
                lblValidationMessages.Text = message.ToString();
                return;
            }
        }
Beispiel #3
0
        private bool SaveData()
        {
            this.lblValidationMessages.ResetText();

            BusinessLogic save = new BusinessLogic();

            if (this.FormEditMode == Enums.FormEditMode.Insert)
            {
                if (save.InsertOznakaPrimitkaElement())
                {
                    FormEditMode = Enums.FormEditMode.Update;
                    return(true);
                }
            }
            else if (this.FormEditMode == Enums.FormEditMode.Update)
            {
                if (save.UpdateOznakaPrimitkaElement())
                {
                    return(true);
                }
            }

            return(false);
        }
Beispiel #4
0
        private bool SaveData()
        {
            this.lblValidationMessages.ResetText();

            BusinessLogic save = new BusinessLogic();

            if (this.FormEditMode == Enums.FormEditMode.Insert)
            {
                if (save.Insert("JOPPDOznakaMjesecaOsiguranje"))
                {
                    FormEditMode = Enums.FormEditMode.Update;
                    return(true);
                }
            }
            else if (this.FormEditMode == Enums.FormEditMode.Update)
            {
                if (save.Update("JOPPDOznakaMjesecaOsiguranje"))
                {
                    return(true);
                }
            }

            return(false);
        }
Beispiel #5
0
 public uscOznakaPrimitkaElement(FormEditMode formEditMode)
 {
     InitializeComponent();
     FormEditMode = formEditMode;
 }
Beispiel #6
0
 public uscStjecateljPrimitkaElement(FormEditMode formEditMode)
 {
     InitializeComponent();
     FormEditMode = formEditMode;
 }
Beispiel #7
0
 public uscNeoporezivPrimitak(FormEditMode formEditMode)
 {
     InitializeComponent();
     FormEditMode = formEditMode;
 }
Beispiel #8
0
 public uscPutniNalog(FormEditMode formEditMode)
 {
     InitializeComponent();
     FormEditMode = formEditMode;
 }
Beispiel #9
0
        private void btnSpremiNovi_Click(object sender, EventArgs e)
        {
            BusinessLogic.pID_Radnik               = (int?)ucbImePrezime.Value;
            BusinessLogic.pID_Likvidator           = (int?)ucbLikvidator.Value;
            BusinessLogic.pDatumPutnogNaloga       = udtDatumNaloga.DateTime;
            BusinessLogic.pSifraPutnogNaloga       = txtSifraNaloga.Text.Trim();
            BusinessLogic.pTroskoviPutovanja       = IsDbNull <decimal>(uneTroskoviAutoputa.Value);
            BusinessLogic.pTroskoviVlastitogVozila = IsDbNull <decimal>(uneTroskoviVlVozila.Value);
            BusinessLogic.pOstaliTroskovi          = IsDbNull <decimal>(uneDrugiTroskovi.Value);
            BusinessLogic.pDnevnice            = IsDbNull <decimal>(uneTroskoviDnevnice.Value);
            BusinessLogic.pID_NacinIsplate     = (int?)ucbNacinIsplate.Value;
            BusinessLogic.pTroskoviSmjestaja   = IsDbNull <decimal>(uneTroskoviSjestaja.Value);
            BusinessLogic.pIsDrugiTroskovi     = cbkDrugiTroskovi.Checked;
            BusinessLogic.pIsTroskoviSmjestaja = cbkTroskoviSmjestaja.Checked;
            BusinessLogic.pAkontacija          = IsDbNull <decimal>(uneAkontacija.Value);
            BusinessLogic.pDatumObracuna       = udtDatumObracuna.DateTime;
            BusinessLogic.pIsTroskoviAutoputa  = cbkTroskoviAutoputa.Checked;
            if (cbkZaposlenici.Checked)
            {
                BusinessLogic.pVrstaRadnika = 1;
            }
            else if (cbkHonorari.Checked)
            {
                BusinessLogic.pVrstaRadnika = 2;
            }
            else
            {
                MessageBox.Show("Odaberite vrstu djelatnika za koje želite kreirati putne naloge");
                return;
            }

            StringBuilder message = ValidateDataInput();

            if (message.Length == 0)
            {
                if (SaveData())
                {
                    ucbImePrezime.Value          = null;
                    ucbLikvidator.Value          = null;
                    udtDatumNaloga.Value         = null;
                    txtSifraNaloga.Text          = string.Empty;
                    uneTroskoviAutoputa.Value    = null;
                    uneTroskoviVlVozila.Value    = null;
                    uneDrugiTroskovi.Value       = null;
                    uneTroskoviDnevnice.Value    = null;
                    ucbNacinIsplate.Value        = null;
                    cbkDrugiTroskovi.Checked     = false;
                    cbkTroskoviSmjestaja.Checked = false;
                    uneAkontacija.Value          = null;
                    udtDatumObracuna.Value       = null;
                    uneTroskoviSjestaja.Value    = null;
                    cbkHonorari.Checked          = false;
                    cbkZaposlenici.Checked       = false;

                    FormEditMode = Enums.FormEditMode.Insert;
                }
                else
                {
                    lblValidationMessages.Text = "Dogodila se greška prilikom upisa putnog naloga.\nKontaktirajte administratora";
                }
            }
            else
            {
                lblValidationMessages.Text = message.ToString();
                return;
            }
        }
Beispiel #10
0
 public uscMjesecOsiguranja(FormEditMode formEditMode)
 {
     InitializeComponent();
     FormEditMode = formEditMode;
 }
Beispiel #11
0
 public uscNacinIsplate(FormEditMode formEditMode)
 {
     InitializeComponent();
     FormEditMode = formEditMode;
 }
Beispiel #12
0
 public uscRadnoVrijeme(FormEditMode formEditMode)
 {
     InitializeComponent();
     FormEditMode = formEditMode;
 }