-
Notifications
You must be signed in to change notification settings - Fork 0
/
AgencyBoardGrid.aspx.cs
executable file
·59 lines (47 loc) · 1.82 KB
/
AgencyBoardGrid.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
using System.IO;
using System.Web.Security;
public partial class Master_AgencyBoardGrid : System.Web.UI.Page
{
private string Contents = ConfigurationManager.AppSettings["Contents"].ToString();
private string repository = ConfigurationManager.AppSettings["repository"].ToString();
private string URL = ConfigurationManager.AppSettings["URL"].ToString();
SqlConnection c = new SqlConnection(ConfigurationManager.ConnectionStrings["terrible1ConnectionString"].ToString());
protected void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
// SetDefaultView();
int PresentationID = Convert.ToInt32(Request.QueryString.Get("PresentationID"));
frmEntry.Attributes["src"] = "Edit_AgencyBoard.aspx?PresentationID=" + PresentationID + "&AgencyID=1";
}
}
protected void GridView1_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "del")
{
c.Open();
using (SqlCommand cmd = c.CreateCommand())
{
cmd.Parameters.Clear();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_DeleteAgencyBoard";
cmd.Parameters.Add("@AgencyID", SqlDbType.Int).Value = Convert.ToInt32(e.CommandArgument);
cmd.ExecuteNonQuery();
}
c.Close();
GridView1.DataBind();
}
}
}