forked from nooraintahir/Degree-Issuance-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFYPUI.aspx.cs
81 lines (65 loc) · 2.62 KB
/
FYPUI.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 FYPUI : System.Web.UI.Page
{
static int roll;
protected void Page_Load(object sender, EventArgs e)
{
Button7.Visible=false;
TextBox1.Visible=false;
Label1.Visible=false;
}
protected void Button6_Click(object sender, EventArgs e)
{
Response.Redirect("Login.aspx");
}
protected void Button1_Click(object sender, EventArgs e)
{
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,Fypaccept FROM (DEGREE_ISSUANCE INNER JOIN STUDENT ON rollno=Roll_no) INNER JOIN PERMISSION ON Roll_no=roll WHERE Fypaccept LIKE 0 AND status LIKE 'Sent to FYP Committee'";
SqlCommand = new SqlCommand(query, con);
adapter.SelectCommand = new SqlCommand(query, con);
reader = SqlCommand.ExecuteReader();
GridView1.DataSource = reader;
GridView1.DataBind();
Button7.Visible = true;
TextBox1.Visible = true;
Label1.Visible = true;
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
roll=Convert.ToInt32(GridView1.SelectedRow.Cells[3].Text);
TextBox1.Text = GridView1.SelectedRow.Cells[6].Text;
Button7.Visible = true;
TextBox1.Visible = true;
Label1.Visible = true;
}
protected void Button7_Click(object sender, EventArgs e)
{
Button7.Visible = true;
TextBox1.Visible = true;
SqlConnection conn = new SqlConnection("Data Source=DESKTOP-A1B8R5V\\SQLEXPRESS;Initial Catalog=project;Integrated Security=True");
string query= "update PERMISSION set fypaccept=@accept, fyptime=@tim, status = 'Sent to Finance Committee' where roll=@id";
conn.Open();
SqlCommand cm;
cm = new SqlCommand(query, conn);
DateTime timee = DateTime.Now;
cm.Parameters.AddWithValue("@accept", TextBox1.Text);
cm.Parameters.AddWithValue("@id", roll);
cm.Parameters.AddWithValue("@tim", timee);
cm.ExecuteNonQuery();
conn.Close();
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
}
}