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();
     }
 }
예제 #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());
     }
 }
예제 #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");
    }
예제 #4
0
        // GET: Home/Delete/5
        public ActionResult Delete(int id)
        {
            RecordsDAO r = new RecordsDAO();

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