using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; using nmsSetup; using System.Collections.Generic; public partial class Admin_office_certificateprint1 : System.Web.UI.Page { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString); SqlCommand cmd; public Int32 i = 1; clsBLSetup obj; PRPSetup objprp; String st; static string st1; Int32 total = 0, MaxMarks = 0, MinMarks = 0; protected void Page_Load(object sender, EventArgs e) { if (Session["OfficeAdmin"] == null) { Response.Redirect("../../Default.aspx?logout=session&path=employee/printPage.aspx"); } //if (Session["investorList"] == null) //{ // Response.Redirect("PendingPrint.aspx", false); //} try { if (Page.IsPostBack == false) { st=Request.QueryString["memId"].ToString(); st1=Request.QueryString["memId"].ToString(); st= st.Substring(0,3).ToString(); if (st == "GS/") { bindLable(); } else { GetData(1); } } lkprint.Attributes.Add("OnClick", "printSpecial()"); } catch (Exception ex) { Label1.Visible = true; Label1.Text = ex.Message.ToString(); } } public void GetData(Int32 sno1) { clsBLSetup obj = new clsBLSetup(); DataSet ds = new DataSet(); try { PRPSetup objmemprp = new PRPSetup(); objmemprp.id = Request.QueryString["memId"].ToString(); // ds = obj.viewprintICard(objmemprp); string st = ""; int a; ds = obj.viewprintDiploma(objmemprp); lblSrNo.Text = ds.Tables[0].Rows[0]["loginSrNo"].ToString(); // lblIssueDate.Text = ds.Tables[0].Rows[0]["issueDate"].ToString(); lblName.Text = ds.Tables[0].Rows[0]["studentName"].ToString(); lblFather.Text = ds.Tables[0].Rows[0]["studentFatherName"].ToString(); lblMotherName.Text = ds.Tables[0].Rows[0]["studentMother"].ToString(); lblDOB.Text = ds.Tables[0].Rows[0]["studentDOB"].ToString(); lblPlanName.Text = ds.Tables[0].Rows[0]["courseName"].ToString(); lblBranchName.Text = ds.Tables[0].Rows[0]["cBranchName"].ToString(); lblCourseCode.Text = ds.Tables[0].Rows[0]["courseCode"].ToString(); lblDuration.Text = ds.Tables[0].Rows[0]["smMonth"].ToString(); lblRegNo.Text = ds.Tables[0].Rows[0]["loginName"].ToString(); lbljoiningdate.Text = ds.Tables[0].Rows[0]["startDate"].ToString(); Image1.ImageUrl =ds.Tables[0].Rows[0]["imagePath"].ToString(); lblIssuedOn.Text = ds.Tables[0].Rows[0]["issueDate"].ToString(); lblDivision.Text = ds.Tables[0].Rows[0]["fs"].ToString(); lblResult.Text = ds.Tables[0].Rows[0]["ps"].ToString(); datalist.DataSource = ds.Tables[1]; datalist.DataBind(); } catch (Exception ex) { Label1.Visible = true; Label1.Text = ex.Message.ToString(); } // return ds; } private void bindLable() { if (con.State == ConnectionState.Closed) con.Open(); cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "viewResult"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@regno", st); SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); lblSrNo.Text = dr["memberCodeId"].ToString(); // lblIssueDate.Text = dr["issueDate"].ToString(); lblName.Text = dr["memberName"].ToString(); lblFather.Text = dr["memberFatherName"].ToString(); lblMotherName.Text = dr["memberMotherName"].ToString(); lblDOB.Text = dr["memberDOB"].ToString(); lblPlanName.Text = dr["courseName"].ToString(); lblBranchName.Text = dr["branchName"].ToString(); lblCourseCode.Text = dr["courseCode"].ToString(); lblDuration.Text = dr["duration"].ToString(); lblRegNo.Text = dr["regNo"].ToString(); lbljoiningdate.Text = dr["pSessionDate"].ToString(); Image1.ImageUrl = dr["imagePath"].ToString(); lblIssuedOn.Text = dr["issuedOn"].ToString(); lblDivision.Text = dr["division"].ToString(); lblResult.Text = dr["result"].ToString(); // datalist.DataSource = ds.Tables[1]; // datalist.DataBind(); lblMsg.Text = ""; } else { Label1.Visible = true; Label1.Text = "Result Not Found!"; } } public void rep() { try { // string lst; // List lst = new List(); // lst = (List)(Session["investorList"]); //(List)(Session["investorList"]); // objprp = new clsPRPprofile(); // obj = new clsBLprofile(); // objprp.memberId = lst; // Repeater1.DataSource = lst; //obj.SelectAgentPrintFinal(objprp); // Repeater1.DataBind(); } catch (Exception ex) { Label1.Visible = true; Label1.Text = ex.Message.ToString(); } } protected void lnkButton_Command(object sender, CommandEventArgs e) { // UpdateInfo(); } protected void datalist_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { MaxMarks += Convert.ToInt32(((Label)e.Item.FindControl("lblMaxMarks")).Text); MinMarks += Convert.ToInt32(((Label)e.Item.FindControl("lblMinMarks")).Text); total += Convert.ToInt32(((Label)e.Item.FindControl("lblTotal")).Text); } if (e.Item.ItemType == ListItemType.Footer) { ((Label)e.Item.FindControl("lblMaxTotal")).Text = MaxMarks.ToString(); ((Label)e.Item.FindControl("lblMinTotal")).Text = MinMarks.ToString(); ((Label)e.Item.FindControl("lblObtainMarks")).Text = total.ToString(); } } protected void lkprint_Command(object sender, CommandEventArgs e) { if (con.State == ConnectionState.Closed) con.Open(); try { cmd = new SqlCommand(); cmd.Connection = con; // cmd.CommandText = "DeductWalletBalWithLimit"; cmd.CommandText = "sendforconf"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", st1); cmd.Parameters.AddWithValue("@status", 4); cmd.ExecuteNonQuery(); } catch (Exception ex) { lblMsg.Text = ex.Message; } con.Close(); cmd.Dispose(); } }