<script runat=
"server"
>
Protected
Sub
IpAdressTextBox_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
End
Sub
</script>
<h2>Přidat počítač</h2>
<br />
<moje:RedirectingSqlDataSource ID=
"SqlDataSource2"
runat=
"server"
RedirectAfterDataOperation=
"true"
ConnectionString=
"<%$ ConnectionStrings:EvidenceConnectionString %>"
DeleteCommand=
"DELETE FROM [Computers] WHERE [PcId] = @PcId"
InsertCommand="INSERT INTO [Computers] ([IpAdress], [LocationId], [NumberPc],
[Domain], [SerialNumber], [OperationSystem], [Software], [Hardware], [UserName]) VALUES (@IpAdress,
@LocationId, @NumberPc, @Domain, @SerialNumber, @OperationSystem, @Software, @Hardware, @UserName)"
SelectCommand=
"SELECT * FROM [Computers] WHERE ([LocationId] = @LocationId) ORDER BY [IpAdress]"
UpdateCommand="UPDATE [Computers] SET [IpAdress] = @IpAdress, [LocationId] = @LocationId,
[NumberPc] = @NumberPc, [Domain] = @Domain, [SerialNumber] = @SerialNumber, [OperationSystem] = @OperationSystem,
[Software] = @Software, [Hardware] = @Hardware, [UserName] = @UserName WHERE [PcId] = @PcId">
<SelectParameters>
<asp:QueryStringParameter Name=
"LocationId"
QueryStringField=
"id"
Type=
"Int32"
/>
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name=
"PcId"
Type=
"Int32"
/>
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name=
"IpAdress"
Type=
"String"
/>
<asp:QueryStringParameter Name=
"LocationId"
QueryStringField=
"id"
Type=
"Int32"
/>
<asp:Parameter Name=
"NumberPc"
Type=
"String"
/>
<asp:Parameter Name=
"Domain"
Type=
"String"
/>
<asp:Parameter Name=
"SerialNumber"
Type=
"String"
/>
<asp:Parameter Name=
"OperationSystem"
Type=
"String"
/>
<asp:Parameter Name=
"Software"
Type=
"String"
/>
<asp:Parameter Name=
"Hardware"
Type=
"String"
/>
<asp:Parameter Name=
"Date"
Type=
"DateTime"
/>
<my:UserNameParameter Name=
"username"
/>
<asp:Parameter Name=
"PcId"
Type=
"Int32"
/>
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name=
"IpAdress"
Type=
"String"
/>
<asp:QueryStringParameter Name=
"LocationId"
QueryStringField=
"id"
Type=
"Int32"
/>
<asp:Parameter Name=
"NumberPc"
Type=
"String"
/>
<asp:Parameter Name=
"Domain"
Type=
"String"
/>
<asp:Parameter Name=
"SerialNumber"
Type=
"String"
/>
<asp:Parameter Name=
"OperationSystem"
Type=
"String"
/>
<asp:Parameter Name=
"Software"
Type=
"String"
/>
<asp:Parameter Name=
"Hardware"
Type=
"String"
/>
<my:UserNameParameter Name=
"username"
/>
</InsertParameters>
</moje:RedirectingSqlDataSource>
<asp:FormView ID=
"FormView1"
runat=
"server"
DataKeyNames=
"PcId"
DataSourceID=
"SqlDataSource2"
DefaultMode=
"Insert"
>
<InsertItemTemplate>
<table>
<tr>
<td>Ip adresa:</td>
<td><asp:TextBox ID=
"IpAdressTextBox"
runat=
"server"
Text=
<asp:RequiredFieldValidator ID=
"RequiredFieldValidator1"
runat=
"server"
ErrorMessage=
"*"
ControlToValidate=
"IpAdressTextBox"
ValidationGroup=
"Insert"
></asp:RequiredFieldValidator>
tato položka musí být vyplněna</td>
</tr>
<tr>
<td>Číslo počítače:</td>
<td><asp:TextBox ID=
"NumberPcTextBox"
runat=
"server"
Text=
<asp:RequiredFieldValidator ID=
"RequiredFieldValidator3"
runat=
"server"
ErrorMessage=
"*"
ControlToValidate=
"NumberPcTextBox"
ValidationGroup=
"Insert"
></asp:RequiredFieldValidator>
tato položka musí být vyplněna</td>
</tr>
<tr>
<td>Doména:</td>
<td><asp:TextBox ID=
"DomainTextBox"
runat=
"server"
Text=
</td>
</tr>
<tr>
<td>Výrobní číslo:</td>
<td><asp:TextBox ID=
"SerialNumberTextBox"
runat=
"server"
Text=
</td>
</tr>
<tr>
<td>Operační systém:</td>
<td><asp:TextBox ID=
"OperationSystemTextBox"
runat=
"server"
Text=
</td>
</tr>
<tr>
<td>Software:</td>
<td><asp:TextBox ID=
"SoftwareTextBox"
runat=
"server"
Text=
</td>
</tr>
<tr>
<td>Hardware:</td>
<td><asp:TextBox ID=
"HardwareTextBox"
runat=
"server"
Text=
</td>
</tr>
<tr>
<td><asp:Button ID=
"InsertButton"
runat=
"server"
CausesValidation=
"True"
CommandName=
"Insert"
Text=
"Přidat počítač"
ValidationGroup=
"Insert"
/>
</td>
</tr>
</table>
</InsertItemTemplate>
</asp:FormView>