-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAdminViewInsurerRequest.aspx.cs
More file actions
77 lines (69 loc) · 2.07 KB
/
AdminViewInsurerRequest.aspx.cs
File metadata and controls
77 lines (69 loc) · 2.07 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
67
68
69
70
71
72
73
74
75
76
77
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;
using System.Data;
using System.Configuration;
public partial class AdminViewInsurerRequest : System.Web.UI.Page
{
SqlConnection con;
SqlCommand cmd;
SqlDataAdapter adp;
DataTable dt;
void bindgrid()
{
adp = new SqlDataAdapter("select * from crtable where status='Requesting' ", con);
dt = new DataTable();
adp.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{
try
{
Label1.Text = "";
Menu m2 = (Menu)Master.FindControl("Menu2");
m2.Visible = true;
con = new SqlConnection(ConfigurationManager.ConnectionStrings["connection"].ConnectionString);
con.Open();
if (!IsPostBack)
{
bindgrid();
}
}
catch (Exception ex)
{
Label1.Text = ex.Message;
}
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
int claimid = int.Parse(GridView1.DataKeys[int.Parse(e.CommandArgument.ToString())].Value.ToString());
string s = "";
if (e.CommandName == "aa")
{
s = "Accepting";
}
else if (e.CommandName == "rr")
{
s = "Rejecting";
}
cmd = new SqlCommand("update crtable set status=@status where claimid=@claimid", con);
cmd.Parameters.AddWithValue("status", s);
cmd.Parameters.AddWithValue("claimid", claimid);
cmd.ExecuteNonQuery();
cmd.Dispose();
bindgrid();
}
catch (Exception ex)
{
Label1.Text = ex.Message;
}
}
}