protected void Del(object sender, EventArgs e) { var db = new LookUpDataContext(); db.nguvan_lookups.DeleteOnSubmit(db.nguvan_lookups.First(i => i.ID == ((LinkButton)sender).CommandArgument.ToInt())); db.SubmitChanges(); LoadData(); }
protected void bt_Update_Click(object sender, EventArgs e) { var datacontext = new LookUpDataContext(); LookUpDataContext db = new LookUpDataContext(); var userId = Request.QueryString["id"].ToInt(); nguvan_lookup c = db.nguvan_lookups.Single(i => i.ID == userId); c.Title = tbTitle.Text; c.Instructor = tbInstroctor.Text; c.Author = tb_Author.Text; c.Year = tbYear.Text; c.Keys = tbKey.InnerText; c.TabID = TabId; db.SubmitChanges(); Response.Redirect(BuildUrl("LookUp")); }