protected void Button1_Click(object sender, EventArgs e) { if (txt_kullaniciAdi.Text.Trim() == "" || txt_kullaniciAdi.Text.Trim() == "" || DropDownList1.Text == "Seçiniz") { Response.Write("<script language='javascript'>alert('Lütfen alanları kontrol ediniz!');</script>"); } else { DataRow dr = pc.GetPersonelId(DropDownList1.Text); int personelId = Utils.ConvertToInt(dr["PersonelID"].ToString()); if (Button1.Text == "EKLE") { kc.Insert(txt_kullaniciAdi.Text, txt_sifre.Text, "Normal", personelId); Response.Write("<script language='javascript'>alert('Ekleme işlemi başarıyla gerçekleşti!');</script>"); } else { var id = Utils.ConvertToInt(Request.QueryString["KullaniciID"]); kc.Update(txt_kullaniciAdi.Text, txt_sifre.Text, id, personelId); Response.Write("<script language='javascript'>alert('Güncelleme işlemi başarıyla gerçekleşti!');</script>"); Button1.Text = "EKLE"; txt_kullaniciAdi.Text = ""; txt_sifre.Text = ""; } BindGrid(0); } }