Subversion Repository Public Repository

ChrisCompleteCodeTrunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<%@ Page Title="Search Customers" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" 
    CodeBehind="SearchCustomers.aspx.cs" Inherits="CRMPortal.SearchCustomers" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <div class="confirmLink">This customer does not belong to you.  If you would like to submit 
        this customer's information to the administrator to consider reassigning it to you, click 
        the 'Notify Admin' button.</div>
    <div class="errorDialog">An error has occurred.</div>
    <script>
        $('.atcNav').removeClass('active');
        $('#searchCustomersNav').addClass('active');

        var user;
        var id;
        function notifyAdmin() {
            var xmlhttp = new XMLHttpRequest();
            //xmlhttp = createXMLHttpRequest();
            xmlhttp.open("POST", "NotifyAdmin.aspx", true);
            xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
            xmlhttp.send("id=" + window.id + "&user=" + window.user+"&type="+window.ctype);
            $(".confirmLink").dialog("close");
        }

        function showNotify(id, user, type) {
            window.user = user;
            window.id = id;
            window.ctype = type;
            $(".confirmLink").dialog("open");
        }

        $(function () {
            $(".confirmLink")
                .dialog({
                    autoOpen: false,
                    modal: true,
                    buttons: {
                        "Notify Admin": function () { notifyAdmin(); },
                        "Ok": function () {
                            $(this).dialog("close");
                        }
                    }
                });
            $('.errorDialog')
                .dialog({
                    autoOpen: false,
                    modal: true,
                    buttons: {
                        "Ok": function () {
                            $(this).dialog('close');
                        }
                    }
                })
        });
    </script>

    <h2>Search Existing Customers</h2>
    <table class="table table-responsive">
    <tr>
    <td>Customer Name:</td>
    <td>
        <asp:TextBox CssClass="textBox" ID="tbCustomerName" runat="server"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td>Phone Number:</td>
    <td>
        <asp:TextBox CssClass="textBox" ID="tbPhone" runat="server"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td>Address:</td>
    <td>
        <asp:TextBox CssClass="textBox" ID="tbAddress" runat="server"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td>Address 2:</td>
    <td>
        <asp:TextBox CssClass="textBox" ID="tbAddress2" runat="server"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td>City:</td>
    <td>
        <asp:TextBox CssClass="textBox" ID="tbCity" runat="server"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td>State:</td>
    <td>
        <asp:TextBox CssClass="textBox" ID="tbState" runat="server"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td>Salesperson:</td>
    <td>
        <asp:TextBox CssClass="textBox" ID="tbSalesperson" runat="server"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td colspan="2">
        &nbsp;&nbsp;
    </td>
    </tr>
    <tr>
        <td>
            <asp:CheckBox ID="cbShowAll" runat="server" Text="Show All Results" />
        </td>
        <td>
            <asp:Button ID="btnQuery" class="aspButton" runat="server" Text="Search"
            style="text-align: center" Width="132px" onclick="btnQuery_Click" CssClass="btn btn-default"/> 
        </td>
    </tr>
    </table>
        <asp:Label ID="lblError" runat="server" Text="..." ForeColor="Red"></asp:Label>
        <asp:Label ID="lblPage" runat="server" Text="1" Visible="False"></asp:Label>
        <table ID="tblPage" class="table table-responsive" runat="server">
        <tr>
            <td class="ListHeader" id="tdPrev" runat="server">
                <asp:Button ID="btnPrevPage" runat="server" onclick="btnPrevPage_Click" 
                    Text="Previous Page" CssClass="btn btn-danger btn-sm"/>
            </td>
            <td class="ListHeader" ID="tdPage" runat="server">Page 1</td>
            <td class="ListHeader" id="tdNext" runat="server">
                <asp:Button ID="btnNextPage" runat="server" onclick="btnNextPage_Click" 
                    Text="Next Page" CssClass="btn btn-danger btn-sm" />
            </td>
        </tr>
        </table>

        <table ID="tblCustomers" class="table table-responsive" runat="server">
        <tr>
            <td class="ListHeader">NAME</td>
            <td class="ListHeader">LAST ORDER</td>
            <td class="ListHeader">Owner</td>
            <td class="ListHeader">Phone</td>
            <td class="ListHeader">City</td>
            <td class="ListHeader">State</td>
        </tr>
        </table>
    <script>
        var currentPosition;

        function getLocation() {
            if (navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(showPosition, showLocationError);
            } else {
                errorDialog("This web browser does not support geolocation.  Google Chrome is the recommended browser for this website.");
                //TODO: Show an error dialog that this browser doesn't support geolocation
            }
        }
        function showPosition(position) {
            currentPosition = position;
            alert('Latitude: ' + position.coords.latitude + '\nLongitude: ' + position.coords.longitude);
        }
        function getNearbyCustomers()
        {
            
        }
        function showLocationError(error) {
            switch (error.code) {
                case error.PERMISSION_DENIED:
                    errorDialog("User denied the request for Geolocation.");
                    break;
                case error.POSITION_UNAVAILABLE:
                    errorDialog("Your location information is unavailable.");
                    break;
                case error.TIMEOUT:
                    errorDialog("The request to get your location timed out.");
                    break;
                case error.UNKNOWN_ERROR:
                    errorDialog("An unknown error occurred while trying to determine your location.");
                    break;
            }
        }
        function errorDialog(text) {
            $('.errorDialog').text(text)
            $('.errorDialog').dialog('open');
        }
    </script>
</asp:Content>

Commits for ChrisCompleteCodeTrunk/ATCCRMPortal/CRMPortal/SearchCustomers.aspx

Diff revisions: vs.
Revision Author Commited Message
1 BBDSCHRIS picture BBDSCHRIS Wed 22 Aug, 2018 20:08:03 +0000