-
Notifications
You must be signed in to change notification settings - Fork 2
/
AssessmentConfirmation.aspx.cs
88 lines (78 loc) · 2.9 KB
/
AssessmentConfirmation.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
82
83
84
85
86
87
88
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Text.RegularExpressions;
using System.Data.SqlTypes;
using System.Text;
public partial class AssessmentConfirmation : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["user_id"] == null)
{
Response.Redirect("Login.aspx");
}
if (!IsPostBack)
{
}
}
protected void btn_search_Click(object sender, EventArgs e)
{
if (txt_enter_ass_ref_no.Text == "")
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "Message", "alert('Please Fill Assessment Ref. No.')", true);
}
string dataqry = "select company_rin, company_name, company_tin, assessment_ref, assessment_date from vw_assessment_search where assessment_ref='" + txt_enter_ass_ref_no.Text + "'";
DataTable dt = new DataTable();
dt = PAYEClass.fetchdata(dataqry);
if (dt.Rows.Count > 0)
{
// box.Attributes.Add("display", "block");
box1.Attributes.Add("style", "display:block");
gvCompany.DataSource = dt;
gvCompany.DataBind();
}
else
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "Message", "alert('No Record Found.')", true);
}
}
protected void gvCompany_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = gvCompany.SelectedRow;
string dataqry = "select * from vw_ind_details where company_tin='" + row.Cells[0].Text + "'";
Session["company_rin"] = row.Cells[0].Text;
DataTable dt = new DataTable();
dt = PAYEClass.fetchdata(dataqry);
if (dt.Rows.Count > 0)
{
// Table1.Attributes.Add("display", "block");
Table1.Attributes.Add("style", "display:block");
grvEmployee.DataSource = dt;
grvEmployee.DataBind();
}
}
protected void OnRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(gvCompany, "Select$" + e.Row.RowIndex);
e.Row.Attributes["style"] = "cursor:pointer";
}
}
protected void btn_confirm_Click(object sender, EventArgs e)
{
string qry = "update Assessments set AssessmentStatus=1 where assessment_ref='" + txt_enter_ass_ref_no.Text + "'";
int status = PAYEClass.insertupdateordelete(qry);
if (status > 0)
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "Message", "alert('Record Has Been Updated Successfully.')", true);
}
}
}