-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPositions.aspx
270 lines (268 loc) · 18.2 KB
/
Positions.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
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Positions.aspx.cs" Inherits="Positions" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.auto-style1 {
width: 100%;
}
.auto-style2 {
height: 23px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table align="center" dir="rtl" class="Table90P">
<tr>
<td align="right">
<asp:Label ID="Label8" runat="server" CssClass="BigLabel" Text="پست سازمانی خالی"></asp:Label>
</td>
<td align="left">
<asp:ImageButton ID="imgbHome" runat="server" Height="60px" ImageUrl="~/Images/Home2.png" Width="60px" OnClick="imgbHome_Click" />
<asp:ImageButton ID="imgbExit" runat="server" ImageUrl="~/Images/exit2.JPG" OnClick="imgbExit_Click" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:SqlDataSource ID="SqlDataSourceEmptyP" runat="server" ConnectionString="<%$ ConnectionStrings:KSHDBConnectionString %>" SelectCommand="SELECT Positions.PositionID, Positions.Position, Positions.UnitID, Unit.UnitName FROM Positions INNER JOIN Unit ON Positions.UnitID = Unit.UnitID WHERE (Positions.PersonID IS NULL)"></asp:SqlDataSource>
</td>
</tr>
<tr>
<td colspan="2">
<asp:GridView ID="GridViewEmpty" runat="server" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" CssClass="label" DataKeyNames="PositionID" DataSourceID="SqlDataSourceEmptyP" ForeColor="Black" GridLines="Vertical" PageSize="25" Width="100%">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="UnitID" HeaderText="کد واحد سازمانی" SortExpression="UnitID" />
<asp:BoundField DataField="UnitName" HeaderText="نام واحد سازمانی" SortExpression="UnitName" />
<asp:BoundField DataField="Position" HeaderText="عنوان پست سازمانی" SortExpression="Position" />
<asp:BoundField DataField="PositionID" HeaderText="شماره پست سازمانی" ReadOnly="True" SortExpression="PositionID" />
</Columns>
<FooterStyle BackColor="#CCCC99" />
<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
<RowStyle BackColor="#F7F7DE" />
<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FBFBF2" />
<SortedAscendingHeaderStyle BackColor="#848384" />
<SortedDescendingCellStyle BackColor="#EAEAD3" />
<SortedDescendingHeaderStyle BackColor="#575357" />
</asp:GridView>
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td colspan="2" align="right">
<asp:Label ID="Label3" runat="server" CssClass="BigLabel" Text="واحد سازمانی"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<asp:SqlDataSource ID="SqlDataSourceUnit" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:KSHDBConnectionString %>" DeleteCommand="DELETE FROM [Unit] WHERE [UnitID] = @original_UnitID AND [UnitName] = @original_UnitName" InsertCommand="INSERT INTO [Unit] ([UnitName]) VALUES (@UnitName)" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [Unit]" UpdateCommand="UPDATE [Unit] SET [UnitName] = @UnitName WHERE [UnitID] = @original_UnitID AND [UnitName] = @original_UnitName">
<DeleteParameters>
<asp:Parameter Name="original_UnitID" Type="Int32" />
<asp:Parameter Name="original_UnitName" Type="String" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="UnitName" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="UnitName" Type="String" />
<asp:Parameter Name="original_UnitID" Type="Int32" />
<asp:Parameter Name="original_UnitName" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td>
<asp:GridView ID="GridViewUnit" runat="server" AllowPaging="True" AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2" CssClass="label" DataKeyNames="UnitID" DataSourceID="SqlDataSourceUnit" ForeColor="Black" PageSize="20" Width="100%">
<Columns>
<asp:CommandField CancelText="انصراف" DeleteText="حذف" EditText="ویرایش" ShowDeleteButton="True" ShowEditButton="True" UpdateText="تایید" >
<ControlStyle ForeColor="Maroon" />
</asp:CommandField>
<asp:BoundField DataField="UnitID" HeaderText="کد واحد" InsertVisible="False" ReadOnly="True" SortExpression="UnitID" />
<asp:BoundField DataField="UnitName" HeaderText="نام واحد" SortExpression="UnitName" />
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
<RowStyle BackColor="White" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#808080" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#383838" />
</asp:GridView>
</td>
<td align="center">
<asp:FormView ID="FormViewUnit" Width="100%" runat="server" DataKeyNames="UnitID" DataSourceID="SqlDataSourceUnit" HorizontalAlign="Center">
<EditItemTemplate>
UnitID:
<asp:Label ID="UnitIDLabel1" runat="server" Text='<%# Eval("UnitID") %>' />
<br />
UnitName:
<asp:TextBox ID="UnitNameTextBox" runat="server" Text='<%# Bind("UnitName") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<InsertItemTemplate>
<table align="center" class="auto-style1" dir="rtl">
<tr>
<td>
<asp:Label ID="Label2" runat="server" CssClass="label" Text="عنوان واحد"></asp:Label>
<br /> </td>
<td>
<asp:TextBox ID="UnitNameTextBox0" runat="server" Text='<%# Bind("UnitName") %>' Width="400px" />
</td>
</tr>
<tr>
<td>
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" CssClass="RedLbl" Text="تایید" />
<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" CssClass="greenLbl" Text="انصراف" />
</td>
<td> </td>
</tr>
</table>
</InsertItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New" CssClass="RedLbl" Text="تعریف واحد جدید" />
</ItemTemplate>
</asp:FormView>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" align="right">
<asp:Label ID="Label1" runat="server" CssClass="BigLabel" Text="پست سازمانی"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<asp:SqlDataSource ID="SqlDataSourcePosition" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:KSHDBConnectionString %>" DeleteCommand="DELETE FROM [Positions] WHERE [PositionID] = @original_PositionID AND [Position] = @original_Position AND (([PersonID] = @original_PersonID) OR ([PersonID] IS NULL AND @original_PersonID IS NULL)) AND (([UnitID] = @original_UnitID) OR ([UnitID] IS NULL AND @original_UnitID IS NULL))" InsertCommand="INSERT INTO [Positions] ([PositionID], [Position], [PersonID], [UnitID]) VALUES (@PositionID, @Position, @PersonID, @UnitID)" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [Positions]" UpdateCommand="UPDATE [Positions] SET [Position] = @Position, [PersonID] = @PersonID, [UnitID] = @UnitID WHERE [PositionID] = @original_PositionID AND [Position] = @original_Position AND (([PersonID] = @original_PersonID) OR ([PersonID] IS NULL AND @original_PersonID IS NULL)) AND (([UnitID] = @original_UnitID) OR ([UnitID] IS NULL AND @original_UnitID IS NULL))">
<DeleteParameters>
<asp:Parameter Name="original_PositionID" Type="String" />
<asp:Parameter Name="original_Position" Type="String" />
<asp:Parameter Name="original_PersonID" Type="Int32" />
<asp:Parameter Name="original_UnitID" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="PositionID" Type="String" />
<asp:Parameter Name="Position" Type="String" />
<asp:Parameter Name="PersonID" Type="Int32" />
<asp:Parameter Name="UnitID" Type="Int32" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Position" Type="String" />
<asp:Parameter Name="PersonID" Type="Int32" />
<asp:Parameter Name="UnitID" Type="Int32" />
<asp:Parameter Name="original_PositionID" Type="String" />
<asp:Parameter Name="original_Position" Type="String" />
<asp:Parameter Name="original_PersonID" Type="Int32" />
<asp:Parameter Name="original_UnitID" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td colspan="2">
<asp:GridView ID="GridViewPositin" runat="server" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" CssClass="label" DataKeyNames="PositionID" DataSourceID="SqlDataSourcePosition" ForeColor="Black" GridLines="Vertical" PageSize="25" Width="100%">
<AlternatingRowStyle BackColor="#CCCCCC" />
<Columns>
<asp:CommandField CancelText="انصراف" DeleteText="حذف" EditText="ویرایش" ShowDeleteButton="True" ShowEditButton="True" UpdateText="تایید" >
<ControlStyle ForeColor="Maroon" />
</asp:CommandField>
<asp:BoundField DataField="PositionID" HeaderText="شماره پست سازمانی" ReadOnly="True" SortExpression="PositionID" />
<asp:BoundField DataField="Position" HeaderText="عنوان پست سازمانی" SortExpression="Position" />
<asp:BoundField DataField="PersonID" HeaderText="کد شخص" SortExpression="PersonID" />
<asp:BoundField DataField="UnitID" HeaderText="کد واحد سازمانی" SortExpression="UnitID" />
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#808080" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#383838" />
</asp:GridView>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2">
<asp:FormView ID="FormViewPosition" Width="100%" runat="server" DataKeyNames="PositionID" DataSourceID="SqlDataSourcePosition">
<EditItemTemplate>
PositionID:
<asp:Label ID="PositionIDLabel1" runat="server" Text='<%# Eval("PositionID") %>' />
<br />
Position:
<asp:TextBox ID="PositionTextBox" runat="server" Text='<%# Bind("Position") %>' />
<br />
PersonID:
<asp:TextBox ID="PersonIDTextBox" runat="server" Text='<%# Bind("PersonID") %>' />
<br />
UnitID:
<asp:TextBox ID="UnitIDTextBox" runat="server" Text='<%# Bind("UnitID") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<InsertItemTemplate>
<table align="center" dir="rtl" class="Table90P">
<tr>
<td>
<asp:Label ID="Label4" runat="server" CssClass="label" Text="شماره پست سازمانی"></asp:Label>
</td>
<td>
<asp:TextBox ID="PositionIDTextBox" runat="server" Text='<%# Bind("PositionID") %>' />
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label5" runat="server" CssClass="label" Text="عنوان پست سازمانی"></asp:Label>
</td>
<td>
<asp:TextBox ID="PositionTextBox0" runat="server" Text='<%# Bind("Position") %>' Width="350px" />
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label7" runat="server" CssClass="label" Text="کد واحد سازمانی"></asp:Label>
</td>
<td>
<asp:TextBox ID="UnitIDTextBox0" runat="server" Text='<%# Bind("UnitID") %>' />
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label6" runat="server" CssClass="label" Text="کد شخص"></asp:Label>
</td>
<td>
<asp:TextBox ID="PersonIDTextBox0" runat="server" Text='<%# Bind("PersonID") %>' />
</td>
</tr>
<tr>
<td class="auto-style2">
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" CssClass="RedLbl" Text="تایید" />
<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" CssClass="greenLbl" Text="انصراف" />
</td>
<td class="auto-style2"></td>
</tr>
</table>
</InsertItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New" CssClass="RedLbl" Text="تعریف پست سازمانی جدید" />
</ItemTemplate>
</asp:FormView>
</td>
</tr>
</table>
</asp:Content>