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
@using ActionTireCo.Crm.Model.Database
@model List<ActionTireCo.Crm.Model.Database.Customer>
@{
    ViewBag.Title = "Action Tire Company - Customer";
}


<div class="container">
    @{
        int totalItems = Int32.Parse(Request["totalItems"]);
        int itemsPerPage = Int32.Parse(System.Configuration.ConfigurationManager.AppSettings["itemsPerPage"]);
        int page = Int32.Parse(Request["page"]);
        int prevPage = (page == 0) ? 0 : (page - 1);
        int numButtons = (totalItems / itemsPerPage) + 1;
        int nextPage = (page == numButtons) ? numButtons : page + 1;

        <div class="row">
            <div class="col-12">

                <div class="form-group">
                    <input type="text" class="form-control" id="customerSearchName" placeholder="Customer Name" value="@Request.QueryString["customerName"]" />
                </div>

                <div class="form-group">
                    <input type="text" class="form-control" id="customerSearchPhone" placeholder="Customer Phone" value="@Request.QueryString["customerPhone"]" />
                </div>

                <div class="form-group">
                    <input type="text" class="form-control" id="customerSearchAddress1" placeholder="Address Line 1" value="@Request.QueryString["customerAddress1"]" />
                </div>

                <div class="form-group">
                    <input type="text" class="form-control" id="customerSearchAddress2" placeholder="Address Line 2" value="@Request.QueryString["customerAddress2"]" />
                </div>

                <div class="form-group">
                    <input type="text" class="form-control" id="customerSearchCity" placeholder="Customer City" value="@Request.QueryString["customerCity"]" />
                </div>

                <div class="form-group">
                    <input type="text" class="form-control" id="customerSearchState" placeholder="Customer State" value="@Request.QueryString["customerState"]" />
                </div>

                <div class="form-group">
                    <label class="custom-control-label" for="customerType">Customer Type</label>
                    <select id="customerType" class="custom-select">
                        @if (Request.QueryString["customerType"] == null || Request.QueryString["customerType"] == String.Empty || Request.QueryString["customerType"] == "0")
                        {
                            <option value="0" selected>Both</option>
                        }
                        else
                        {
                            <option value="0">Both</option>
                        }
                        @if (Request.QueryString["customerType"] == "1")
                        {
                            <option value="1" selected>Customer</option>
                        }
                        else
                        {
                            <option value="1">Customer</option>
                        }
                        @if (Request.QueryString["customerType"] == "2")
                        {
                            <option value="2" selected>Prospect</option>
                        }
                        else
                        {
                            <option value="2">Prospect</option>
                        }

                    </select>
                </div>

                <div class="form-group">
                    <label class="custom-control-label" for="userType">Assigned Salesman</label>
                    <select id="userType" class="custom-select">
                        @if (Request.QueryString["customerAssigned"] == null || Request.QueryString["userType"] == String.Empty || Request.QueryString["userType"] == "0")
                        {
                            <option value="0" selected>Assigned To All</option>
                        }
                        else
                        {
                            <option value="0">Assigned To All</option>
                        }
                        @if (Request.QueryString["customerAssigned"] == "1")
                        {
                            <option value="1" selected>Assigned To Me</option>
                        }
                        else
                        {
                            <option value="1">Assigned To Me</option>
                        }
                    </select>
                </div>

            </div>
        </div>

        <div class="row">
            <dov class="col-6"></dov>
            <div class="col-2"><button type="button" class="btn form-control btn-primary" id="buttonSearchCustomer">Search</button></div>
            <div class="col-2"><a class="btn-link" href="#" data-toggle="modal" data-target="#modalCustomer">Add Prospect</a></div>
            <div class="col-1"><button id="btnPageBackward" type="button" class="btn-sm btn-primary float-right" onclick="window.location.href='/Customer?totalItems=@totalItems&page=@prevPage&itemsPerPage=@itemsPerPage'">&#60;&#60;</button></div>
            <div class="col-1"><button id="btnPageForward" type="button" class="btn-sm btn-primary float-right" onclick="window.location.href='/Customer?totalItems=@totalItems&page=@nextPage&itemsPerPage=@itemsPerPage'">&#62;&#62;</button></div>

        </div>
    }
    <div class="row" style="padding-bottom: 20px;"></div>
    <div class="row">
        <div class="col-12">
            <table id="customers" class="table table-striped table-bordered" style="width:100%">
                <thead>
                    <tr>
                        <th>Name</th>
                        <th>Type</th>
                        <th>Owner</th>
                        <th>Address 1</th>
                        <th>Address 2</th>
                        <th>City</th>
                        <th>State</th>
                        <th>Zip</th>
                        <th>Phone</th>
                    </tr>
                </thead>
                <tbody>
                    @{ if (Model != null)
                        {
                            foreach (var customer in @Model)
                            {
                                <tr>
                                    <td>
                                        <a href="~/Customer/Edit?CustomerId=@customer.Id">@customer.Name</a>
                                    </td>
                                    <td>
                                        @customer.CustomerType.Value
                                    </td>
                                    <td>
                                        @customer.User.Name
                                    </td>
                                    <td>
                                        @customer.AddressLine1
                                    </td>
                                    <td>
                                        @customer.AddressLine2
                                    </td>
                                    <td>
                                        @customer.City
                                    </td>
                                    <td>
                                        @customer.State
                                    </td>
                                    <td>
                                        @customer.Zip
                                    </td>
                                    <td>
                                        @customer.Phone
                                    </td>
                                </tr>
                            }

                        }
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>

@Html.Partial("Customer", new Customer { Id = ActionTireCo.Crm.Controllers.CustomerController.GetNextProspectId() })

Commits for ChrisCompleteCodeTrunk/ActionTireCo/ActionTireCo.Crm/Views/Customer/Index.cshtml

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