Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DropWriter.DataSource     = WriterRespositery.GetAllWriter();
         DropWriter.DataTextField  = "WriterName";
         DropWriter.DataValueField = "WriterID";
         DropWriter.DataBind();
     }
 }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["ID"] != null && !IsPostBack)
     {
         int id     = int.Parse(Request.QueryString["ID"]);
         var result = WriterRespositery.GetWriter(id);
         BtnKaydet.CssClass = "btn-btn-success btn-block";
         BtnKaydet.Text     = "Update";
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["ID"] != null)
     {
         int id = int.Parse(Request.QueryString["ID"]);
         WriterRespositery.DeleteWriter(id);
         Response.Redirect("WriterList.Aspx");
     }
     Repeater1.DataSource = WriterRespositery.GetAllWriter();
     Repeater1.DataBind();
 }
Beispiel #4
0
        protected void BtnKaydet_Click(object sender, EventArgs e)
        {
            Writer writer = new Writer();

            writer.WriterName = TextBoxWriterName.Text;
            if (BtnKaydet.Text == "Güncelle")
            {
                int id = int.Parse(Request.QueryString["ID"]);
                WriterRespositery.UpdateWriter(id, TextBoxWriterName.Text);
                else
                {
                    WriterRespositery.AddWriter(writer);
                    Response.Redirect("WriterList.aspx");
                }
            }