Beispiel #1
0
        protected void txtBaslangicChanged(object sender, EventArgs e)
        {
            using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
            {
                int         tarifeid = Convert.ToInt32(drdTarife.SelectedValue);
                MakineIslem m        = new MakineIslem(dc);
                Tarife      t        = m.tarife_tek(tarifeid);

                if (t.saatlik == true)
                {
                    numara_aralik.Visible = true;
                    tarih_aralik.Visible  = false;
                    hdnSaatlik.Value      = "yes";
                    hdnTarifeTipi.Value   = t.tarife_kodu;
                    dakika_hesapla();
                    tutar_hesapla();
                }
                else
                {
                    numara_aralik.Visible = false;
                    tarih_aralik.Visible  = true;
                    hdnSaatlik.Value      = string.Empty;
                    hdnTarifeTipi.Value   = string.Empty;
                    sure_hesapla();
                }

                //fiyatCek(dc);
            }
        }
Beispiel #2
0
        private void tarifeCek(radiusEntities dc)
        {
            if (grdMakine.SelectedValue != null)
            {
                int         id        = Convert.ToInt32(grdMakine.SelectedValue);
                MakineIslem m         = new MakineIslem(dc);
                var         tarifeler = m.tarifeler(id);
                //if (tarifeler.Count > 0)
                //{
                drdTarife.DataSource     = tarifeler;
                drdTarife.DataValueField = "id";
                drdTarife.DataTextField  = "ad";
                drdTarife.DataBind();
                //}
                Makine mak = m.tekmakine(id);
                txtSonNumara.Text        = mak.son_sayac.ToString();
                txtMakineAdiGoster.Value = mak.adi;

                if (tarifeler.Count > 0)
                {
                    int tarifeid = Convert.ToInt32(drdTarife.SelectedValue);


                    Tarife t = m.tarife_tek(tarifeid);
                    txtFiyat.Text = t.tutar.ToString();

                    if (t.saatlik == true)
                    {
                        numara_aralik.Visible = true;
                        hdnSaatlik.Value      = "yes";
                        tarih_aralik.Visible  = false;
                    }
                    else
                    {
                        numara_aralik.Visible = false;
                        hdnSaatlik.Value      = string.Empty;
                        tarih_aralik.Visible  = true;
                    }
                }
                else
                {
                    txtFiyat.Text    = String.Empty;
                    hdnSaatlik.Value = string.Empty;
                }
            }
        }
        private void fiyatCek(radiusEntities dc)
        {
            if (grdMakine.SelectedValue != null && drdTarife.SelectedValue != null)
            {
                int id       = Convert.ToInt32(grdMakine.SelectedValue);
                int tarifeid = Convert.ToInt32(drdTarife.SelectedValue);

                MakineIslem m   = new MakineIslem(dc);
                Makine      mak = m.tekmakine(id);
                Tarife      t   = m.tarife_tek(tarifeid);

                txtFiyat.Text = t.tutar.ToString();

                txtSonNumara.Text        = mak.son_sayac.ToString();
                txtMakineAdiGoster.Value = mak.adi;
            }
        }