Ejemplo n.º 1
0
    protected void btnsubmit_Click(object sender, EventArgs e)
    {
        obj.Heading      = txthead.Text;
        obj.HospitalName = txthosname.Text;
        obj.Descripton   = txtdis.Text;
        obj.DateTime     = txtdate.Text;
        obj.Axis         = txtaxis.Text;
        obj.Duration     = txtduration.Text;
        obj = db.Tb_Events.Add(obj);
        db.SaveChanges();

        Response.Redirect("~/Admin/ShowEvents.aspx?msg=" + "Svd");
    }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         int id = Convert.ToInt32(hdndel.Value);
         obj = db.Tb_Events.Where(z => z.Id == id).FirstOrDefault();
         db.Tb_Events.Remove(obj);
         db.SaveChanges();
         Response.Redirect("~/Admin/ShowEvents.aspx?msg=" + "Dlt");
     }
     catch (Exception ex)
     {
     }
 }