protected void gvwSecenek_RowCommand(object sender, GridViewCommandEventArgs e)
    {

        if (e.CommandName == "SecenekKaydet")
        {
            string index = e.CommandArgument.ToString();
            string secenekYeni = "";

            foreach (GridViewRow item in gvwSecenek.Rows)
            {
                if (item.RowType == DataControlRowType.DataRow)
                {
                    if (gvwSecenek.DataKeys[item.RowIndex].Value.ToString() == index)
                    {
                        secenekYeni = (item.FindControl("txtSecenekDuzenle") as TextBox).Text;
                        break;
                    }
                }
            }

            service = new SecenekService(ddlSecenekler.SelectedValue);

            service.Update(new Secenek
            {
                Value = secenekYeni,
                Name = index
            });
        }
        else if (e.CommandName == "SecenekSil")
        {
            string index = e.CommandArgument.ToString();
            service = new SecenekService(ddlSecenekler.SelectedValue);
            service.Delete(index);

            SecenkListele(ddlSecenekler.SelectedValue);
        }
    }
    protected void btnSecenekEkle_Click(object sender, EventArgs e)
    {
        try
        {
            service  = new SecenekService(ddlSecenekler.SelectedValue);
            service.Add(txtSecenek.Text);

            SecenkListele(ddlSecenekler.SelectedValue);
        }
        catch (Exception ex)
        {
            mesajGosterSis("Hata:", ex);
        }
    }