コード例 #1
0
    public void SentMailToPManager(int solutionid)
    {
        string          strYourSinscerely  = Resources.MessageResource.strYourSinscerely.ToString();
        string          strContactNumber   = Resources.MessageResource.strContactNumber.ToString();
        Solution_mst    objSolution        = new Solution_mst();
        SolutionCreator objSolutionCreator = new SolutionCreator();

        objSolution        = objSolution.Get_By_id(solutionid);
        objSolutionCreator = objSolutionCreator.Get_By_id(solutionid);
        UserLogin_mst objUserCreator = new UserLogin_mst();

        objUserCreator = objUserCreator.Get_By_id(objSolutionCreator.Createdby);
        int    FlagUser;
        string varRole = Resources.MessageResource.strPManagerRole.ToString();
        int    roleid;

        roleid  = objRole.Get_By_RoleName(varRole);
        colUser = objUser.Get_All_By_Role(roleid);
        foreach (UserLogin_mst objusr in colUser)
        {
            objC_info      = objC_info.Get_By_id(objusr.Userid);
            obj.From       = Resources.MessageResource.strAdminEmail.ToString();
            obj.To         = objC_info.Emailid;
            obj.Subject    = "New Solution Added. Solution Id : " + solutionid;
            obj.Body       = "Dear Sir/Madam,<br/>A New Solution has been Added.Please find the New Solution details .<br/><br/><b>Solution Details : </b> <br/><br/><b>Solution Id &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSolution.Solutionid + "<br/><b>Title &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSolution.Title + " <br/><b>Added By &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objUserCreator.Username + "<br/><b>Created Date &nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSolutionCreator.CreateDatetime + "<br/><b>Content&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSolution.Content + "<br/><br/>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>";
            obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
            obj.SentMail();
        }
    }
コード例 #2
0
    public void Repeter_ItemDataBound(Object Sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item)
        {
            int topicid;

            //topicid = Convert.ToInt16(DataBinder.Eval(e.Item.DataItem, "topicid"));
            Label topicidL = (Label)e.Item.FindControl("lbltopicid");
            topicid          = Convert.ToInt16(topicidL.Text);
            ObjCategory      = ObjCategory.Get_By_id(topicid);
            topicidL.Text    = ObjCategory.CategoryName;
            topicidL.Visible = true;
        }
        else if (e.Item.ItemType == ListItemType.AlternatingItem)
        {
            int topicid;

            //topicid = Convert.ToInt16(DataBinder.Eval(e.Item.DataItem, "topicid"));
            Label topicidL = (Label)e.Item.FindControl("lbltopicid");
            topicid          = Convert.ToInt16(topicidL.Text);
            ObjCategory      = ObjCategory.Get_By_id(topicid);
            topicidL.Text    = ObjCategory.CategoryName;
            topicidL.Visible = true;
        }


        if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
        {
            CheckBox ck = (CheckBox)e.Item.FindControl("CheckBox1");

            Label lbl        = (Label)e.Item.FindControl("lblapprove");
            Label solutionid = (Label)e.Item.FindControl("lblsolutionid");
            Image imgapprove = (Image)e.Item.FindControl("imgapprove");
            Image imgreject  = (Image)e.Item.FindControl("Imgunapproved");
            int   slid       = Convert.ToInt16(solutionid.Text);
            int   solid      = Convert.ToInt16(solutionid.Text);

            ObjSolution   = ObjSolution.Get_By_id(solid);
            approvestatus = Convert.ToInt16(ObjSolution.SolutionStatus);
            if (approvestatus == 1)
            {
                lbl.Text           = "Approved";
                imgapprove.Visible = true;
                imgreject.Visible  = false;
            }

            else if (approvestatus == 2)
            {
                lbl.Text           = "Rejected";
                imgapprove.Visible = false;
                imgreject.Visible  = true;
            }
            else
            {
                lbl.Text           = "Unapproved";
                imgapprove.Visible = false;
                imgreject.Visible  = false;
            }
        }
    }
