public static string convertSerializedJSON(ProblemImpact impact)
        {
            ProblemImpactJSON impactJSON = new ProblemImpactJSON();

            impactJSON.id          = impact.id;
            impactJSON.impactLevel = impact.impactLevel;

            var json = new JavaScriptSerializer().Serialize(impactJSON);

            return(json);
        }
    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 btnupdateImpact_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 = "ImpactUpdated";
        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
        ObjProblemImpact = ObjProblemImpact.Get_By_id(ObjProblem.ProblemId);

        #endregion
        #region Insert the values in history difference table
        prev_value = Convert.ToString(ObjProblemImpact.Description);
        curnt_value = Convert.ToString(Editorimpact.Text);
        ObjProblemHistoryDiff.Historyid = historyid;
        ObjProblemHistoryDiff.Columnname = "Description";
        ObjProblemHistoryDiff.Current_value = curnt_value;
        ObjProblemHistoryDiff.Prev_value = prev_value;
        ObjProblemHistoryDiff.Insert();
        #endregion
        ObjProblemImpact.Problemid = problemid;
        ObjProblemImpact.Description = Editorimpact.Text.ToString();
        ObjProblemImpact.Update();
        ShowImpactPlaceholder();
        btnupdateImpact.Visible = false;
        btncancellImpact.Visible = false;
        btncancellImpact.Visible = false;
        Editorimpact.Visible = false;
        lnimpedit.Visible = true;
        lnkimpadd.Visible = false;
        ShowRootcausePlaceholder();
        ShowSymptomPlaceholder();
    }
 protected void ShowImpactPlaceholder()
 {
     int problemid = Convert.ToInt16(Request.QueryString[0]);
     ProblemImpact obj = new ProblemImpact();
     ObjProblemImpact = obj.Get_By_id(problemid);
     string description;
     if (ObjProblemImpact.Impactid ==0)
     {
         description = "";
     }
     else
     {
         description = ObjProblemImpact.Description.ToString();
     }
     Placeholderimpact.Visible = true;
     #region Declaration of Dynamic Table,and Placeholder
     Placeholderimpact.Controls.Clear();
     Table tbl = new Table();
     Placeholderimpact.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);
     Editorimpact.Visible = false;
 }
 protected void lnimpedit_Click(object sender, EventArgs e)
 {
     Editorimpact.Visible = true;
     btnsaveimpact.Visible = false;
     btncancellImpact.Visible = true;
     btnupdateImpact.Visible = true;
     int problemid = Convert.ToInt16(Request.QueryString[0]);
     ObjProblemImpact = ObjProblemImpact.Get_By_id(problemid);
     Editorimpact.Text = ObjProblemImpact.Description.ToString();
     EditorRootcause.Visible = false;
     btnupdateRootcause.Visible = false;
     btncancellRootcause.Visible = false;
     btnsaveRootcause.Visible = false;
     Editorsymptom.Visible = false;
     btnsaveSymtom.Visible = false;
     btncancellSymptom.Visible = false;
     btnupdatesymptom.Visible = false;
     ShowRootcausePlaceholder();
     ShowSymptomPlaceholder();
 }
    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();
    }
Example #7
0
    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 Update_ProblemImpact_By_id(ProblemImpact ObjProblemImpact)
 {
     return (int)ExecuteNonQuery(Sp_ProblemImpact_Update, new object[] { ObjProblemImpact.Problemid, ObjProblemImpact.Description });
 }
 public int Insert_ProblemImpact_mst(ProblemImpact ObjProblemImpact)
 {
     return (int)ExecuteNonQuery(Sp_ProblemImpact_Insert, new object[] { ObjProblemImpact.Problemid, ObjProblemImpact.Description });
 }
    public object GenerateProblemImpact_mstObject(ref IDataReader returnData)
    {
        ProblemImpact obj = new ProblemImpact();
        while (returnData.Read())
        {
            obj.Problemid = (int)returnData["Problemid"];
            obj.Impactid = (int)returnData["Impactid"];

            if (returnData["Description"] != DBNull.Value)
            {

                obj.Description = (string)returnData["Description"];
            }

        }
        returnData.Close();
        returnData.Dispose();
        return obj;
    }
 public ProblemImpactJSON(ProblemImpact impact)
 {
     this.id          = impact.id;
     this.impactLevel = impact.impactLevel;
 }
    protected void btnupdateImpact_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 = "ImpactUpdated";
            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
            ObjProblemImpact = ObjProblemImpact.Get_By_id(ObjProblem.ProblemId);

            #endregion
            #region Insert the values in history difference table
            prev_value = Convert.ToString(ObjProblemImpact.Description);
            curnt_value = Convert.ToString(Editorimpact.Text);
            ObjProblemHistoryDiff.Historyid = historyid;
            ObjProblemHistoryDiff.Columnname = "Description";
            ObjProblemHistoryDiff.Current_value = curnt_value;
            ObjProblemHistoryDiff.Prev_value = prev_value;
            ObjProblemHistoryDiff.Insert();
            #endregion
            ObjProblemImpact.Problemid = problemid;
            ObjProblemImpact.Description = Editorimpact.Text.ToString();
            ObjProblemImpact.Update();
            ShowImpactPlaceholder();
            btnupdateImpact.Visible = false;
            btncancellImpact.Visible = false;
            btncancellImpact.Visible = false;
            Editorimpact.Visible = false;
            lnimpedit.Visible = true;
            lnkimpadd.Visible = false;
            ShowRootcausePlaceholder();
            ShowSymptomPlaceholder();

        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
 protected void lnimpedit_Click(object sender, EventArgs e)
 {
     //Add Exception handilng try catch change by vishal 21-05-2012
     try
     {
         Editorimpact.Visible = true;
         btnsaveimpact.Visible = false;
         btncancellImpact.Visible = true;
         btnupdateImpact.Visible = true;
         int problemid = Convert.ToInt32(Request.QueryString[0]);
         ObjProblemImpact = ObjProblemImpact.Get_By_id(problemid);
         Editorimpact.Text = ObjProblemImpact.Description.ToString();
         EditorRootcause.Visible = false;
         btnupdateRootcause.Visible = false;
         btncancellRootcause.Visible = false;
         btnsaveRootcause.Visible = false;
         Editorsymptom.Visible = false;
         btnsaveSymtom.Visible = false;
         btncancellSymptom.Visible = false;
         btnupdatesymptom.Visible = false;
         ShowRootcausePlaceholder();
         ShowSymptomPlaceholder();
     }
     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;
        }
    }