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();
     }
 }
Example #2
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         RecordsDAO r = new RecordsDAO();
         r.DeleteRecord(id);
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         return(View());
     }
 }
Example #3
0
    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");
    }
Example #4
0
        // GET: Home/Delete/5
        public ActionResult Delete(int id)
        {
            RecordsDAO r = new RecordsDAO();

            return(View(r.getById(id)));
        }