-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegprintsetAgain.aspx.cs
More file actions
119 lines (102 loc) · 5.14 KB
/
RegprintsetAgain.aspx.cs
File metadata and controls
119 lines (102 loc) · 5.14 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using PassportBusiness;
using System.Data.SqlClient;
using System.Text;
using System.Security.Cryptography;
public partial class RegprintsetAgain_BOA : System.Web.UI.Page
{
Entrydetail entryobj = new Entrydetail();
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["HPSCDBNEW"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
GetRecord();
}
private void GetRecord()
{
try
{
SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["HPSCDBNEW"].ConnectionString);
cn.Open();
String sql = "SELECT b.Post_Name,a.RegestrationNumber,a.CandidateName,a.FatherHusbandName,a.MotherName,a.Gender,a.MaritalStatus,a.Address,a.Block,a.Area,a.City,d.District_Name as State,a.PinCode,a.PermanentAddress,a.Permanentarea,a.PermanentBlock,a.PermanentCity,d.District_Name as PermanentState,a.PermanentPinCode,a.Nationality,a.Perma_contact,a.Corres_contact , CONVERT(VARCHAR(20), a.DOB, 103) as DOBB,a.Email,a.MaritalStatus,c.cat_name as Category FROM ApplicantDetails a, TblPost b,tblcatgory c,Tbl_District d where a.PostCode=b.Id and a.Category=c.id and a.State=d.District_id and a.RegestrationNumber=@RegestrationNumber and a.status=1 and a.IsPayment =1";
SqlCommand cmd = new SqlCommand(sql, cn);
cmd.Parameters.AddWithValue("@RegestrationNumber", Session["RegestrationNumber"].ToString());
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
lbl_Stream.Text = ds.Tables[0].Rows[0]["Post_Name"].ToString();
lbl_formno.Text = ds.Tables[0].Rows[0]["RegestrationNumber"].ToString();
lbl_name.Text = ds.Tables[0].Rows[0]["CandidateName"].ToString();
lbl_fname.Text = ds.Tables[0].Rows[0]["FatherHusbandName"].ToString();
lbl_mname.Text = ds.Tables[0].Rows[0]["MotherName"].ToString();
lbl_Category.Text = ds.Tables[0].Rows[0]["Category"].ToString();
lbl_DOB.Text = ds.Tables[0].Rows[0]["DOBB"].ToString();
switch (ds.Tables[0].Rows[0]["Gender"].ToString())
{
case "M":
this.lbl_gender.Text = "Male";
break;
case "F":
this.lbl_gender.Text = "Female";
break;
}
lbl_marital.Text = ds.Tables[0].Rows[0]["MaritalStatus"].ToString();
lbldistrict.Text = ds.Tables[0].Rows[0]["State"].ToString();
// other Details End
// Address Start
lbl_PA.Text = ds.Tables[0].Rows[0]["Address"].ToString() + "," + ds.Tables[0].Rows[0]["State"].ToString() + "," + ds.Tables[0].Rows[0]["City"].ToString() + "-" + ds.Tables[0].Rows[0]["PinCode"].ToString() + ",Ph:" + ds.Tables[0].Rows[0]["Perma_contact"].ToString();
lbl_email.Text = ds.Tables[0].Rows[0]["Email"].ToString();
lbl_CA.Text = ds.Tables[0].Rows[0]["PermanentAddress"].ToString() + "," + ds.Tables[0].Rows[0]["PermanentState"].ToString() + "," + ds.Tables[0].Rows[0]["PermanentCity"].ToString() + "-" + ds.Tables[0].Rows[0]["PermanentPinCode"].ToString() + ",Ph:" + ds.Tables[0].Rows[0]["Corres_contact"].ToString();
DataSet ds1 = new DataSet();
ds1 = Entrydetail.bind_repeter(Session["RegestrationNumber"].ToString());
Repeater1.DataSource = ds1;
Repeater1.DataBind();
DataSet dsExp = new DataSet();
dsExp = Entrydetail.bind_repeterEXP(Session["RegestrationNumber"].ToString());
Repeater2.DataSource = dsExp;
Repeater2.DataBind();
// image Bind
Image1.ImageUrl = "~/ShowImage.ashx?id=" + Session["RegestrationNumber"].ToString();
Image2.ImageUrl = "~/ShowImage2.ashx?id=" + Session["RegestrationNumber"].ToString();
Label7.Text = "Printing Again. Amount has been paid earlier";
}
else
{
Label7.Text = "Incomplete Form Please Update your Detail.";
}
}
catch (Exception ex)
{
// Log the exception
Response.Redirect("RegistrationErr.aspx");
}
finally
{
}
}
public string Generatehash512(string text)
{
byte[] message = Encoding.UTF8.GetBytes(text);
UnicodeEncoding UE = new UnicodeEncoding();
byte[] hashValue;
SHA512Managed hashString = new SHA512Managed();
string hex = "";
hashValue = hashString.ComputeHash(message);
foreach (byte x in hashValue)
{
hex += String.Format("{0:x2}", x);
}
return hex;
}
}