-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreateManager.aspx
145 lines (141 loc) · 6.34 KB
/
CreateManager.aspx
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
<%@ Page Title="" Language="C#" MasterPageFile="~/MainMaster.master" AutoEventWireup="true" CodeFile="CreateManager.aspx.cs" Inherits="CreateManager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style>
.myddls {
align-items: center;
background-color: rgb(255, 255, 255);
border-bottom-color: rgb(204, 204, 204);
border-bottom-left-radius: 4px;
border-bottom-right-radius: 0px;
border-bottom-style: solid;
border-bottom-width: 1px;
border-collapse: collapse;
border-image-outset: 0px;
border-image-repeat: stretch;
border-image-slice: 100%;
border-image-source: none;
border-image-width: 1;
border-left-color: rgb(204, 204, 204);
border-left-style: solid;
border-left-width: 1px;
border-right-color: rgb(204, 204, 204);
border-right-style: solid;
border-right-width: 1px;
border-top-color: rgb(204, 204, 204);
border-top-left-radius: 4px;
border-top-right-radius: 0px;
border-top-style: solid;
border-top-width: 1px;
box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px 0px inset;
box-sizing: border-box;
color: rgb(85, 85, 85);
cursor: default;
display: inline-block;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
font-stretch: normal;
font-style: normal;
font-variant: normal;
font-weight: normal;
height: 34px;
letter-spacing: normal;
line-height: normal;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
max-width: 280px;
overflow-x: visible;
overflow-y: visible;
padding-bottom: 6px;
padding-left: 12px;
padding-right: 12px;
padding-top: 6px;
text-align: start;
text-indent: 0px;
text-rendering: auto;
text-shadow: none;
text-transform: none;
transition-delay: 0s, 0s;
transition-duration: 0.15s, 0.15s;
transition-property: border-color, box-shadow;
transition-timing-function: ease-in-out, ease-in-out;
vertical-align: middle;
white-space: pre;
width: 48px;
word-spacing: 0px;
writing-mode: horizontal-tb;
-webkit-appearance: menulist-button;
-webkit-rtl-ordering: logical;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<center>
<div>
<br />
<br />
<div class="input-group">
<div class="form-inline">
<h3 class="alert alert-info">Manager Management</h3>
<table border="0" cellpadding="5" cellspacing="5" class="table bg-success ">
<tr>
<td>
<span>User Name</span>
</td>
<td>
<span>Password </span>
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtStudentId" class="form-control" placeholder="User Name" required CssClass="form-control"/>
</td>
<td>
<asp:TextBox runat="server" ID="txtStudentName" class="form-control" placeholder="Password" required CssClass="form-control"/>
</td>
<td>
<asp:Button Text="Add User" runat="server" ID="btnAdd"
class="btn btn-sm btn-primary" OnClick="btnAdd_Click" />
</td>
</tr>
</table>
</div>
</div>
<br />
<br />
<asp:GridView ID="GridView1" runat="server"
CssClass="table table-responsive table-striped" AutoGenerateColumns="False"
DataKeyNames="UserId" DataSourceID="LibraryDb">
<Columns>
<asp:BoundField DataField="UserId" HeaderText="UserId"
SortExpression="UserId" ReadOnly="True" InsertVisible="False" Visible="False" />
<asp:BoundField DataField="UserName" HeaderText="User Name"
SortExpression="UserName" />
<asp:BoundField DataField="Pwd" HeaderText="Password" SortExpression="Pwd" />
<asp:CommandField ShowEditButton="True" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="LibraryDb" runat="server"
ConnectionString="<%$ ConnectionStrings:SalesConnectionString %>"
SelectCommand="SELECT * FROM [Users_Table] Where [Role]='Manager'"
DeleteCommand="DELETE FROM [Users_Table] WHERE [UserId] = @UserId"
UpdateCommand="UPDATE [Users_Table] SET [UserName] = @UserName, [Pwd] = @Pwd WHERE [UserId] = @UserId">
<DeleteParameters>
<asp:Parameter Name="UserId" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="UserName" Type="String" />
<asp:Parameter Name="Pwd" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="UserName" Type="String" />
<asp:Parameter Name="Pwd" Type="String" />
<asp:Parameter Name="UserId" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</div>
</center>
</asp:Content>