コード例 #3
0
    protected void updateSolution()
    {
        int problemid = Convert.ToInt32(Request.QueryString[1]);
        int flag      = Convert.ToInt32(Request.QueryString[0]);

        colproblems = ObjproblemToSolution.Get_All_Problemid(problemid);
        foreach (ProblemToSolution obj in colproblems)
        {
            if (obj.Problemid != 0)
            {
                if (obj.Solutiontype == "Solution")
                {
                    ObjSolution = ObjSolution.Get_By_id(obj.Solutionid);
                    if (ObjSolution.Solution == "Solution")
                    {
                        ObjSolutionKeyword     = ObjSolutionKeyword.Get_By_id(ObjSolution.Solutionid);
                        txtTitle.Text          = ObjSolution.Title.ToString();
                        txtKeywords.Text       = ObjSolutionKeyword.Keywords.ToString();
                        drpTopic.SelectedValue = Convert.ToString(ObjSolution.Topicid);
                        Editor.Text            = ObjSolution.Content.ToString();
                    }
                }
            }
        }
    }
    public void updatecomment()
    {
        string         userName;
        MembershipUser User = Membership.GetUser();

        solutionstatusid = Convert.ToInt16(Request.QueryString[0]);
        flag             = Convert.ToInt16(Request.QueryString[1]);
        int userid;

        if (flag == 3)
        {
            string seeionsid = Session["SolutionId"].ToString();

            string[] str = seeionsid.Split(new char[] { ',' });
            foreach (string s in str)
            {
                if (s == "")
                {
                    break;
                }
                int solid = Convert.ToInt16(s);
                ObjSolution                = ObjSolution.Get_By_id(solid);
                ObjSolution.Title          = ObjSolution.Title;
                ObjSolution.Topicid        = ObjSolution.Topicid;
                ObjSolution.Content        = ObjSolution.Content;
                ObjSolution.Comments       = txtcomments.Text;
                ObjSolution.SolutionStatus = solutionstatusid;
                ObjSolution.Update();

                userName = User.UserName.ToString();

                Objorganization = Objorganization.Get_Organization();
                objUser         = objUser.Get_UserLogin_By_UserName(userName, Objorganization.Orgid);
                ObjSolutionCreator.Solutionid   = solid;
                ObjSolutionCreator.LastUpdateBy = objUser.Userid;
                ObjSolutionCreator.Update();
            }
        }
        else
        {
            int solutionid = Convert.ToInt16(Request.QueryString[1]);

            ObjSolution                = ObjSolution.Get_By_id(solutionid);
            ObjSolution.Title          = ObjSolution.Title;
            ObjSolution.Topicid        = ObjSolution.Topicid;
            ObjSolution.Content        = ObjSolution.Content;
            ObjSolution.Comments       = txtcomments.Text;
            ObjSolution.SolutionStatus = solutionstatusid;
            ObjSolution.Update();

            userName = User.UserName.ToString();

            Objorganization = Objorganization.Get_Organization();
            objUser         = objUser.Get_UserLogin_By_UserName(userName, Objorganization.Orgid);
            ObjSolutionCreator.Solutionid   = solutionid;
            ObjSolutionCreator.LastUpdateBy = objUser.Userid;
            ObjSolutionCreator.Update();
        }
    }
    public void updatecomment()
    {
        string userName;
        MembershipUser User = Membership.GetUser();

        solutionstatusid = Convert.ToInt32(Request.QueryString[0]);
        flag = Convert.ToInt32(Request.QueryString[1]);
        int userid;
        if (flag == 3)
        {
            string seeionsid = Session["SolutionId"].ToString();

            string[] str = seeionsid.Split(new char[] { ',' });
            foreach (string s in str)
            {
                if (s == "")
                {
                    break;
                }
                int solid = Convert.ToInt32(s);
                ObjSolution = ObjSolution.Get_By_id(solid);
                ObjSolution.Title = ObjSolution.Title;
                ObjSolution.Topicid = ObjSolution.Topicid;
                ObjSolution.Content = ObjSolution.Content;
                ObjSolution.Comments = txtcomments.Text;
                ObjSolution.SolutionStatus = solutionstatusid;
                ObjSolution.Update();

                userName = User.UserName.ToString();

                Objorganization = Objorganization.Get_Organization();
                objUser = objUser.Get_UserLogin_By_UserName(userName, Objorganization.Orgid);
                ObjSolutionCreator.Solutionid = solid;
                ObjSolutionCreator.LastUpdateBy = objUser.Userid;
                ObjSolutionCreator.Update();
            }
        }
        else
        {
            int solutionid = Convert.ToInt32(Request.QueryString[1]);

            ObjSolution = ObjSolution.Get_By_id(solutionid);
            ObjSolution.Title = ObjSolution.Title;
            ObjSolution.Topicid = ObjSolution.Topicid;
            ObjSolution.Content = ObjSolution.Content;
            ObjSolution.Comments = txtcomments.Text;
            ObjSolution.SolutionStatus = solutionstatusid;
            ObjSolution.Update();

            userName = User.UserName.ToString();

            Objorganization = Objorganization.Get_Organization();
            objUser = objUser.Get_UserLogin_By_UserName(userName, Objorganization.Orgid);
            ObjSolutionCreator.Solutionid = solutionid;
            ObjSolutionCreator.LastUpdateBy = objUser.Userid;
            ObjSolutionCreator.Update();
        }
    }
    protected void UpdateSolution()
    {
        int Solutionid = Convert.ToInt16(Request.QueryString[0]);

        ObjSolution            = ObjSolution.Get_By_id(Solutionid);
        ObjSolutionKeyword     = ObjSolutionKeyword.Get_By_id(Solutionid);
        txtTitle.Text          = ObjSolution.Title.ToString();
        Editor.Text            = ObjSolution.Content.ToString();
        drpTopic.SelectedValue = ObjSolution.Topicid.ToString();
        ObjSolutionKeyword     = ObjSolutionKeyword.Get_By_id(Solutionid);
        txtKeywords.Text       = ObjSolutionKeyword.Keywords.ToString();
    }
    protected void updateWorkaround()
    {
        int problemid = Convert.ToInt16(Request.QueryString[1]);
        int flag = Convert.ToInt16(Request.QueryString[0]);
        colproblems = ObjproblemToSolution.Get_All_Problemid(problemid);
        foreach (ProblemToSolution obj in colproblems)
        {

                if (obj.Solutiontype == "WorkAround" )
                {
                    ObjSolution = ObjSolution.Get_By_id(obj.Solutionid);
                    if (ObjSolution.Solution == "WorkAround")
                    {
                        ObjSolutionKeyword = ObjSolutionKeyword.Get_By_id(obj.Solutionid);
                        txtTitle.Text = ObjSolution.Title.ToString();
                        txtKeywords.Text = ObjSolutionKeyword.Keywords.ToString();
                        drpTopic.SelectedValue = Convert.ToString(ObjSolution.Topicid);
                        Editor.Text = ObjSolution.Content.ToString();
                    }
                }

            }
    }
 public int Update_Solution_mst_By_id(Solution_mst ObjSolution)
 {
     return (int)ExecuteNonQuery(Sp_Solution_Update, new object[] { ObjSolution.Solutionid, ObjSolution.Title, ObjSolution.Content, ObjSolution.Topicid, ObjSolution.Solution, ObjSolution.Comments, ObjSolution.SolutionStatus });
 }
    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);
    }
