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();
        }
    }
    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();
    }
Ejemplo n.º 3
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();
        }
    }
Ejemplo n.º 4
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;
            }
        }
    }
Ejemplo n.º 5
0
    protected void updateWorkaround()
    {
        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.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();
                }
            }
        }
    }
Ejemplo n.º 6
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 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();

        }
    }
Ejemplo n.º 8
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;
        }
    }