Repository navigation
Expand file tree
/
Copy pathCourse.aspx.cs
More file actions
66 lines (58 loc) · 1.82 KB
/
Copy pathCourse.aspx.cs
File metadata and controls
66 lines (58 loc) · 1.82 KB
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
using AHS.Core.Framework;
using AHS.Core;
using System;
using System.Collections.Generic;
using System.Data;
using System.Web.UI;
using AHAL.StudentCourse.BO;
namespace WebApplication2
{
public partial class About : Page
{
string _selectCourse = @"SELECT * FROM course;";
protected void Page_Load(object sender, EventArgs e)
{
}
protected void BindGrid()
{
Class1 load = new Class1();
DataTable dt = load.LoadData(_selectCourse);
grid_course.DataSource = dt;
grid_course.DataBind();
}
protected void show_course_Click(object sender, EventArgs e)
{
BindGrid();
}
protected void insert_course_Click(object sender, EventArgs e)
{
//int crsID = int.Parse(text_crsID.Text);
//string crsName = text_crsName.Text;
//string crsInstructor = text_crsInstructor.Text;
//int crsCredit = int.Parse(text_credit.Text);
Course course = new Course();
if(text_crsID.Text != "")
{
course.ID = int.Parse(text_crsID.Text);
course = course.GetData();
}
if (course == null)
{
course = new Course();
}
course.course_instructor = text_crsInstructor.Text;
course.course_name = text_crsName.Text;
course.credit = int.Parse(text_credit.Text);
course.Save();
BindGrid();
}
protected void delete_course_Click(object sender, EventArgs e)
{
//int crsID = int.Parse(text_crsID.Text);
Course course = new Course();
course.ID = int.Parse(text_crsID.Text);
course.Delete();
BindGrid();
}
}
}