-
Notifications
You must be signed in to change notification settings - Fork 1
/
Issue.aspx.cs
81 lines (65 loc) · 2.9 KB
/
Issue.aspx.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class Issue : System.Web.UI.Page
{
static int roll;
static string fname, lname, major;
static double gpa;
protected void Page_Load(object sender, EventArgs e)
{
Button7.Visible = false;
}
protected void Button7_Click(object sender, EventArgs e)
{
Button7.Visible = true;
SqlConnection conn = new SqlConnection("Data Source=DESKTOP-A1B8R5V\\SQLEXPRESS;Initial Catalog=project;Integrated Security=True");
string query = "update PERMISSION set accept=@tim, status = 'Degree and Transcript Issued' where roll=@id";
conn.Open();
SqlCommand cm;
cm = new SqlCommand(query, conn);
DateTime timee = DateTime.Now;
cm.Parameters.AddWithValue("@id", roll);
cm.Parameters.AddWithValue("@tim", timee);
cm.ExecuteNonQuery();
string query2 = "INSERT INTO DEGREE VALUES( '" + fname + "','" + lname + "','" + roll + "','" + major + "')";
cm = new SqlCommand(query2, conn);
cm.ExecuteNonQuery();
string query3 = "INSERT INTO Transcript VALUES('" + roll + "','" + fname + "','" + lname + "','" + major + "','" + gpa + "')";
cm = new SqlCommand(query3, conn);
cm.ExecuteNonQuery();
conn.Close();
}
protected void Button2_Click(object sender, EventArgs e)
{
GridView1.Visible = true;
SqlConnection con = new SqlConnection("Data Source=DESKTOP-A1B8R5V\\SQLEXPRESS;Initial Catalog=project;Integrated Security=True");
SqlCommand SqlCommand;
SqlDataReader reader;
SqlDataAdapter adapter = new SqlDataAdapter();
con.Open();
string query = "SELECT fname,lname,rollno,cnic,cgpa,major FROM (DEGREE_ISSUANCE INNER JOIN STUDENT ON rollno=Roll_no) INNER JOIN PERMISSION ON Roll_no=roll WHERE Fypaccept LIKE 1 AND Financeaccept LIKE 1 AND processed LIKE 1 AND STATUS NOT LIKE 'Degree and Transcript Issued'";
SqlCommand = new SqlCommand(query, con);
adapter.SelectCommand = new SqlCommand(query, con);
reader = SqlCommand.ExecuteReader();
GridView1.DataSource = reader;
GridView1.DataBind();
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
roll = Convert.ToInt32(GridView1.SelectedRow.Cells[3].Text);
fname=GridView1.SelectedRow.Cells[1].Text;
lname = GridView1.SelectedRow.Cells[2].Text;
major = GridView1.SelectedRow.Cells[6].Text;
gpa = Convert.ToDouble(GridView1.SelectedRow.Cells[5].Text);
Button7.Visible = true;
}
protected void Button6_Click(object sender, EventArgs e)
{
Response.Redirect("OnestopUI.aspx");
}
}