protected void btnGuncelle_Click(object sender, EventArgs e)
 {
     if (txtTCNo.Text.Length == 11)
     {
         if (!string.IsNullOrEmpty(txtTCNo.Text) & !string.IsNullOrEmpty(txtAdi.Text) & !string.IsNullOrEmpty(txtSoyadi.Text) & !string.IsNullOrEmpty(txtCepNo.Text) & !string.IsNullOrEmpty(txtAdres.Text))
         {
             EMembers guncellenecek = new EMembers();
             guncellenecek.ID        = int.Parse(Request.QueryString["memberID"]);
             guncellenecek.TCNo      = txtTCNo.Text;
             guncellenecek.FirstName = txtAdi.Text;
             guncellenecek.LastName  = txtSoyadi.Text;
             guncellenecek.Phone     = txtCepNo.Text;
             guncellenecek.Address   = txtAdres.Text;
             bool sonuc = BLLMembers.Update(guncellenecek);
             if (sonuc)
             {
                 Response.Write("<script>alert('Harika! Güncellendi!');</script>");
                 Response.Redirect("Uyeler.aspx?scs=1");
             }
             else
             {
                 Response.Write("<script>alert('Hay Aksi! Hata Oluştu!')</script>");
             }
         }
         else
         {
             Response.Write("<script>alert('Eksik bilgi girdiniz. Lütfen kontrol ediniz!')</script>");
         }
     }
     else
     {
         Response.Write("<script>alert('TC kimlik numarası 11 hane olmalıdır!')</script>");
     }
 }
Beispiel #2
0
        private void btnGuncelle_Click(object sender, EventArgs e)
        {
            if (seciliuye != null)
            {
                if (!string.IsNullOrEmpty(txtAd.Text) & !string.IsNullOrEmpty(txtSoyad.Text) & !string.IsNullOrEmpty(txtTCNo.Text) & !string.IsNullOrEmpty(txtCepNo.Text) & !string.IsNullOrEmpty(txtAdres.Text))
                {
                    if (txtTCNo.Text.Length == 11)
                    {
                        EMembers member = new EMembers();
                        member.ID        = seciliuye.ID;
                        member.TCNo      = txtTCNo.Text;
                        member.FirstName = txtAd.Text;
                        member.LastName  = txtSoyad.Text;
                        member.Phone     = txtCepNo.Text;
                        member.Address   = txtAdres.Text;

                        bool sonuc = BLLMembers.Update(member);
                        if (sonuc)
                        {
                            MessageBox.Show("Güncelleme başarılı!");
                            dataGridView1.DataSource = BLLMembers.GetAll();
                            Clear();
                        }
                        else
                        {
                            MessageBox.Show("Güncelleme başarısız oldu!");
                        }
                    }
                    else
                    {
                        MessageBox.Show("TC kimlik numarası 11 haneli olmalıdır!");
                    }
                }
                else
                {
                    MessageBox.Show("Eksik bilgi girdiniz. Lütfen kontrol ediniz!");
                }
            }
            else
            {
                MessageBox.Show("Güncelleme işlemini yapmak istidiğiniz yazarı seçiniz.");
            }
        }