Manage Users - search

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
kastnerd
Commodore (COMO)
Commodore (COMO)
Posts: 474
Joined: Wed Oct 22, 2008 9:17 am

Manage Users - search

Post by kastnerd » Thu Oct 22, 2009 9:03 am

On the manager Users page, The search fields are very picky, If the user name is Peter, pete wont work. If the company is Black Water, Black wont find them.

Any way to change this?

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Manage Users - search

Post by AbleMods » Thu Oct 22, 2009 10:18 am

Use a wildcard asterisk after the Pete like "Pete*" to find them.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

kastnerd
Commodore (COMO)
Commodore (COMO)
Posts: 474
Joined: Wed Oct 22, 2008 9:17 am

Re: Manage Users - search

Post by kastnerd » Fri Oct 23, 2009 7:56 am

Can I add company name to this display list on the search page?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Manage Users - search

Post by mazhar » Fri Oct 23, 2009 8:22 am

Yep its simple to add company name to list. Just edit the Website/admin/people/default.aspx and locate following code block

Code: Select all

<asp:TemplateField HeaderText="Name" SortExpression="A.LastName">
                        <HeaderStyle horizontalalign="Left" />
                        <ItemStyle horizontalalign="Left" />
                        <ItemTemplate>
                            <asp:Label ID="FullNameLabel" runat="server" Text='<%#GetFullName(Container.DataItem)%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
and replace it with this one

Code: Select all

<asp:TemplateField HeaderText="Name" SortExpression="A.LastName">
                        <HeaderStyle horizontalalign="Left" />
                        <ItemStyle horizontalalign="Left" />
                        <ItemTemplate>
                            <asp:Label ID="FullNameLabel" runat="server" Text='<%#GetFullName(Container.DataItem)%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Company" SortExpression="A.Company">
                        <HeaderStyle horizontalalign="Left" />
                        <ItemStyle horizontalalign="Left" />
                        <ItemTemplate>
                            <asp:Label ID="CompanyNameLabel" runat="server" Text='<%#GetCompanyName(Container.DataItem)%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
and finally add following method to its code file next to GetFullName method

Code: Select all

protected string GetCompanyName(object dataItem)
    {
        User user = (User)dataItem;
        Address address = user.PrimaryAddress;
        if (address != null)
        {
            if (!string.IsNullOrEmpty(address.Company))
                return address.Company;
        }
        return string.Empty;
    }

kastnerd
Commodore (COMO)
Commodore (COMO)
Posts: 474
Joined: Wed Oct 22, 2008 9:17 am

Re: Manage Users - search

Post by kastnerd » Wed Oct 28, 2009 7:54 am

Thanks I did it on both admin/orders/create/createorders1.asp and admin/people/users/default.asp worked good.

Irfan
Ensign (ENS)
Ensign (ENS)
Posts: 1
Joined: Tue Oct 04, 2011 7:02 pm

Re: Manage Users - search

Post by Irfan » Mon Nov 07, 2011 9:24 pm

Thanks Mazhar,

Very helpful solution.

Regards,
Irfan Kadri

Post Reply