-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanagecourses.aspx
116 lines (109 loc) · 6.51 KB
/
managecourses.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
<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="managecourses.aspx.cs" Inherits="RegisterLogin.managecourses" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div style="margin-top:5em; margin-bottom:5em">
<center><h3>Manage Courses</h3></center>
<hr />
<asp:Button style="position:relative; float:right;" class="btn btn-primary btn-block btn-lg" ID="Button1" runat="server" Text="+Insert New Course" OnClick="Button1_Click" />
<br />
</div>
<table>
</table>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" ShowFooter="True" DataKeyNames="c_id">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="Course_id">
<EditItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Eval("c_id") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("c_id") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Title">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("title") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("title") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Description">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Eval("description") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("description") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="ImageUrl">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Eval("imageurl") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Eval("imageurl") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Price">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Eval("price") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Eval("price") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Operations">
<EditItemTemplate>
<asp:LinkButton ID="LinkButton10" runat="server" CommandName="Update">Update</asp:LinkButton>
<asp:LinkButton ID="LinkButton11" runat="server" CommandName="Cancel">Cancel</asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton8" runat="server" CommandName="Edit">Edit</asp:LinkButton>
<asp:LinkButton ID="LinkButton9" runat="server" CommandName="Delete">Delete</asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:CommandField ShowEditButton="True" />
</Columns>
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
<br />
<asp:Label ID="Label7" runat="server" Text="Label"></asp:Label>
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:elearningdbConnectionString2 %>" SelectCommand="SELECT * FROM [courses]" DeleteCommand="DELETE FROM [courses] WHERE [c_id] = @c_id" InsertCommand="INSERT INTO [courses] ([c_id], [title], [description], [imageurl], [price]) VALUES (@c_id, @title, @description, @imageurl, @price)" UpdateCommand="UPDATE [courses] SET [title] = @title, [description] = @description, [imageurl] = @imageurl, [price] = @price WHERE [c_id] = @c_id">
<DeleteParameters>
<asp:Parameter Name="c_id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="c_id" Type="Int32" />
<asp:Parameter Name="title" Type="String" />
<asp:Parameter Name="description" Type="String" />
<asp:Parameter Name="imageurl" Type="String" />
<asp:Parameter Name="price" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="title" Type="String" />
<asp:Parameter Name="description" Type="String" />
<asp:Parameter Name="imageurl" Type="String" />
<asp:Parameter Name="price" Type="String" />
<asp:Parameter Name="c_id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>