protected void HandlerClearSearchStudents(object sender, EventArgs e)
    {
        var borrowers = new BorrowerCollection();

        borrowers.FilterBorrowerById("");
        rptAllAccounts.DataSource = borrowers.BorrowerList;
        rptAllAccounts.DataBind();
    }
    protected void HandlerSearchStudents(object sender, EventArgs e)
    {
        var borrowers = new BorrowerCollection();

        borrowers.FilterByFirstAndLastNameAndId(txtBorrowerId.Text, txtFirstName.Text, txtLastName.Text);
        rptAllAccounts.DataSource = borrowers.BorrowerList;
        rptAllAccounts.DataBind();
    }
    protected void HandlerUpdateSuspendAccount(object sender, EventArgs e)
    {
        var borrowers = new BorrowerCollection();
        var account   = borrowers.Borrower;

        account.Find(_borrowerId);
        account.Status = rdSuspended.Checked ? "Suspended" : "Live";
        borrowers.Update();
        Response.Redirect("BookManagement.aspx");
    }
示例#4
0
    protected void HandlerSaveDetails(object sender, EventArgs e)
    {
        var accounts = new BorrowerCollection();
        var account  = accounts.Borrower;

        account.Find(txtUserId.Text);
        account.Address1  = txtAddress1.Text;
        account.Address2  = txtAddress2.Text;
        account.Address3  = txtAddress3.Text;
        account.TelNumber = txtTel.Text;
        account.Email     = txtEmail.Text;

        accounts.Update();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         var borrowers = new BorrowerCollection();
         borrowers.FilterBorrowerById("");
         rptAllAccounts.DataSource = borrowers.BorrowerList;
         rptAllAccounts.DataBind();
         var liveList      = (from Borrower borrower in borrowers.BorrowerList where borrower.Status.Trim() == "Live" select borrower);
         var suspendedList = (from Borrower borrower in borrowers.BorrowerList where borrower.Status.Trim() == "Suspended" select borrower);
         rptLiveAccounts.DataSource      = liveList;
         rptSuspendedAccounts.DataSource = suspendedList;
         rptLiveAccounts.DataBind();
         rptSuspendedAccounts.DataBind();
     }
 }