コード例 #10
0
    public void Repeter_ItemDataBound(Object Sender, RepeaterItemEventArgs e)
    {/////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            if (e.Item.ItemType == ListItemType.Item)
            {
                int topicid;

                //topicid = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "topicid"));
                Label topicidL = (Label)e.Item.FindControl("lbltopicid");
                topicid          = Convert.ToInt32(topicidL.Text);
                ObjCategory      = ObjCategory.Get_By_id(topicid);
                topicidL.Text    = ObjCategory.CategoryName;
                topicidL.Visible = true;
            }
            else if (e.Item.ItemType == ListItemType.AlternatingItem)
            {
                int topicid;

                //topicid = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "topicid"));
                Label topicidL = (Label)e.Item.FindControl("lbltopicid");
                topicid          = Convert.ToInt32(topicidL.Text);
                ObjCategory      = ObjCategory.Get_By_id(topicid);
                topicidL.Text    = ObjCategory.CategoryName;
                topicidL.Visible = true;
            }


            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                CheckBox ck = (CheckBox)e.Item.FindControl("CheckBox1");

                Label lbl        = (Label)e.Item.FindControl("lblapprove");
                Label solutionid = (Label)e.Item.FindControl("lblsolutionid");
                Image imgapprove = (Image)e.Item.FindControl("imgapprove");
                Image imgreject  = (Image)e.Item.FindControl("Imgunapproved");
                int   slid       = Convert.ToInt32(solutionid.Text);
                int   solid      = Convert.ToInt32(solutionid.Text);

                ObjSolution   = ObjSolution.Get_By_id(solid);
                approvestatus = Convert.ToInt32(ObjSolution.SolutionStatus);
                if (approvestatus == 1)
                {
                    lbl.Text           = "Approved";
                    imgapprove.Visible = true;
                    imgreject.Visible  = false;
                }

                else if (approvestatus == 2)
                {
                    lbl.Text           = "Rejected";
                    imgapprove.Visible = false;
                    imgreject.Visible  = true;
                }
                else
                {
                    lbl.Text           = "Unapproved";
                    imgapprove.Visible = false;
                    imgreject.Visible  = false;
                }
            }
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
 protected void UpdateSolution()
 {
     int Solutionid = Convert.ToInt16(Request.QueryString[0]);
     ObjSolution = ObjSolution.Get_By_id(Solutionid);
     ObjSolutionKeyword = ObjSolutionKeyword.Get_By_id(Solutionid);
     txtTitle.Text = ObjSolution.Title.ToString();
     Editor.Text=ObjSolution.Content.ToString();
     drpTopic.SelectedValue = ObjSolution.Topicid.ToString();
     ObjSolutionKeyword = ObjSolutionKeyword.Get_By_id(Solutionid);
     txtKeywords.Text = ObjSolutionKeyword.Keywords.ToString();
 }
