protected void Button1_Click(object sender, EventArgs e) { Session["total"] = (Convert.ToInt32(txt_tution.Text) + Convert.ToInt32(txt_sprt.Text) + Convert.ToInt32(txt_other.Text) + Convert.ToInt32(txt_exfrm.Text) + Convert.ToInt32(txt_exam.Text) + Convert.ToInt32(txt_lib.Text)); txt_amnt.Text = Session["total"].ToString(); headsDataContext db = new headsDataContext(); Head_detail hd = new Head_detail(); hd.Fee_id = Convert.ToInt32(txt_id.Text); hd.Course = DropDownList_course.Text; hd.sem = Convert.ToByte(DropDownList_sem.Text); hd.Tution_fee = Convert.ToDecimal(txt_tution.Text); hd.Sport_culture_fee = Convert.ToDecimal(txt_sprt.Text); hd.Other_fee = Convert.ToDecimal(txt_other.Text); hd.Exam_fee = Convert.ToDecimal(txt_exam.Text); hd.Exam_form_fee = Convert.ToDecimal(txt_exfrm.Text); hd.Amount = Convert.ToDecimal(txt_amnt.Text); hd.Library_fee = Convert.ToDecimal(txt_lib.Text); db.Head_details.InsertOnSubmit(hd); db.SubmitChanges(); Response.Redirect("heads.aspx"); }
protected void btn_yes_Click(object sender, EventArgs e) { headsDataContext db = new headsDataContext(); var qry = from m in db.Head_details where m.Fee_id == Convert.ToInt32(Request.QueryString["id"].ToString()) select m; foreach (var q in qry) { db.Head_details.DeleteOnSubmit(q); } db.SubmitChanges(); Response.Redirect("heads.aspx"); }