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 ShowSymptomPlaceholder() { int problemid = Convert.ToInt16(Request.QueryString[0]); ObjProblemSymptom = ObjProblemSymptom.Get_By_id(problemid); string description; if (ObjProblemSymptom.Description==null) { description = ""; } else { description = ObjProblemSymptom.Description.ToString(); } PlaceholderSymtom.Visible = true; #region Declaration of Dynamic Table,and Placeholder PlaceholderSymtom.Controls.Clear(); Table tbl = new Table(); PlaceholderSymtom.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); Editorsymptom.Visible = false; }
protected void btnupdatesymptom_Click(object sender, EventArgs e) { string prev_value; string curnt_value; int historyid; int problemid = Convert.ToInt16(Request.QueryString[0]); #region For updating values in Problem history table ObjProblemHistory.Problemid = problemid; MembershipUser User=Membership.GetUser(); string username=User.UserName.ToString(); Objorganization=Objorganization.Get_Organization(); int userid = ObjUser.Get_By_UserName(username, Objorganization.Orgid); ObjProblemHistory.Operationownerid = userid; ObjProblemHistory.Operation = "SymptomUpdate"; ObjProblemHistory.Insert(); #endregion #region Get the Current historyid by calling function Get_Current_ProblemHistoryid() historyid = ObjProblemHistory.Get_Current_ProblemHistoryid(); #endregion #region Find Current value of Problem aBy Calling Function Get_By_id(),via passing problemid ObjProblem = ObjProblem.Get_By_id(problemid); #endregion #region Find the value of current symptom ObjProblemSymptom = ObjProblemSymptom.Get_By_id(ObjProblem.ProblemId); #endregion #region Insert the values in history difference table prev_value = Convert.ToString(ObjProblemSymptom.Description); curnt_value = Convert.ToString(Editorsymptom.Text); ObjProblemHistoryDiff.Historyid = historyid; ObjProblemHistoryDiff.Columnname = "Description"; ObjProblemHistoryDiff.Current_value = curnt_value; ObjProblemHistoryDiff.Prev_value = prev_value; ObjProblemHistoryDiff.Insert(); #endregion ObjProblemSymptom.Problemid = problemid; ObjProblemSymptom.Description = Editorsymptom.Text.ToString(); ObjProblemSymptom.Update(); ShowSymptomPlaceholder(); btnupdatesymptom.Visible = false; btncancellSymptom.Visible = false; btncancellSymptom.Visible = false; Editorsymptom.Visible = false; lnksymptomadd.Visible = false; lnksymptomedit.Visible = true; ShowImpactPlaceholder(); ShowRootcausePlaceholder(); }
protected void imganalysis_Click(object sender, ImageClickEventArgs e) { panelProblem.Visible = false; panalanalysis.Visible = true; pan1.Visible = false; panelRequest.Visible = false; panalrequestinfo.Visible = false; panalsolution.Visible = false; panelHistory.Visible = false; int problemid = Convert.ToInt16(Request.QueryString[0]); ObjProblemSymptom = ObjProblemSymptom.Get_By_id(problemid); ObjProblemImpact = ObjProblemImpact.Get_By_id(problemid); ObjProblemRootcause = ObjProblemRootcause.Get_By_id(problemid); string description; if (ObjProblemSymptom.Symtomid ==0) { lnksymptomadd.Visible = true; lnksymptomedit.Visible = false; } else { lnksymptomadd.Visible =false; lnksymptomedit.Visible = true; } if (ObjProblemImpact.Impactid==0) { lnkimpadd.Visible = true; lnimpedit.Visible = false; } else { lnimpedit.Visible = true; lnkimpadd.Visible = false; } if (ObjProblemRootcause.Rootcauseid ==0) { lnkRootcauseadd.Visible = true; lnkRootcauseedit.Visible = false; } else { lnkRootcauseadd.Visible = false; lnkRootcauseedit.Visible = true; } ShowSymptomPlaceholder(); ShowImpactPlaceholder(); ShowRootcausePlaceholder(); }
protected void lnksymptomedit_Click(object sender, EventArgs e) { EditorRootcause.Visible = false; btnsaveSymtom.Visible = false; btncancellSymptom.Visible = true; btnupdatesymptom.Visible = true; Editorsymptom.Visible = true; int problemid = Convert.ToInt16(Request.QueryString[0]); ObjProblemSymptom = ObjProblemSymptom.Get_By_id(problemid); Editorsymptom.Text = ObjProblemSymptom.Description.ToString(); Editorimpact.Visible = false; btnsaveimpact.Visible = false; btncancellImpact.Visible = false; btnupdateImpact.Visible = false; EditorRootcause.Visible = false; btnupdateRootcause.Visible = false; btncancellRootcause.Visible = false; btnsaveRootcause.Visible = false; ShowImpactPlaceholder(); ShowRootcausePlaceholder(); }
public int Update_ProblemSymptom_By_id(ProblemSymptom ObjProblemSymptom) { return (int)ExecuteNonQuery(Sp_ProblemSymptom_Update, new object[] { ObjProblemSymptom.Problemid, ObjProblemSymptom.Description }); }
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_ProblemSymptom_mst(ProblemSymptom ObjProblemSymptom) { return (int)ExecuteNonQuery(Sp_ProblemSymptom_Insert, new object[] { ObjProblemSymptom.Problemid, ObjProblemSymptom.Description }); }
public object GenerateProblemSymptom_mstObject(ref IDataReader returnData) { ProblemSymptom obj = new ProblemSymptom(); while (returnData.Read()) { obj.Problemid = (int)returnData["Problemid"]; obj.Symtomid = (int)returnData["Symptomid"]; if (returnData["Description"] != DBNull.Value) { obj.Description = (string)returnData["Description"]; } } returnData.Close(); returnData.Dispose(); return obj; }
protected void btnupdatesymptom_Click(object sender, EventArgs e) { //Add Exception handilng try catch change by vishal 21-05-2012 try { string prev_value; string curnt_value; int historyid; int problemid = Convert.ToInt32(Request.QueryString[0]); #region For updating values in Problem history table ObjProblemHistory.Problemid = problemid; MembershipUser User = Membership.GetUser(); string username = User.UserName.ToString(); Objorganization = Objorganization.Get_Organization(); int userid = ObjUser.Get_By_UserName(username, Objorganization.Orgid); ObjProblemHistory.Operationownerid = userid; ObjProblemHistory.Operation = "SymptomUpdate"; ObjProblemHistory.Insert(); #endregion #region Get the Current historyid by calling function Get_Current_ProblemHistoryid() historyid = ObjProblemHistory.Get_Current_ProblemHistoryid(); #endregion #region Find Current value of Problem aBy Calling Function Get_By_id(),via passing problemid ObjProblem = ObjProblem.Get_By_id(problemid); #endregion #region Find the value of current symptom ObjProblemSymptom = ObjProblemSymptom.Get_By_id(ObjProblem.ProblemId); #endregion #region Insert the values in history difference table prev_value = Convert.ToString(ObjProblemSymptom.Description); curnt_value = Convert.ToString(Editorsymptom.Text); ObjProblemHistoryDiff.Historyid = historyid; ObjProblemHistoryDiff.Columnname = "Description"; ObjProblemHistoryDiff.Current_value = curnt_value; ObjProblemHistoryDiff.Prev_value = prev_value; ObjProblemHistoryDiff.Insert(); #endregion ObjProblemSymptom.Problemid = problemid; ObjProblemSymptom.Description = Editorsymptom.Text.ToString(); ObjProblemSymptom.Update(); ShowSymptomPlaceholder(); btnupdatesymptom.Visible = false; btncancellSymptom.Visible = false; btncancellSymptom.Visible = false; Editorsymptom.Visible = false; lnksymptomadd.Visible = false; lnksymptomedit.Visible = true; ShowImpactPlaceholder(); ShowRootcausePlaceholder(); } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
protected void lnksymptomedit_Click(object sender, EventArgs e) { //Add Exception handilng try catch change by vishal 21-05-2012 try { EditorRootcause.Visible = false; btnsaveSymtom.Visible = false; btncancellSymptom.Visible = true; btnupdatesymptom.Visible = true; Editorsymptom.Visible = true; int problemid = Convert.ToInt32(Request.QueryString[0]); ObjProblemSymptom = ObjProblemSymptom.Get_By_id(problemid); Editorsymptom.Text = ObjProblemSymptom.Description.ToString(); Editorimpact.Visible = false; btnsaveimpact.Visible = false; btncancellImpact.Visible = false; btnupdateImpact.Visible = false; EditorRootcause.Visible = false; btnupdateRootcause.Visible = false; btncancellRootcause.Visible = false; btnsaveRootcause.Visible = false; ShowImpactPlaceholder(); ShowRootcausePlaceholder(); } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
protected void imganalysis_Click(object sender, ImageClickEventArgs e) { ///Add Exception handilng try catch change by vishal 21-05-2012 try { panelProblem.Visible = false; panalanalysis.Visible = true; pan1.Visible = false; panelRequest.Visible = false; panalrequestinfo.Visible = false; panalsolution.Visible = false; panelHistory.Visible = false; int problemid = Convert.ToInt32(Request.QueryString[0]); ObjProblemSymptom = ObjProblemSymptom.Get_By_id(problemid); ObjProblemImpact = ObjProblemImpact.Get_By_id(problemid); ObjProblemRootcause = ObjProblemRootcause.Get_By_id(problemid); string description; if (ObjProblemSymptom.Symtomid == 0) { lnksymptomadd.Visible = true; lnksymptomedit.Visible = false; } else { lnksymptomadd.Visible = false; lnksymptomedit.Visible = true; } if (ObjProblemImpact.Impactid == 0) { lnkimpadd.Visible = true; lnimpedit.Visible = false; } else { lnimpedit.Visible = true; lnkimpadd.Visible = false; } if (ObjProblemRootcause.Rootcauseid == 0) { lnkRootcauseadd.Visible = true; lnkRootcauseedit.Visible = false; } else { lnkRootcauseadd.Visible = false; lnkRootcauseedit.Visible = true; } ShowSymptomPlaceholder(); ShowImpactPlaceholder(); ShowRootcausePlaceholder(); } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }