private void DisplayAuthorizedMembers(Account accountToView) { //Get the members list and then display them in the gridview AuthorizedMemberList aMemberList = new AuthorizedMemberList(); aMemberList = AuthorizedMemberManager.GetListByAccountID(accountToView.AccountID); //diplay the members in the gridview gViewMembers.DataSource = aMemberList; gViewMembers.DataBind(); }
protected void lnkAddAuthMember_OnCommand(object sender, CommandEventArgs e) { AuthorizedMember aMember = new AuthorizedMember(); aMember.AccountID = _accountID; aMember.Firstname = (fviewAuthorizedMember.FindControl("txtFname") as TextBox).Text.Trim(); aMember.Lastname = (fviewAuthorizedMember.FindControl("txtLname") as TextBox).Text.Trim(); aMember.RelationToAccountOwner = (fviewAuthorizedMember.FindControl("txtRelation") as TextBox).Text.Trim(); aMember.CreatedBy = User.Identity.Name.ToString(); //save AuthorizedMemberManager.Save(aMember); //clear the fields (fviewAuthorizedMember.FindControl("txtLname") as TextBox).Text = ""; (fviewAuthorizedMember.FindControl("txtFname") as TextBox).Text = ""; (fviewAuthorizedMember.FindControl("txtRelation") as TextBox).Text = ""; //display in gridview gViewMembers.DataSource = AuthorizedMemberManager.GetListByAccountID(_accountID); gViewMembers.DataBind(); }