-
Notifications
You must be signed in to change notification settings - Fork 2
/
causeofdelay.aspx.cs
executable file
·55 lines (45 loc) · 1.81 KB
/
causeofdelay.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
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class causeofdelay : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["admin"] == null)
Server.Transfer("admin.aspx");
else
admin.Text = "ADMIN " + Session["admin"].ToString();
//string cs = WebConfigurationManager.ConnectionStrings["automationConnectionString"].ConnectionString;
//SqlConnection conn = new SqlConnection(cs);
//string query = "SELECT cod FROM [causeofdelay] ORDER BY Id DESC";
//SqlDataAdapter dap = new SqlDataAdapter(query, conn);
//DataSet ds = new DataSet();
//dap.Fill(ds);
//Repeater1.DataSource = ds.Tables[0];
//Repeater1.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
string cs = WebConfigurationManager.ConnectionStrings["automationConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(cs);
conn.Open();
string cmd = "INSERT INTO causeofdelay(cod) VALUES(@cod)";
SqlCommand command = new SqlCommand(cmd, conn);
command.Parameters.AddWithValue("@cod", TextBox1.Text);
command.ExecuteNonQuery();
conn.Close();
//string query = "SELECT cod FROM [causeofdelay] ORDER BY Id DESC";
//SqlDataAdapter dap = new SqlDataAdapter(query, conn);
//DataSet ds = new DataSet();
//dap.Fill(ds);
//Repeater1.DataSource = ds.Tables[0];
//Repeater1.DataBind();
Response.Redirect("causeofdelay.aspx");
}
}