protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int DonorID = Convert.ToInt32(Session["ID"].ToString()); RecordsDAO recordsDAO = new RecordsDAO(); DonationGrid.DataSource = recordsDAO.ShowList(DonorID); DonationGrid.DataBind(); } }
public ActionResult Delete(int id, FormCollection collection) { try { RecordsDAO r = new RecordsDAO(); r.DeleteRecord(id); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }
protected void AddButton_Click(object sender, EventArgs e) { string date = DateBox.Text; string donatedTo = DonatedList.SelectedValue; string recipientName = NameBox.Text; string recipientAddress = AddressBox.Text; int DonorID = Convert.ToInt32(Session["ID"].ToString()); RecordsDAO recordsDAO = new RecordsDAO(); recordsDAO.insertRecord(new RecordsDTO(DonorID, date, donatedTo, recipientName, recipientAddress)); Session["Email"] = Session["Email"].ToString(); Response.Redirect("DonationHistory.aspx"); }
// GET: Home/Delete/5 public ActionResult Delete(int id) { RecordsDAO r = new RecordsDAO(); return(View(r.getById(id))); }