protected void Page_Load(object sender, EventArgs e) { //Add Exception handilng try catch change by vishal 21-05-2012 try { string strStatusClose = Resources.MessageResource.strStatusClose.ToString().Trim(); string statusString = ""; int problemid = Convert.ToInt32(Request.QueryString[0]); ObjProbelm = ObjProbelm.Get_By_id(problemid); objrootcause = objrootcause.Get_By_id(problemid); objimpact = objimpact.Get_By_id(problemid); objstatus = objstatus.Get_By_id(ObjProbelm.Statusid); statusString = objstatus.Statusname.ToString(); if (statusString.ToLower() == strStatusClose.ToLower()) { string ii = objimpact.Description.ToString(); string stripped4 = Regex.Replace(ii, @"<(.|\n)*?>", string.Empty); lblserviceeffected.Text = objimpact.Description.ToString(); string rr = objrootcause.Description.ToString(); string stripped1 = Regex.Replace(rr, @"<(.|\n)*?>", string.Empty); lblcause.Text = stripped1.ToString(); objproblemsysmptom = objproblemsysmptom.Get_By_id(problemid); string ss = objproblemsysmptom.Description.ToString(); string stripped3 = Regex.Replace(ss, @"<(.|\n)*?>", string.Empty); lblsymptom.Text = stripped3.ToString(); lbltcktno.Text = ObjProbelm.ProblemId.ToString(); lblcreatedate.Text = ObjProbelm.CreateDatetime.ToString(); if (ObjProbelm.AssginedTime != null) { lblstarttime.Text = ObjProbelm.AssginedTime.ToString(); } lblendtime.Text = ObjProbelm.Closedatetime.ToString(); Objcategory = Objcategory.Get_By_id(ObjProbelm.Categoryid); lblcomponenteffected.Text = Objcategory.CategoryName.ToString(); lbldescription.Text = ObjProbelm.title.ToString(); objproblemtosolution = objproblemtosolution.Get_By_id(ObjProbelm.ProblemId); Objsolution = Objsolution.Get_By_id(objproblemtosolution.Solutionid); string bb = Objsolution.Solution.ToString(); string stripped = Regex.Replace(bb, @"<(.|\n)*?>", string.Empty); lblresolution.Text = stripped.ToString(); //bind data to data bound controls and do other stuff objUser = objUser.Get_By_id(ObjProbelm.Requesterid); lblcustomer.Text = objUser.Username.ToString(); objUser = objUser.Get_By_id(ObjProbelm.Technicianid); lblengineer.Text = objUser.Username.ToString(); lblrcaresult.Text = "Completed"; } Response.Clear(); //this clears the Response of any headers or previous output Response.Buffer = true; //make sure that the entire output is rendered simultaneously /// ///Set content type to MS Excel sheet ///Use "application/msword" for MS Word doc files ///"application/pdf" for PDF files /// Response.ContentType = "application/vnd.ms-excel"; StringWriter stringWriter = new StringWriter(); //System.IO namespace should be used HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter); /// ///Render the entire Page control in the HtmlTextWriter object ///We can render individual controls also, like a DataGrid to be ///exported in custom format (excel, word etc) /// this.RenderControl(htmlTextWriter); Response.Write(stringWriter.ToString()); Response.End(); } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
protected void ShowWorkaroundPlaceholder() { panelHistory.Visible = false; panelRequest.Visible = false; panalanalysis.Visible = false; panalrequestinfo.Visible = false; panelincidentproblem.Visible = false; string description = ""; int problemid = Convert.ToInt16(Request.QueryString[0]); ObjProblemToSolution = ObjProblemToSolution.Get_By_id(problemid); if (colproblemtosolution.Count != 0) { foreach (ProblemToSolution obj in colproblemtosolution) { if (obj.Solutiontype == "WorkAround") { ObjSolution = ObjSolution.Get_By_id(obj.Solutionid); if (ObjSolution.Solution == "WorkAround") { description = ObjSolution.Content.ToString(); } } } } else { description = ""; } PlaceHolderWrkaround.Visible = true; #region Declaration of Dynamic Table,and Placeholder PlaceHolderWrkaround.Controls.Clear(); Table tbl = new Table(); PlaceHolderWrkaround.Controls.Add(tbl); int hdwidth = 1500; int height = 5; #endregion #region Declaration of Tablerow,TableCell and lable object TableRow tabRow = new TableRow(); TableCell tbCell = new TableCell(); tbCell.Width = hdwidth; Label lbl = new Label(); #endregion TableRow tabRow1 = new TableRow(); TableCell tbCell1 = new TableCell(); tbCell1.Width = hdwidth; tbCell1.Height = height; Label lbl1 = new Label(); lbl1.Text = description; lbl1.Font.Size = FontUnit.Smaller; tbCell1.Controls.Add(lbl1); tabRow1.Cells.Add(tbCell1); tbl.Rows.Add(tabRow1); }
protected void Page_Load(object sender, EventArgs e) {//Add Exception handilng try catch change by vishal 21-05-2012 try { string strStatusClose = Resources.MessageResource.strStatusClose.ToString().Trim(); string statusString = ""; int problemid = Convert.ToInt32(Request.QueryString[0]); ObjProbelm = ObjProbelm.Get_By_id(problemid); objrootcause = objrootcause.Get_By_id(problemid); objimpact = objimpact.Get_By_id(problemid); objstatus = objstatus.Get_By_id(ObjProbelm.Statusid); statusString = objstatus.Statusname.ToString(); if (statusString.ToLower() == strStatusClose.ToLower()) { string ii = objimpact.Description.ToString(); string stripped4 = Regex.Replace(ii, @"<(.|\n)*?>", string.Empty); lblserviceeffected.Text = objimpact.Description.ToString(); string rr = objrootcause.Description.ToString(); string stripped1 = Regex.Replace(rr, @"<(.|\n)*?>", string.Empty); lblcause.Text = stripped1.ToString(); objproblemsysmptom = objproblemsysmptom.Get_By_id(problemid); string ss = objproblemsysmptom.Description.ToString(); string stripped3 = Regex.Replace(ss, @"<(.|\n)*?>", string.Empty); lblsymptom.Text = stripped3.ToString(); lbltcktno.Text = ObjProbelm.ProblemId.ToString(); lblcreatedate.Text = ObjProbelm.CreateDatetime.ToString(); if (ObjProbelm.AssginedTime != null) { lblstarttime.Text = ObjProbelm.AssginedTime.ToString(); } lblendtime.Text = ObjProbelm.Closedatetime.ToString(); Objcategory = Objcategory.Get_By_id(ObjProbelm.Categoryid); lblcomponenteffected.Text = Objcategory.CategoryName.ToString(); lbldescription.Text = ObjProbelm.title.ToString(); objproblemtosolution = objproblemtosolution.Get_By_id(ObjProbelm.ProblemId); Objsolution = Objsolution.Get_By_id(objproblemtosolution.Solutionid); string bb = Objsolution.Solution.ToString(); string stripped = Regex.Replace(bb, @"<(.|\n)*?>", string.Empty); lblresolution.Text = stripped.ToString(); //bind data to data bound controls and do other stuff objUser = objUser.Get_By_id(ObjProbelm.Requesterid); lblcustomer.Text = objUser.Username.ToString(); objUser = objUser.Get_By_id(ObjProbelm.Technicianid); lblengineer.Text = objUser.Username.ToString(); lblrcaresult.Text = "Completed"; } Response.Clear(); //this clears the Response of any headers or previous output Response.Buffer = true; //make sure that the entire output is rendered simultaneously /// ///Set content type to MS Excel sheet ///Use "application/msword" for MS Word doc files ///"application/pdf" for PDF files /// Response.ContentType = "application/vnd.ms-excel"; StringWriter stringWriter = new StringWriter(); //System.IO namespace should be used HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter); /// ///Render the entire Page control in the HtmlTextWriter object ///We can render individual controls also, like a DataGrid to be ///exported in custom format (excel, word etc) /// this.RenderControl(htmlTextWriter); Response.Write(stringWriter.ToString()); Response.End(); } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
public int Insert_ProblemToSlotion_mst(ProblemToSolution ObjProblemtoSolotion) { return (int)ExecuteNonQuery(Sp_ProblemToSolution_Insert, new object[] { ObjProblemtoSolotion.Problemid, ObjProblemtoSolotion.Solutionid, ObjProblemtoSolotion.Solutiontype }); }
public object GenerateProblemToSolution_mstObject(ref IDataReader returnData) { ProblemToSolution obj = new ProblemToSolution(); while (returnData.Read()) { obj.Problemid = (int)returnData["ProblemId"]; obj.WorkAroundid = (int)returnData["WorkAroundid"]; obj.Solutionid = (int)returnData["Solutionid"]; obj.Solutiontype = (string)returnData["Solutiontype"]; } returnData.Close(); returnData.Dispose(); return obj; }
public CollectionBase GenerateProblemToSolution_mstCollection(ref IDataReader returnData) { BLLCollection<ProblemToSolution> col = new BLLCollection<ProblemToSolution>(); while (returnData.Read()) { ProblemToSolution obj = new ProblemToSolution(); obj.Problemid = (int)returnData["Problemid"]; obj.WorkAroundid = (int)returnData["WorkAroundid"]; obj.Solutionid = (int)returnData["Solutionid"]; obj.Solutiontype = (String)returnData["Solutiontype"]; col.Add(obj); } returnData.Close(); returnData.Dispose(); return col; }