コード例 #12
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;
        }
    }
    protected void ShowPanal1()
    {
        panShowdata.Visible = true;
        panEditData.Visible = false;

        int Solutionid = Convert.ToInt16(Request.QueryString[0]);

        ObjSolution        = ObjSolution.Get_By_id(Solutionid);
        ObjSolutionKeyword = ObjSolutionKeyword.Get_By_id(Solutionid);
        if (ObjCategory.CategoryName == null)
        {
            lbltitle.Text         = ObjSolution.Title.ToString();
            lblcontent.Text       = ObjSolution.Content.ToString();
            ObjCategory           = ObjCategory.Get_By_id(ObjSolution.Topicid);
            lbltopic.Text         = "";
            lblkeyword.Text       = ObjSolutionKeyword.Keywords.ToString();
            lblsolid.Text         = Solutionid.ToString();
            editsolheader.Visible = false;
        }
        else
        {
            lbltitle.Text         = ObjSolution.Title.ToString();
            lblcontent.Text       = ObjSolution.Content.ToString();
            ObjCategory           = ObjCategory.Get_By_id(ObjSolution.Topicid);
            lbltopic.Text         = ObjCategory.CategoryName.ToString();
            lblkeyword.Text       = ObjSolutionKeyword.Keywords.ToString();
            lblsolid.Text         = Solutionid.ToString();
            editsolheader.Visible = false;
        }

        int status = Convert.ToInt16(ObjSolution.SolutionStatus);

        if (status == 1)
        {
            imgapprove.Visible    = true;
            Imgunapproved.Visible = false;
            lblapprove.Text       = "Approve";
        }
        else if (status == 2)
        {
            Imgunapproved.Visible = true;
            imgapprove.Visible    = false;
            lblapprove.Text       = "Rejected";
        }
        else
        {
            imgapprove.Visible    = false;
            Imgunapproved.Visible = false;
            lblapprove.Text       = "UnApproved";
        }

        ObjSolutionCreator = ObjSolutionCreator.Get_By_id(ObjSolution.Solutionid);

        int userid = Convert.ToInt16(ObjSolutionCreator.Createdby);

        objUser = objUser.Get_By_id(userid);

        lblcreatedby.Text = objUser.Username.ToString();
        lblcreatedon.Text = ObjSolutionCreator.CreateDatetime.ToString();
        int lastupdateid = Convert.ToInt16(ObjSolutionCreator.LastUpdateBy);

        if (lastupdateid != 0)
        {
            objUser = objUser.Get_By_id(lastupdateid);
            lbllastupdateon.Text = ObjSolutionCreator.LastUpdateon.ToString();
            lbllastupdate.Text   = objUser.Username.ToString();
        }
        else
        {
            lbllastupdateon.Text = "";
            lbllastupdate.Text   = "";
        }



        //if (objUser.Username == "")
        //{
        //    lbllastupdate.Text = objUser.Username.ToString();
        //    lbllastupdate.Text = objUser.Username.ToString();

        //}

        //else
        //{
        //    lbllastupdate.Text = "";
        //    lbllastupdateon.Text = "";
        //}
        //if (objUser.Username != "")
        //{
        //    lbllastupdate.Text = objUser.Username.ToString();

        //}
        //if (ObjSolutionCreator.LastUpdateon == "")
        //{
        //    lbllastupdateon.Text = ObjSolutionCreator.LastUpdateon.ToString();

        //}
        //if (ObjSolutionCreator.LastUpdateon != "")
        //{
        //    lbllastupdateon.Text = ObjSolutionCreator.LastUpdateon.ToString();

        //}
    }
    public void SentMailToPManager(int solutionid)
    {
        string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString();
        string strContactNumber = Resources.MessageResource.strContactNumber.ToString();
        Solution_mst objSolution = new Solution_mst();
        SolutionCreator objSolutionCreator = new SolutionCreator();
        objSolution = objSolution.Get_By_id(solutionid);
        objSolutionCreator = objSolutionCreator.Get_By_id(solutionid);
        UserLogin_mst objUserCreator = new UserLogin_mst();
        objUserCreator = objUserCreator.Get_By_id(objSolutionCreator.Createdby);
        int FlagUser;
        string varRole = Resources.MessageResource.strPManagerRole.ToString();
        int roleid;
        roleid = objRole.Get_By_RoleName(varRole);
        colUser = objUser.Get_All_By_Role(roleid);
        foreach (UserLogin_mst objusr in colUser)
        {

            objC_info = objC_info.Get_By_id(objusr.Userid);
            obj.From = Resources.MessageResource.strAdminEmail.ToString();
            obj.To = objC_info.Emailid;
            obj.Subject = "New Solution Added. Solution Id : " + solutionid;
            obj.Body = "Dear Sir/Madam,<br/>A New Solution has been Added.Please find the New Solution details .<br/><br/><b>Solution Details : </b> <br/><br/><b>Solution Id &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSolution.Solutionid + "<br/><b>Title &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSolution.Title + " <br/><b>Added By &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objUserCreator.Username + "<br/><b>Created Date &nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSolutionCreator.CreateDatetime + "<br/><b>Content&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSolution.Content + "<br/><br/>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>";
            obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
            obj.SentMail();

        }
    }
    public CollectionBase GenerateSolution_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<Solution_mst> col = new BLLCollection<Solution_mst>();
        while (returnData.Read())
        {

            Solution_mst obj = new Solution_mst();
            if (returnData["Solutionid"] != DBNull.Value)
            {
                obj.Solutionid = (int)returnData["Solutionid"];
            }
            if (returnData["Title"] != DBNull.Value)
            {
                obj.Title = (string)returnData["Title"];
            }
            if (returnData["Content"] != DBNull.Value)
            {
                obj.Content = (string)returnData["Content"];
            }

            if (returnData["Solution"] != DBNull.Value)
            {
                obj.Solution = (string)returnData["Solution"];
            }
            if (returnData["Topicid"] != DBNull.Value)
            {
                obj.Topicid = (int)returnData["Topicid"];
            }
            if (returnData["Comments"] != DBNull.Value)
            {
                obj.Comments = (string)returnData["Comments"];
            }
            if (returnData["Solutionstatusid"] != DBNull.Value)
            {
                obj.SolutionStatus = (int)returnData["Solutionstatusid"];
            }
            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }
 public int Insert_Solution_mst(Solution_mst objSolution)
 {
     return (int)ExecuteNonQuery(Sp_Solution_Insert, new object[] { objSolution.Title, objSolution.Content, objSolution.Topicid, objSolution.Solution, objSolution.Comments, objSolution.SolutionStatus });
 }
    public Object GenerateSolution_mstObject(ref IDataReader returnData)
    {
        Solution_mst obj = new Solution_mst();
        while (returnData.Read())
        {

            if (returnData["Solutionid"] != DBNull.Value)
            {
                obj.Solutionid = (int)returnData["Solutionid"];
            }
            if (returnData["Title"] != DBNull.Value)
            {
                obj.Title = (string)returnData["Title"];
            }
            if (returnData["Content"] != DBNull.Value)
            {
                obj.Content = (string)returnData["Content"];
            }

            if (returnData["Solution"] != DBNull.Value)
            {
                obj.Solution = (string)returnData["Solution"];
            }
            if (returnData["Topicid"] != DBNull.Value)
            {
                obj.Topicid = (int)returnData["Topicid"];
            }
            if (returnData["Comments"] != DBNull.Value)
            {
                obj.Comments = (string)returnData["Comments"];
            }
            if (returnData["Solutionstatusid"] != DBNull.Value)
            {
                obj.SolutionStatus = (int)returnData["Solutionstatusid"];
            }

        }
        returnData.Close();
        returnData.Dispose();
        return obj;
    }
    public void Repeter_ItemDataBound(Object Sender, RepeaterItemEventArgs e)
    {
        /////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            if (e.Item.ItemType == ListItemType.Item)
            {
                int topicid;

                //topicid = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "topicid"));
                Label topicidL = (Label)e.Item.FindControl("lbltopicid");
                topicid = Convert.ToInt32(topicidL.Text);
                ObjCategory = ObjCategory.Get_By_id(topicid);
                topicidL.Text = ObjCategory.CategoryName;
                topicidL.Visible = true;

            }
            else if (e.Item.ItemType == ListItemType.AlternatingItem)
            {
                int topicid;

                //topicid = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "topicid"));
                Label topicidL = (Label)e.Item.FindControl("lbltopicid");
                topicid = Convert.ToInt32(topicidL.Text);
                ObjCategory = ObjCategory.Get_By_id(topicid);
                topicidL.Text = ObjCategory.CategoryName;
                topicidL.Visible = true;

            }

            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                CheckBox ck = (CheckBox)e.Item.FindControl("CheckBox1");

                Label lbl = (Label)e.Item.FindControl("lblapprove");
                Label solutionid = (Label)e.Item.FindControl("lblsolutionid");
                Image imgapprove = (Image)e.Item.FindControl("imgapprove");
                Image imgreject = (Image)e.Item.FindControl("Imgunapproved");
                int slid = Convert.ToInt32(solutionid.Text);
                int solid = Convert.ToInt32(solutionid.Text);

                ObjSolution = ObjSolution.Get_By_id(solid);
                approvestatus = Convert.ToInt32(ObjSolution.SolutionStatus);
                if (approvestatus == 1)
                {

                    lbl.Text = "Approved";
                    imgapprove.Visible = true;
                    imgreject.Visible = false;

                }

                else if (approvestatus == 2)
                {

                    lbl.Text = "Rejected";
                    imgapprove.Visible = false;
                    imgreject.Visible = true;

                }
                else
                {

                    lbl.Text = "Unapproved";
                    imgapprove.Visible = false;
                    imgreject.Visible = false;

                }

            }
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
    public void Repeter_ItemDataBound(Object Sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item)
        {
            int topicid;

            //topicid = Convert.ToInt16(DataBinder.Eval(e.Item.DataItem, "topicid"));
            Label topicidL = (Label)e.Item.FindControl("lbltopicid");
            topicid = Convert.ToInt16(topicidL.Text);
            ObjCategory = ObjCategory.Get_By_id(topicid);
            topicidL.Text = ObjCategory.CategoryName;
            topicidL.Visible = true;

        }
        else if (e.Item.ItemType == ListItemType.AlternatingItem)
        {
            int topicid;

            //topicid = Convert.ToInt16(DataBinder.Eval(e.Item.DataItem, "topicid"));
            Label topicidL = (Label)e.Item.FindControl("lbltopicid");
            topicid = Convert.ToInt16(topicidL.Text);
            ObjCategory = ObjCategory.Get_By_id(topicid);
            topicidL.Text = ObjCategory.CategoryName;
            topicidL.Visible = true;

        }

        if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
        {
            CheckBox ck = (CheckBox)e.Item.FindControl("CheckBox1");

            Label lbl = (Label)e.Item.FindControl("lblapprove");
            Label solutionid = (Label)e.Item.FindControl("lblsolutionid");
            Image imgapprove = (Image)e.Item.FindControl("imgapprove");
            Image imgreject = (Image)e.Item.FindControl("Imgunapproved");
            int slid = Convert.ToInt16(solutionid.Text);
            int solid = Convert.ToInt16(solutionid.Text);

            ObjSolution = ObjSolution.Get_By_id(solid);
            approvestatus = Convert.ToInt16(ObjSolution.SolutionStatus);
            if (approvestatus == 1)
            {

                lbl.Text = "Approved";
                imgapprove.Visible = true;
                imgreject.Visible = false;

            }

            else if (approvestatus == 2)
            {

                lbl.Text = "Rejected";
                imgapprove.Visible = false;
                imgreject.Visible = true;

            }
            else
            {

                lbl.Text = "Unapproved";
                imgapprove.Visible = false;
                imgreject.Visible = false;

            }

        }
    }
    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 ShowPanal1()
    {
        panShowdata.Visible = true;
        panEditData.Visible = false;

        int Solutionid = Convert.ToInt16(Request.QueryString[0]);
        ObjSolution = ObjSolution.Get_By_id(Solutionid);
        ObjSolutionKeyword = ObjSolutionKeyword.Get_By_id(Solutionid);
        if(ObjCategory.CategoryName==null)
        {
            lbltitle.Text = ObjSolution.Title.ToString();
            lblcontent.Text = ObjSolution.Content.ToString();
            ObjCategory = ObjCategory.Get_By_id(ObjSolution.Topicid);
            lbltopic.Text = "";
            lblkeyword.Text = ObjSolutionKeyword.Keywords.ToString();
            lblsolid.Text = Solutionid.ToString();
            editsolheader.Visible = false;
        }
        else
        {
            lbltitle.Text = ObjSolution.Title.ToString();
            lblcontent.Text = ObjSolution.Content.ToString();
            ObjCategory = ObjCategory.Get_By_id(ObjSolution.Topicid);
            lbltopic.Text = ObjCategory.CategoryName.ToString();
            lblkeyword.Text = ObjSolutionKeyword.Keywords.ToString();
            lblsolid.Text = Solutionid.ToString();
            editsolheader.Visible = false;
        }

        int status=Convert.ToInt16(ObjSolution.SolutionStatus);
        if (status ==1)
        {
            imgapprove.Visible = true;
            Imgunapproved.Visible = false;
            lblapprove.Text = "Approve";
        }
        else if (status == 2)
        {
            Imgunapproved.Visible = true;
            imgapprove.Visible = false;
            lblapprove.Text = "Rejected";
        }
        else
        {
            imgapprove.Visible = false;
            Imgunapproved.Visible = false;
            lblapprove.Text = "UnApproved";
        }

        ObjSolutionCreator = ObjSolutionCreator.Get_By_id(ObjSolution.Solutionid);

        int userid = Convert.ToInt16(ObjSolutionCreator.Createdby);
        objUser = objUser.Get_By_id(userid);

        lblcreatedby.Text = objUser.Username.ToString();
        lblcreatedon.Text = ObjSolutionCreator.CreateDatetime.ToString();
        int lastupdateid = Convert.ToInt16(ObjSolutionCreator.LastUpdateBy);
        if (lastupdateid != 0)
        {
            objUser = objUser.Get_By_id(lastupdateid);
            lbllastupdateon.Text = ObjSolutionCreator.LastUpdateon.ToString();
            lbllastupdate.Text = objUser.Username.ToString();

        }
        else
        {
            lbllastupdateon.Text = "";
            lbllastupdate.Text = "";

        }

        //if (objUser.Username == "")
        //{
        //    lbllastupdate.Text = objUser.Username.ToString();
        //    lbllastupdate.Text = objUser.Username.ToString();

        //}

        //else
        //{
        //    lbllastupdate.Text = "";
        //    lbllastupdateon.Text = "";
        //}
        //if (objUser.Username != "")
        //{
        //    lbllastupdate.Text = objUser.Username.ToString();

        //}
        //if (ObjSolutionCreator.LastUpdateon == "")
        //{
        //    lbllastupdateon.Text = ObjSolutionCreator.LastUpdateon.ToString();

        //}
        //if (ObjSolutionCreator.LastUpdateon != "")
        //{
        //    lbllastupdateon.Text = ObjSolutionCreator.LastUpdateon.ToString();

        //}
    }