-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegprintagain.aspx.cs
More file actions
63 lines (54 loc) · 1.79 KB
/
Regprintagain.aspx.cs
File metadata and controls
63 lines (54 loc) · 1.79 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PassportBusiness;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
public partial class Regprintagain : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
bind_Post();
}
}
private void bind_Post()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["HPSCDBNEW"].ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand("Select id,Post_name FROM tblpost", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
ddlpost.DataSource = ds;
ddlpost.DataTextField = "Post_name";
ddlpost.DataValueField = "id";
ddlpost.DataBind();
ddlpost.Items.Insert(0, new ListItem("--Select--", "0"));
con.Close();
}
protected void btnprint_Click(object sender, EventArgs e)
{
Entrydetail entryobj = new Entrydetail();
DataSet ds = new DataSet();
ds = entryobj.find_rec(ddlpost.SelectedValue, txtRegno.Text.Trim(),txtPassword.Text.Trim());
if (ds.Tables[0].Rows.Count == 0)
{
lblmsg.Text = "Please Check your Registraion Number and Password";
}
else
{
Session["data"] = ds;
{
Session["PrintAgain"] = "Print";
Session["RegestrationNumber"] = ds.Tables[0].Rows[0]["RegestrationNumber"].ToString();
Response.Redirect("Regprintset.aspx");
}
}
}
}