public void DisplayContactDetails() { string PRN; DataSet ds = new DataSet(); DataTable tempDT = new DataTable(); oStudent = new clsRegStudent(Classes.clsGetSettings.UniversityID.ToString(), hid_pk_Year.Value, hid_pk_Student_ID.Value.ToString()); Session["StudentObj"] = oStudent; ds = clsRegStudent.Fetch_StudentReRegistraionCourseDetails(pUID, pYr, pStudID); if (ds.Tables[0].Rows.Count > 0) { clsCDN objCDN = new clsCDN(); DataRow dtRow = objCDN.GetCDNKeys(clsDUConfigurations.Instance.CDNKeys.PhotoSignKey); if (!string.IsNullOrEmpty(Convert.ToString(ds.Tables[0].Rows[0]["PhotoPath"]))) { Image1.ImageUrl = dtRow["Download_Path"].ToString() + ds.Tables[0].Rows[0]["PhotoPath"].ToString(); //"ViewRequestStatus__2.aspx?PStudentID=" + pUID + "-" + pYr + "-" + pStudID; } else { Image1.ImageUrl = dtRow["Download_Path"].ToString() + "NoPhoto.JPG"; } if (!string.IsNullOrEmpty(Convert.ToString(ds.Tables[0].Rows[0]["SignPath"]))) { Image2.ImageUrl = dtRow["Download_Path"].ToString() + ds.Tables[0].Rows[0]["SignPath"].ToString(); //"ViewRequestStatus__2.aspx?SStudentID=" + pUID + "-" + pYr + "-" + pStudID; } else { Image2.ImageUrl = dtRow["Download_Path"].ToString() + "NoSign.JPG"; } PRN = ds.Tables[0].Rows[0]["PRN_Number"].ToString(); if ((PRN == "") || (PRN == null) || ((PRN == " "))) { PRN = "Not Generated"; lblPRN.Text = PRN; } else { lblPRN.Text = ds.Tables[0].Rows[0]["PRN_Number"].ToString(); } //lblCourse.Text = ds.Tables[1].Rows[1]["CrDesc"].ToString(); //lblCollege.Text = ds.Tables[1].Rows[1]["InstName"].ToString(); if (ds.Tables[1].Rows.Count > 0) { DGCourseInstitute1.DataSource = ds.Tables[1]; DGCourseInstitute1.DataBind(); DGCourseInstitute1.Visible = true; } else { //Err_Qualification.Visible = true; DGCourseInstitute1.Visible = false; btnMercyAllow.Enabled = false; } DGCourseInstitute1.Dispose(); } lblNameOfStudent.Text = oStudent.Last_Name + " " + oStudent.First_Name + " " + oStudent.Middle_Name; lblNameOnMarksheet.Text = oStudent.Name_QualExamMarkSheet; lblFathersName.Text = oStudent.Father_Last_Name + " " + oStudent.Father_First_Name + " " + oStudent.Father_Middle_Name; lblMothersMaidenName.Text = oStudent.Mother_Last_Name + " " + oStudent.Mother_First_Name + " " + oStudent.Mother_Middle_Name; if (oStudent.Gender == "1") { lblGender.Text = "Male"; } else if (oStudent.Gender == "2") { lblGender.Text = "Female"; } lblDOB.Text = oStudent.DOB; }
protected void gvStudentCountLinks_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("cmdGenerateXML")) { oRegionalStudyCenter = new clsRegionalStudyCenter(); string PhotoSignXml = string.Empty; GridView gv = (GridView)sender; int index = Convert.ToInt32(e.CommandArgument); string LowerLimit = gv.DataKeys[index]["Text"].ToString().Split('-')[0]; string UpperLimit = gv.DataKeys[index]["Text"].ToString().Split('-')[1]; int RowIndex = index + 1; string sFileName = hidUniID.Value + "_" + hidAcademicYearID.Value + "_" + hidCrName.Value + "_" + hidMoLrnName.Value + "_" + hidPtrnName.Value + "_" + hidBrnName.Value + "_" + hidCrPrName.Value + "_" + hidCrPrChName.Value + "_" + RowIndex.ToString(); char[] charNotAllowed = { '/', '\\', '*', '?', '"', '<', '>', '|', ':' }; for (int icharCount = 0; icharCount < charNotAllowed.Length; icharCount++) { sFileName = sFileName.Replace(charNotAllowed[icharCount], '_'); } sFileName = sFileName.Replace(" ", string.Empty); string sDestination = Server.MapPath(".\\TempDirectory\\"); PhotoSignXml = oRegionalStudyCenter.ListStudentPhotoSignXML(hidAcademicYearID.Value, hidUniID.Value, hidFacID.Value, hidCrID.Value, hidMoLrnID.Value, hidPtrnID.Value, hidBrnID.Value, hidCrPrDetailsID.Value, hidCrPrChID.Value, LowerLimit, UpperLimit, hidExamEventID.Value); //************************************ CDN related changes ****************************** clsCDN objCDN = new clsCDN(); string BusinessUnitId, PIdDC, Relative_Path, Upload_Path; string DownloadZipServicePath; //DataTable oDtCDNConf = cdnConf.GetCDNKeys(); if (oCDNKeys != null) { DataRow dtRow = objCDN.GetCDNKeys(oCDNKeys.PhotoSignKey); if (dtRow != null) { BusinessUnitId = Convert.ToString(dtRow["BusinessUnitId"]); PIdDC = Convert.ToString(dtRow["PIdDC"]); Relative_Path = Convert.ToString(dtRow["Relative_Path"]); Upload_Path = Convert.ToString(dtRow["Upload_Path"]); //+ "uploadBase64AndGetId"; DownloadZipServicePath = Upload_Path + "downloadZipFile"; StringBuilder CDNKeys = new StringBuilder("<CDNXML><CDNKeys>"); CDNKeys.Append("<BusinessUnitId>"); CDNKeys.Append(BusinessUnitId); CDNKeys.Append("</BusinessUnitId>"); CDNKeys.Append("<PIdDC>"); CDNKeys.Append(PIdDC); CDNKeys.Append("</PIdDC>"); CDNKeys.Append("<Relative_Path>"); CDNKeys.Append(Relative_Path); CDNKeys.Append("</Relative_Path>"); CDNKeys.Append("<DownloadZipServicePath>"); CDNKeys.Append(DownloadZipServicePath); CDNKeys.Append("</DownloadZipServicePath>"); CDNKeys.Append("</CDNKeys>"); // BusinessUnitId, PIdDC, Relative_Path, DownloadZipServicePath PhotoSignXml = CDNKeys.ToString() + PhotoSignXml + "</CDNXML>"; } } //*************************************************************************************** if (!Directory.Exists(sDestination)) { Directory.CreateDirectory(sDestination); } string outputFile = sDestination + sFileName + ".zip"; string inputFile = sDestination + sFileName + ".xml"; string sPassword = "******"; DeleteZipFiles(sDestination, sFileName); try { UTF8Encoding encoding = new UTF8Encoding(); Byte[] byteArray = encoding.GetBytes(PhotoSignXml); oFileStream = new FileStream(inputFile, FileMode.Create, FileAccess.Write); oFileStream.Write(byteArray, 0, byteArray.Length); oFileStream.Close(); oFastZip.CreateZip(inputFile, outputFile, sPassword); } catch (Exception ex) { lblErrorMsg.Text = ex.Message.ToString(); } } }