Example #1
0
        private void cmbTip_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            txtPret.Text = cmbTip.SelectedValue.ToString();
            KeyValuePair <MancareTip, double> selectedEntry = (KeyValuePair <MancareTip, double>)cmbTip.SelectedItem;

            selectedMancare = selectedEntry.Key;
        }
Example #2
0
 public Mancare(MancareTip aProdus) // constructor
 {
     mProdus = aProdus;
 }
Example #3
0
        private int ValidateCantitate(MancareTip selectedMancare)
        {
            int q = int.Parse(txtCantitate.Text);
            int r = 1;

            switch (selectedMancare)
            {
            case MancareTip.Royal:
                if (q > mHrană_umedăRoyal)
                {
                    r = 0;
                }
                break;

            case MancareTip.Felix:
                if (q > mHrană_umedăFelix)
                {
                    r = 0;
                }
                break;

            case MancareTip.Whiskas:
                if (q > mHrană_umedăWhiskas)
                {
                    r = 0;
                }
                break;

            case MancareTip.Sanabelle:
                if (q > mHrană_uscatăSanabelle)
                {
                    r = 0;
                }
                break;

            case MancareTip.Applaws:
                if (q > mHrană_uscatăApplaws)
                {
                    r = 0;
                }
                break;

            case MancareTip.Smilla:
                if (q > mHrană_uscatăSmilla)
                {
                    r = 0;
                }
                break;

            case MancareTip.Sticksuri:
                if (q > mRecompensaSticksuri)
                {
                    r = 0;
                }
                break;

            case MancareTip.Tablete:
                if (q > mRecompensaTablete)
                {
                    r = 0;
                }
                break;

            case MancareTip.Snackuri:
                if (q > mRecompensaSnackuri)
                {
                    r = 0;
                }
                break;
            }
            return(r);
        }