public IHesaplayıcı HesaplayiciFactoryMethod(DortIslem islem)
        {
            IHesaplayıcı sonuc = null;

            switch (islem)
            {
            case DortIslem.Bol:
                sonuc = new Bol();
                break;

            case DortIslem.Carp:
                sonuc = new Carp();
                break;

            case DortIslem.Cikar:
                sonuc = new Cikar();
                break;

            case DortIslem.Topla:
            default:
                sonuc = new Topla();
                break;
            }
            return(sonuc);
        }
示例#2
0
        private void txtFiyat_TextChanged(object sender, EventArgs e)
        {
            double outdouble = 0;
            double Topla;
            double FiyatDoktorM   = double.TryParse(txtDoktorM.Text, out outdouble) ? double.Parse(txtDoktorM.Text) : 0;
            double FiyatPersonelM = double.TryParse(txtPersonelM.Text, out outdouble) ? double.Parse(txtPersonelM.Text) : 0;
            double FiyatYiyecek   = double.TryParse(txtYiyecek.Text, out outdouble) ? double.Parse(txtYiyecek.Text) : 0;
            double FiyatMalzeme   = double.TryParse(txtMalzeme.Text, out outdouble) ? double.Parse(txtMalzeme.Text) : 0;
            double FiyatFatura    = double.TryParse(txtFatura.Text, out outdouble) ? double.Parse(txtFatura.Text) : 0;

            Topla          = FiyatDoktorM + FiyatPersonelM + FiyatMalzeme + FiyatYiyecek + FiyatFatura;
            txtToplam.Text = Topla.ToString("#,##0.#0");
        }
示例#3
0
        private void txtFiyat_TextChanged(object sender, EventArgs e)
        {
            double outdouble = 0;
            double Topla;
            double FiyatAmaliyat  = double.TryParse(txtAmaliyat.Text, out outdouble) ? double.Parse(txtAmaliyat.Text) : 0;
            double FiyatYatan     = double.TryParse(txtYatan.Text, out outdouble) ? double.Parse(txtYatan.Text) : 0;
            double FiyatExtra     = double.TryParse(txtEkHizmet.Text, out outdouble) ? double.Parse(txtEkHizmet.Text) : 0;
            double FiyatLabrotuar = double.TryParse(txtLabratuar.Text, out outdouble) ? double.Parse(txtLabratuar.Text) : 0;
            double FiyatMuane     = double.TryParse(txtMuane.Text, out outdouble) ? double.Parse(txtMuane.Text) : 0;
            double FiyatSponsor   = double.TryParse(txtSponsor.Text, out outdouble) ? double.Parse(txtSponsor.Text) : 0;

            Topla          = FiyatAmaliyat + FiyatExtra + FiyatLabrotuar + FiyatMuane + FiyatSponsor + FiyatYatan;
            txtToplam.Text = Topla.ToString("#,##0.#0");
        }