protected void ButtonAra_Click(object sender, EventArgs e) { TxtAdSoyad.Text = string.Empty; int aboneNo = int.Parse(AboneNo.Value); var result = AboneRepository.GetViewAbone(aboneNo); if (result != null) { TxtAdSoyad.Text = result.AboneAdSoyad; DropDownListAboneTipi.ClearSelection(); DropDownListAboneTipi.Items.FindByValue(result.AboneTuruAd).Selected = true; LabelAdSoyad.Visible = true; TxtAdSoyad.Visible = true; LabelTip.Visible = true; DropDownListAboneTipi.Visible = true; ButtonKaydet.Visible = true; } else { ScriptManager.RegisterClientScriptBlock(this, GetType(), "alertMessage", "alert('Aradığınız abone bulunamamıştır.')", true); } }
protected void ButtonSil_Click(object sender, EventArgs e) { int aboneNo = int.Parse(TxtAboneNo.Text); AboneRepository.DeleteAbone(aboneNo); Response.Redirect("TumAboneler.aspx"); }
protected void ButtonEkle_Click(object sender, EventArgs e) { Fatura yeniFatura = new Fatura(); yeniFatura.AboneID = int.Parse(TxtAboneNo.Text); yeniFatura.OncekiSayac = int.Parse(TextBoxOnceki.Text); yeniFatura.GuncelSayac = int.Parse(TextBoxGuncel.Text); yeniFatura.FaturaTarihi = Convert.ToDateTime(TxtCalendar.Text); int _AboneTuruID = AboneRepository.FindAboneTuruID(yeniFatura.AboneID).AboneTuruID; yeniFatura.OdemeTutari = (decimal)yeniFatura.OdemeHesapla(_AboneTuruID); FaturaRepository.AddFatura(yeniFatura); Response.Redirect("TumFaturalar.aspx"); }
protected void kaydet_Click(object sender, EventArgs e) { Abone yeniAbone = new Abone(); yeniAbone.AboneAdSoyad = TxtAdSoyad.Text; if (DropDownListAboneTipi.SelectedIndex == 0) { yeniAbone.AboneTuruID = 1; } else { yeniAbone.AboneTuruID = 2; } AboneRepository.AddAbone(yeniAbone); Response.Redirect("TumAboneler.aspx"); }
protected void ButtonKaydet_Click(object sender, EventArgs e) { Abone degisenAbone = new Abone(); degisenAbone.AboneID = int.Parse(AboneNo.Value); degisenAbone.AboneAdSoyad = TxtAdSoyad.Text; if (DropDownListAboneTipi.SelectedIndex == 0) //Ev { degisenAbone.AboneTuruID = 1; } else { degisenAbone.AboneTuruID = 2; } AboneRepository.UpdateAbone(degisenAbone); Response.Redirect("TumAboneler.aspx"); }
protected void ButtonAra_Click(object sender, EventArgs e) { TxtAdSoyad.Text = string.Empty; TextBoxAboneTipi.Text = string.Empty; int aboneNo = int.Parse(TxtAboneNo.Text); var result = AboneRepository.GetViewAbone(aboneNo); if (result != null) { TxtAdSoyad.Text = result.AboneAdSoyad; TextBoxAboneTipi.Text = result.AboneTuruAd; LabelAdSoyad.Visible = true; TxtAdSoyad.Visible = true; LabelTip.Visible = true; TextBoxAboneTipi.Visible = true; ButtonSil.Visible = true; } else { ScriptManager.RegisterClientScriptBlock(this, GetType(), "alertMessage", "alert('Aradığınız abone bulunamamıştır.')", true); } }
protected void Page_Load(object sender, EventArgs e) { Repeater1.DataSource = AboneRepository.GetAllAbones(); Repeater1.DataBind(); }