Beispiel #1
0
    public void SentmailTechnician(int technicianid, int incidentid)
    {
        string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString();
        string strContactNumber  = Resources.MessageResource.strContactNumber.ToString();

        objIncident       = objIncident.Get_By_id(incidentid);
        objSite           = objSite.Get_By_id(objIncident.Siteid);
        objIncidentStates = objIncidentStates.Get_By_id(incidentid);
        objPriority       = objPriority.Get_By_id(objIncidentStates.Priorityid);
        objUser           = objUser.Get_By_id(objIncident.Requesterid);
        objtech           = objtech.Get_By_id(technicianid);
        objSDE            = objSDE.Get_By_id(objIncident.Createdbyid);
        objC_info         = objC_info.Get_By_id(technicianid);
        objUserInfo       = objUserInfo.Get_By_id(objIncident.Requesterid);

        if (objC_info.Emailid != null)
        {
            obj.To         = objC_info.Emailid;
            obj.From       = Resources.MessageResource.strAdminEmail.ToString();
            obj.Subject    = " New Call Assigned to you. Ticket id : " + incidentid;
            obj.Body       = "Dear&nbsp;" + objtech.Username + "," + "<br/>  A Call with the following details have been assigned to you.<br/><br/><b>Complaints Details : </b> <br/><br/><b>Ticket Id&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;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + incidentid + "<br/><b>Title of Call&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>" + objIncident.Title + " <br/><b>Site&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSite.Sitename + "<br/><b>Logged Date & Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Createdatetime + "<br/><b>Description&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>" + objIncident.Description + "<br/><b>Priority&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> " + objPriority.Name + "<br/><b>UserName&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>" + objUser.Username + "<br/><b>Mobile No.&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/>" + objUserInfo.Mobile + "<br/><b>Landline No.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:<b/>" + objUserInfo.Landline + "<br/><b>Mail Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objC_info.Emailid + "<br/><b>Service Desk Executive&nbsp;&nbsp;&nbsp;:</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at <b>" + strContactNumber + "</b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>";
            obj.SmtpServer = obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
            obj.SentMail();
        }
    }
Beispiel #2
0
    string GetUsername(int userid)
    {
        string username = "";

        objUser = objUser.Get_By_id(userid);
        if (objUser.Userid != 0)
        {
            username = objUser.Username;
        }
        return(username);
    }
Beispiel #3
0
    protected void btnMapped_Click(object sender, EventArgs e)
    {
        //lblErrorMsg.Text = "";
        int flag = 0;

        foreach (GridViewRow gv in grdvwViewUser.Rows)
        {
            string      gvIDs;
            RadioButton selectonebutton = (RadioButton)gv.FindControl("selectone");
            if (selectonebutton.Checked)
            {
                flag    = 1;
                gvIDs   = ((Label)gv.FindControl("lblUserID")).Text.ToString();
                userid  = Convert.ToInt32(gvIDs);
                objUser = objUser.Get_By_id(userid);
                string username = objUser.Username.ToString();
                Session["username"] = username;
                Session["userid"]   = userid;
                Session["flag"]     = flag;
                Session["flag2"]    = flag;
                break;
            }
        }
        string myScript;

        myScript = "<script language=javascript>javascript:refreshParent(); javascript:window.close();</script>";
        Page.RegisterClientScriptBlock("MyScript", myScript);
    }
Beispiel #4
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();
        }
    }
    protected void Showvalues()
    {
        int incidentid = Convert.ToInt32(Session["incidentid"]);

        ObjIncident       = ObjIncident.Get_By_id(incidentid);
        ObjIncidentStates = ObjIncidentStates.Get_By_id(incidentid);
        // drpTechnician.SelectedValue = ObjIncidentStates.Technicianid.ToString();
        drpCategory.SelectedValue = ObjIncidentStates.Categoryid.ToString();
        BindDropSubCategory();
        drpSubcategory.SelectedValue = ObjIncidentStates.Subcategoryid.ToString();

        // drpPriority.SelectedValue = ObjIncidentStates.Priorityid.ToString();
        txtTitle.Text = ObjIncident.Title.ToString();
        if (ObjIncident.Description != null)
        {
            txtDescription.Text = ObjIncident.Description.ToString();
        }

        UserLogin_mst   objUsr  = new UserLogin_mst();
        ContactInfo_mst objInfo = new ContactInfo_mst();

        objInfo                 = objInfo.Get_By_id(ObjIncident.Requesterid);
        objUsr                  = objUsr.Get_By_id(ObjIncident.Requesterid);
        txtUsername.Text        = objUsr.Username;
        txtEmail.Text           = objInfo.Emailid;
        ViewState["UserCreate"] = "Exist";
    }
Beispiel #6
0
    public void SentMailToTechnicianForProblemCall(int problemid, int userid)
    {
        string      strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString();
        string      strContactNumber  = Resources.MessageResource.strContactNumber.ToString();
        Problem_mst objProblem        = new Problem_mst();

        objUser = objUser.Get_By_id(userid);
        ContactInfo_mst objCont_info = new ContactInfo_mst();

        objCont_info = objCont_info.Get_By_id(objUser.Userid);
        objProblem   = objProblem.Get_By_id(problemid);
        objPriority  = objPriority.Get_By_id(objProblem.Priorityid);
        UserLogin_mst objReq = new UserLogin_mst();

        objReq = objReq.Get_By_id(objProblem.Requesterid);
        ContactInfo_mst objReqCont = new ContactInfo_mst();

        objReqCont = objReqCont.Get_By_id(objReq.Userid);
        objSDE     = objSDE.Get_By_id(objProblem.CreatedByid);

        if (objCont_info.Emailid != null)
        {
            obj.To         = objCont_info.Emailid;
            obj.From       = Resources.MessageResource.strAdminEmail.ToString();
            obj.Subject    = " New Problem Call Assigned to you. Problem Id : " + problemid;
            obj.Body       = "Dear&nbsp;" + objUser.Username + "," + "<br/>  A Call with the following details have been assigned to you.<br/><br/><b>Problem Details : </b> <br/><br/><b>Problem Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objProblem.ProblemId + "<br/><b>Title of Call&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>" + objProblem.title + " <br/><b>Logged Date & Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;:</b>" + objProblem.CreateDatetime + "<br/><b>Description&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>" + objProblem.Description + "<br/><b>Priority&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> " + objPriority.Name + "<br/><b>UserName&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>" + objReq.Username + "<br/><b>Mobile No.&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/>" + objReqCont.Mobile + "<br/><b>Landline No.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:<b/>" + objReqCont.Landline + "<br/><b>Mail Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objReqCont.Emailid + "<br/><b>Service Desk Executive&nbsp;&nbsp;&nbsp;:</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at <b>" + strContactNumber + "</b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>";
            obj.SmtpServer = obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
            obj.SentMail();
        }
    }
Beispiel #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string strStatusClose = Resources.MessageResource.strStatusClose.ToString().Trim();
        string statusString   = "";
        int    incidentid     = Convert.ToInt16(Request.QueryString[0]);

        Objincident          = Objincident.Get_By_id(incidentid);
        Objincidentstate     = Objincidentstate.Get_By_id(incidentid);
        Objincidentresoution = Objincidentresoution.Get_By_id(incidentid);
        objstatus            = objstatus.Get_By_id(Objincidentstate.Statusid);
        statusString         = objstatus.Statusname.ToString();
        if (statusString.ToLower() == strStatusClose.ToLower())
        {
            lbltcktno.Text     = Objincident.Incidentid.ToString();
            lblcreatedate.Text = Objincident.Createdatetime.ToString();

            if (Objincidentstate.AssignedTime != null)
            {
                lblstarttime.Text = Objincidentstate.AssignedTime.ToString();
            }
            lblendtime.Text = Objincident.Completedtime.ToString();
            Objcategory     = Objcategory.Get_By_id(Objincidentstate.Categoryid);

            lblcomponenteffected.Text = Objcategory.CategoryName.ToString();
            lbldescription.Text       = Objincident.Title.ToString();
            string bb       = Objincidentresoution.Resolution.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(Objincident.Requesterid);
            lblcustomer.Text  = objUser.Username.ToString();
            objUser           = objUser.Get_By_id(Objincidentstate.Technicianid);
            lblengineer.Text  = objUser.Username.ToString();
            objstatus         = objstatus.Get_By_id(Objincidentstate.Statusid);
            lblrcaresult.Text = objstatus.Statusname.ToString();
        }
        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();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string strStatusClose = Resources.MessageResource.strStatusClose.ToString().Trim();
        string statusString = "";
        int incidentid =Convert.ToInt16(Request.QueryString[0]);
        Objincident = Objincident.Get_By_id(incidentid);
        Objincidentstate = Objincidentstate.Get_By_id(incidentid);
        Objincidentresoution = Objincidentresoution.Get_By_id(incidentid);
        objstatus = objstatus.Get_By_id(Objincidentstate.Statusid);
        statusString = objstatus.Statusname.ToString();
         if (statusString.ToLower() == strStatusClose.ToLower())
        {
        lbltcktno.Text = Objincident.Incidentid.ToString();
        lblcreatedate.Text = Objincident.Createdatetime.ToString();

        if (Objincidentstate.AssignedTime != null)
        {
            lblstarttime.Text = Objincidentstate.AssignedTime.ToString();
        }
        lblendtime.Text = Objincident.Completedtime.ToString();
        Objcategory=Objcategory.Get_By_id(Objincidentstate.Categoryid);

        lblcomponenteffected.Text = Objcategory.CategoryName.ToString();
        lbldescription.Text = Objincident.Title.ToString();
        string bb = Objincidentresoution.Resolution.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(Objincident.Requesterid);
           lblcustomer.Text = objUser.Username.ToString();
           objUser = objUser.Get_By_id(Objincidentstate.Technicianid);
           lblengineer.Text = objUser.Username.ToString();
           objstatus = objstatus.Get_By_id(Objincidentstate.Statusid);
           lblrcaresult.Text = objstatus.Statusname.ToString();
           }
        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();
    }
    protected void Showvalues()
    {
        int problemid = Convert.ToInt16(Session["problemid"]);

        ObjProblem = ObjProblem.Get_By_id(problemid);
        drpTechnician.SelectedValue = ObjProblem.Technicianid.ToString();
        drpCategory.SelectedValue   = ObjProblem.Categoryid.ToString();
        BindDropSubCategory();
        drpSubcategory.SelectedValue = ObjProblem.Subcategoryid.ToString();
        drpPriority.SelectedValue    = ObjProblem.Priorityid.ToString();
        txtTitle.Text       = ObjProblem.title.ToString();
        txtDescription.Text = ObjProblem.Description.ToString();
        ObjUserLogin        = ObjUserLogin.Get_By_id(ObjProblem.Requesterid);
    }
Beispiel #10
0
    protected void BindIncidentToProblem()
    {
        if (Session["IncidentToProblem"] != null)
        {
            int incidentid = Convert.ToInt32(Session["IncidentToProblem"].ToString());

            Incident_mst   objIncident       = new Incident_mst();
            IncidentStates objIncidentStates = new IncidentStates();
            objIncident       = objIncident.Get_By_id(incidentid);
            objIncidentStates = objIncidentStates.Get_By_id(incidentid);
            objuser           = objuser.Get_By_id(objIncident.Requesterid);
            if (objIncidentStates.Priorityid != 0)
            {
                drpPriority.SelectedValue = Convert.ToString(objIncidentStates.Priorityid);
            }
            if (objIncidentStates.Categoryid != 0)
            {
                drpCategory.SelectedValue = Convert.ToString(objIncidentStates.Categoryid);
                BindDropSubCategory();
            }


            if (objIncidentStates.Subcategoryid != 0)
            {
                drpSubcategory.SelectedValue = Convert.ToString(objIncidentStates.Subcategoryid);
            }
            if (objIncidentStates.Technicianid != 0)
            {
                drpTechnician.SelectedValue = Convert.ToString(objIncidentStates.Technicianid);
            }
            txtDescription.Text = objIncident.Description;
            txtTitle.Text       = objIncident.Title;
            if (objuser.Userid != 0)
            {
                ContactInfo_mst objInfo = new ContactInfo_mst();
                objInfo                 = objInfo.Get_By_id(objuser.Userid);
                txtUsername.Text        = objuser.Username;
                txtEmail.Text           = objInfo.Emailid;
                ViewState["UserCreate"] = "Exist";
            }
        }
    }
    protected void grdvwUser_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        // Hndling GridView RowDeleting Event for deleting Row for selected UserId
        int userid;

        userid = Convert.ToInt16(grdvwUser.Rows[e.RowIndex].Cells[0].Text);
        UserLogin_mst obj = new UserLogin_mst();

        obj = ObjUserlogin.Get_By_id(userid);
        if (obj.Userid != 0)
        {
            Membership.DeleteUser(obj.Username, true);
        }

        Objcontactinfo.Delete(userid);
        ObjUserlogin.Delete(userid);

        // Bind GridView
        BindGrid();
    }
Beispiel #12
0
    public void SentMailToSDM(int siteid, int incidentid, int requesterid)
    {
        string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString();
        string strContactNumber  = Resources.MessageResource.strContactNumber.ToString();
        int    FlagUser;
        string varRole = Resources.MessageResource.strSDMRole.ToString();
        int    roleid;

        roleid  = objRole.Get_By_RoleName(varRole);
        colUser = objUser.Get_All_By_Role(roleid);
        foreach (UserLogin_mst objusr in colUser)
        {
            FlagUser = objUserToSiteMapping.Get_By_Id(objusr.Userid, siteid);
            if (FlagUser != 0)
            {
                objIncident       = objIncident.Get_By_id(incidentid);
                objSite           = objSite.Get_By_id(objIncident.Siteid);
                objIncidentStates = objIncidentStates.Get_By_id(incidentid);
                objPriority       = objPriority.Get_By_id(objIncidentStates.Priorityid);

                UserLogin_mst obju   = new UserLogin_mst();
                UserLogin_mst objReq = new UserLogin_mst();
                obju      = obju.Get_By_id(objUserToSiteMapping.Userid);
                objC_info = objC_info.Get_By_id(objusr.Userid);
                objReq    = objReq.Get_By_id(requesterid);
                ContactInfo_mst objReqContInfo = new ContactInfo_mst();
                objReqContInfo = objReqContInfo.Get_By_id(objReq.Userid);

                obj.From       = Resources.MessageResource.strAdminEmail.ToString();
                obj.To         = objC_info.Emailid;
                obj.Subject    = "High Priority Call. Ticket Id: " + incidentid;
                obj.Body       = "Dear Sir/Madam,<br/>High Priority Call has been logged, please find below the Complaint  details .<br/><br/><b>Complaints Details : </b> <br/><br/><b>Ticket Id&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;&nbsp;:</b>" + incidentid + "<br/><b>Title of Call&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Title + " <br/><b>Site&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSite.Sitename + "<br/><b>Logged Date & Time&nbsp;&nbsp&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Createdatetime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Description + "<br/><b>Priority&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;&nbsp;&nbsp;:</b> " + objPriority.Name + "<br/><b>UserName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objReq.Username + "<br/><b>Mail Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objReqContInfo.Emailid + "<br/><br/> <b>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();
            }
        }
    }
    protected void grdvwProblem_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        //System.Drawing.ColorConverter colConvert = new ColorConverter();
        //BLLCollection<ColorScheme_mst> colColor = new BLLCollection<ColorScheme_mst>();

            if (e.Row.RowType == DataControlRowType.DataRow)
            {

                #region Autogenerate Serial number
                //Label lblSerial = (Label)e.Row.FindControl("lblSerial");
                //lblSerial.Text = i.ToString();
                //i++;
                #endregion

                int TotalTimeSpentonCall;
                int TotalResolutionTime;

                string varStatusOpen = Resources.MessageResource.strStatusOpen.ToString();
                string varStatusClose = Resources.MessageResource.strStatusClose.ToString();
                string varStatusOnHold = Resources.MessageResource.strStatusOnHold.ToString();
                string varStatusResolved = Resources.MessageResource.strStatusResolved.ToString();

                #region Bind Data Row at Run time with requesterid to Requester name
                int requesterid = Convert.ToInt32(e.Row.Cells[2].Text);
                objUser = objUser.Get_By_id(requesterid);

                if (objUser.Userid != 0)
                {
                    e.Row.Cells[2].Text = objUser.Username.ToString();
                }
                else { e.Row.Cells[2].Text = ""; }
                #endregion

                #region Bind Datarow at Run Time with Createdbyid to Created by name
                int createdbyid = Convert.ToInt32(e.Row.Cells[3].Text);
                objUser = objUser.Get_By_id(createdbyid);
                if (objUser.Userid != 0)
                {
                    e.Row.Cells[3].Text = objUser.Username.ToString();
                }
                else { e.Row.Cells[3].Text = ""; }
                #endregion

                #region Bind Datarow at Run Time with technicianid to technician name
                int technicianid = Convert.ToInt32(e.Row.Cells[4].Text);
                objUser = objUser.Get_By_id(technicianid);
                if (objUser.Userid != 0)
                {
                    e.Row.Cells[4].Text = objUser.Username.ToString();
                }
                else { e.Row.Cells[4].Text = ""; }
                #endregion

                #region Bind Datarow at run time with Statusid to Status
                int statusid = Convert.ToInt32(e.Row.Cells[5].Text);
                objStatus = objStatus.Get_By_id(statusid);
                if (objStatus.Statusid != 0)
                {

                    e.Row.Cells[5].Text = objStatus.Statusname.ToString();

                }
                else { e.Row.Cells[5].Text = ""; }
                #endregion

                #region Bind Datarow at run time with Priorityid to Priority
                int priorityid = Convert.ToInt32(e.Row.Cells[6].Text);
                objPriority = objPriority.Get_By_id(priorityid);
                if (objPriority.Priorityid != 0)
                { e.Row.Cells[6].Text = objPriority.Name.ToString(); }
                else { e.Row.Cells[6].Text = ""; }
                #endregion

            }
    }
    protected void Showvalues()
    {
        int incidentid = Convert.ToInt32(Session["incidentid"]);

        ObjIncident = ObjIncident.Get_By_id(incidentid);
        ObjIncidentStates = ObjIncidentStates.Get_By_id(incidentid);
        // drpTechnician.SelectedValue = ObjIncidentStates.Technicianid.ToString();
        drpCategory.SelectedValue = ObjIncidentStates.Categoryid.ToString();
        BindDropSubCategory();
        drpSubcategory.SelectedValue = ObjIncidentStates.Subcategoryid.ToString();

        // drpPriority.SelectedValue = ObjIncidentStates.Priorityid.ToString();
        txtTitle.Text = ObjIncident.Title.ToString();
        if (ObjIncident.Description != null)
        { txtDescription.Text = ObjIncident.Description.ToString(); }

        UserLogin_mst objUsr = new UserLogin_mst();
        ContactInfo_mst objInfo = new ContactInfo_mst();
        objInfo = objInfo.Get_By_id(ObjIncident.Requesterid);
        objUsr = objUsr.Get_By_id(ObjIncident.Requesterid);
        txtUsername.Text = objUsr.Username;
        txtEmail.Text = objInfo.Emailid;
        ViewState["UserCreate"] = "Exist";
    }
    protected void grdvwProblem_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {

            #region Bind Data Row at Run time with requesterid to Requester name
            int requesterid = Convert.ToInt32(e.Row.Cells[3].Text);
            objUser = objUser.Get_By_id(requesterid);

            if (objUser.Userid != 0)
            {
                e.Row.Cells[3].Text = objUser.Username.ToString();
            }
            else { e.Row.Cells[3].Text = ""; }
            #endregion

            #region Bind Datarow at Run Time with Createdbyid to Created by name
            int createdbyid = Convert.ToInt32(e.Row.Cells[4].Text);
            objUser = objUser.Get_By_id(createdbyid);
            if (objUser.Userid != 0)
            {
                e.Row.Cells[4].Text = objUser.Username.ToString();
            }
            else { e.Row.Cells[4].Text = ""; }
            #endregion

            #region Bind Datarow at Run Time with technicianid to technician name
            int technicianid = Convert.ToInt32(e.Row.Cells[5].Text);
            objUser = objUser.Get_By_id(technicianid);
            if (objUser.Userid != 0)
            {
                e.Row.Cells[5].Text = objUser.Username.ToString();
            }
            else { e.Row.Cells[5].Text = ""; }
            #endregion

            #region Bind Datarow at run time with Statusid to Status
            int statusid = Convert.ToInt32(e.Row.Cells[6].Text);
            objStatus = objStatus.Get_By_id(statusid);
            if (objStatus.Statusid != 0)
            { e.Row.Cells[6].Text = objStatus.Statusname.ToString(); }
            else { e.Row.Cells[6].Text = ""; }
            #endregion

            #region Bind Datarow at run time with Priorityid to Priority
            int priorityid = Convert.ToInt32(e.Row.Cells[7].Text);
            objPriority = objPriority.Get_By_id(priorityid);
            if (objPriority.Priorityid != 0)
            { e.Row.Cells[7].Text = objPriority.Name.ToString(); }
            else { e.Row.Cells[7].Text = ""; }
            #endregion

            #region Bind Datarow at run time with CategoryId to Category
            int categoryid = Convert.ToInt32(e.Row.Cells[8].Text);
            objCategory = objCategory.Get_By_id(categoryid);
            if (objCategory.Categoryid != 0)
            { e.Row.Cells[8].Text = objCategory.CategoryName.ToString(); }
            else { e.Row.Cells[8].Text = ""; }
            #endregion
        }
    }
Beispiel #16
0
    protected void UpdateUser()
    {
        int Custid = 0;
        int userid = Convert.ToInt32(Request.QueryString[0]);

        ObjUserLogin   = ObjUserLogin.Get_By_id(userid);
        ObjContactInfo = ObjContactInfo.Get_By_id(userid);

        if (ObjUserLogin.Userid != 0 && ObjContactInfo.Userid != 0)
        {
            txtUserName.Text = ObjUserLogin.Username.ToString().Trim();
            txtPassword.Attributes.Add("value", ObjUserLogin.Password.ToString());
            if (ObjUserLogin.City != null)
            {
                txtCity.Text = ObjUserLogin.City.ToString().Trim();
            }

            if (ObjUserLogin.Company != null)
            {
                txtCompany.Text = ObjUserLogin.Company.ToString().Trim();
            }

            txtRetypePassword.Attributes.Add("value", ObjUserLogin.Password.ToString());
            dropRole.SelectedValue = ObjUserLogin.Roleid.ToString().Trim();

            ViewState["Roleid"] = ObjUserLogin.Roleid;
            if (ObjUserLogin.ADEnable == true)
            {
                lblAdUser.Text = "Yes";
            }
            else
            {
                lblAdUser.Text = "No";
            }
            txtFname.Text = ObjContactInfo.Firstname.ToString().Trim();
            txtLname.Text = ObjContactInfo.Lastname.ToString().Trim();
            if (ObjContactInfo.Landline != null)
            {
                txtLandline.Text = ObjContactInfo.Landline.ToString().Trim();
            }
            if (ObjContactInfo.Emailid != null)
            {
                txtEmailId.Text = ObjContactInfo.Emailid.ToString().Trim();
            }
            if (ObjContactInfo.Empid != null)
            {
                txtEmpId.Text = ObjContactInfo.Empid.ToString().Trim();
            }
            if (ObjContactInfo.Emailid != null)
            {
                txtEmailId.Text = ObjContactInfo.Emailid.ToString();
            }
            if (ObjContactInfo.Mobile != null)
            {
                txtMobile.Text = ObjContactInfo.Mobile.ToString();
            }
            if (ObjContactInfo.Description != null)
            {
                txtDesc.Text = ObjContactInfo.Description.ToString();
            }


            colCustToSite = objCustToSite.Get_All_By_siteid(ObjContactInfo.Siteid);
            foreach (CustomerToSiteMapping obj in colCustToSite)
            {
                Custid = obj.Custid;
            }
            ViewState["CustId"]       = Custid;
            drpCustomer.SelectedValue = Convert.ToString(Custid);


            BindDrpsite();
            DrpSite.SelectedValue = ObjContactInfo.Siteid.ToString();
            //DrpOrg.SelectedValue = ObjUserLogin.Orgid.ToString();
            BindDrpDepartment();
            DrpDepartment.SelectedValue = ObjContactInfo.Deptid.ToString();

            if (ObjUserLogin.Enable == true)
            {
                DropEnable.SelectedValue = "1";
            }
            else
            {
                DropEnable.SelectedValue = "0";
            }
        }
    }
    public void SentMailToTechnicianForProblemCall(int problemid, int userid)
    {
        string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString();
        string strContactNumber = Resources.MessageResource.strContactNumber.ToString();
        Problem_mst objProblem = new Problem_mst();
        objUser = objUser.Get_By_id(userid);
        ContactInfo_mst objCont_info = new ContactInfo_mst();
        objCont_info = objCont_info.Get_By_id(objUser.Userid);
        objProblem = objProblem.Get_By_id(problemid);
        objPriority = objPriority.Get_By_id(objProblem.Priorityid);
        UserLogin_mst objReq = new UserLogin_mst();
        objReq = objReq.Get_By_id(objProblem.Requesterid);
        ContactInfo_mst objReqCont = new ContactInfo_mst();
        objReqCont = objReqCont.Get_By_id(objReq.Userid);
        objSDE = objSDE.Get_By_id(objProblem.CreatedByid);

        if (objCont_info.Emailid != null)
        {
            obj.To = objCont_info.Emailid;
            obj.From = Resources.MessageResource.strAdminEmail.ToString();
            obj.Subject = " New Problem Call Assigned to you. Problem Id : " + problemid;
            obj.Body = "Dear&nbsp;" + objUser.Username + "," + "<br/>  A Call with the following details have been assigned to you.<br/><br/><b>Problem Details : </b> <br/><br/><b>Problem Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objProblem.ProblemId + "<br/><b>Title of Call&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>" + objProblem.title + " <br/><b>Logged Date & Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;:</b>" + objProblem.CreateDatetime + "<br/><b>Description&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>" + objProblem.Description + "<br/><b>Priority&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> " + objPriority.Name + "<br/><b>UserName&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>" + objReq.Username + "<br/><b>Mobile No.&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/>" + objReqCont.Mobile + "<br/><b>Landline No.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:<b/>" + objReqCont.Landline + "<br/><b>Mail Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objReqCont.Emailid + "<br/><b>Service Desk Executive&nbsp;&nbsp;&nbsp;:</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at <b>" + strContactNumber + "</b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>";
            obj.SmtpServer = obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
            obj.SentMail();

        }
    }
    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();

        //}
    }
    protected void btnMapped_Click(object sender, EventArgs e)
    {/////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            //lblErrorMsg.Text = "";
            int flag = 0;
            int tempuser;
            tempuser = Convert.ToInt32(Session["tempuser"]);

            foreach (GridViewRow gv in grdvwViewAsset.Rows)
            {
                string      gvIDs;
                RadioButton selectonebutton = (RadioButton)gv.FindControl("selectone");
                if (selectonebutton.Checked)
                {
                    flag = 1;
                    int assetid;
                    gvIDs   = ((Label)gv.FindControl("lblAssetID")).Text.ToString();
                    assetid = Convert.ToInt32(gvIDs);
                    string Username = lblusername.Text.ToString().Trim();
                    objUser = objUser.Get_UserLogin_By_UserName_Like(Username);
                    userid  = objUser.Userid;
                    if (lblusername.Text == "")
                    {
                        //lblErrorMsg.Text = "Enter the user name for mapped a particular Asset";
                        break;
                    }

                    else if (tempuser == 1)
                    {
                        assetcount = objusertoasset.Get_AssetId_From_UserToAssetMap(assetid);
                        int tempuser1 = 0;
                        if (assetcount == 0)
                        {
                            int flag1 = 1;
                            ObjAsset = ObjAsset.Get_By_id(assetid);
                            string compname = ObjAsset.Computername.ToString();
                            string username = lblusername.Text.ToString();
                            Session["compname"]  = compname;
                            Session["flag"]      = flag1;
                            Session["username"]  = username;
                            Session["assetid"]   = assetid;
                            Session["userid"]    = userid;
                            tempuser1            = 1;
                            Session["tempuser1"] = tempuser1;
                            Session["flag1"]     = flag1;
                            break;
                        }
                        else
                        {
                            //lblErrorMsg.Text = "Asset already mapped";
                            break;
                        }
                    }
                    else if (userid == 0)
                    {
                        //lblErrorMsg.Text = "User Name doen not exist";
                        break;
                    }
                    else
                    {
                        assetcount = objusertoasset.Get_AssetId_From_UserToAssetMap(assetid);
                        usercount  = objusertoasset.Get_UserId_From_UserToAssetMap(userid);
                        //  objcontactinfo = objcontactinfo.Get_By_id(userid);
                        objUser = objUser.Get_By_id(userid);
                        if (assetcount == 0)
                        {
                            if (usercount == 0)
                            {
                                int flag1 = 1;
                                objusertoasset.Insert(userid, assetid, objUser.City, objUser.Company);
                                //lblErrorMsg.Text = "Mapped Succussfully";
                                ObjAsset = ObjAsset.Get_By_id(assetid);
                                string compname = ObjAsset.Computername.ToString();
                                string username = lblusername.Text.ToString();
                                Session["compname"] = compname;
                                Session["flag"]     = flag1;
                                Session["username"] = username;
                                Session["assetid"]  = assetid;
                                Session["userid"]   = userid;
                                Session["flag1"]    = flag1;
                                break;
                            }
                            else  //Update Asset id from UserToAsset table.
                            {
                                int flag1      = 1;
                                int oldassetid = Convert.ToInt32(Session["assignassetid"]);
                                objusertoasset.Update_Assetid(oldassetid, assetid, objUser.City, objUser.Company);
                                ObjAsset = ObjAsset.Get_By_id(assetid);
                                string compname = ObjAsset.Computername.ToString();
                                string username = lblusername.Text.ToString();
                                Session["compname"] = compname;
                                Session["flag"]     = flag1;
                                Session["username"] = username;
                                Session["assetid"]  = assetid;
                                Session["userid"]   = userid;
                                Session["flag1"]    = flag1;
                                break;
                            }
                        }
                        else
                        {
                            //lblErrorMsg.Text = "Asset already mapped";
                            break;
                        }
                    }
                }
            }
            if (flag == 0)
            {
                //lblErrorMsg.Text = "Select Asset for mapping";
            }

            string myScript;
            myScript = "<script language=javascript>javascript:refreshParent(); javascript:window.close();</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
        }
        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();

        }
    }
Beispiel #21
0
    protected void grdvwRequest_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        System.Drawing.ColorConverter   colConvert = new ColorConverter();
        BLLCollection <ColorScheme_mst> colColor   = new BLLCollection <ColorScheme_mst>();

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            #region Autogenerate Serial number
            Label lblSerial = (Label)e.Row.FindControl("lblSerial");
            lblSerial.Text = i.ToString();
            i++;
            #endregion

            int TotalTimeSpentonCall;
            int TotalResolutionTime;


            int    varIncidentid     = Convert.ToInt16(((Label)e.Row.FindControl("incidentid")).Text.ToString());
            string varCreateDatetime = e.Row.Cells[9].Text;
            string varStatusOpen     = Resources.MessageResource.strStatusOpen.ToString();
            string varStatusClose    = Resources.MessageResource.strStatusClose.ToString();
            string varStatusOnHold   = Resources.MessageResource.strStatusOnHold.ToString();
            string varStatusResolved = Resources.MessageResource.strStatusResolved.ToString();

            #region Bind Data Row at Run time with requesterid to Requester name
            int requesterid = Convert.ToInt16(e.Row.Cells[3].Text);
            objUser = objUser.Get_By_id(requesterid);

            if (objUser.Userid != 0)
            {
                e.Row.Cells[3].Text = objUser.Username.ToString();
            }
            else
            {
                e.Row.Cells[3].Text = "";
            }
            #endregion

            #region Bind Datarow at Run Time with Createdbyid to Created by name
            int createdbyid = Convert.ToInt16(e.Row.Cells[4].Text);
            objUser = objUser.Get_By_id(createdbyid);
            if (objUser.Userid != 0)
            {
                e.Row.Cells[4].Text = objUser.Username.ToString();
            }
            else
            {
                e.Row.Cells[4].Text = "";
            }
            #endregion

            #region Bind Datarow at Run Time with technicianid to technician name
            int technicianid = Convert.ToInt16(e.Row.Cells[5].Text);
            objUser = objUser.Get_By_id(technicianid);
            if (objUser.Userid != 0)
            {
                e.Row.Cells[5].Text = objUser.Username.ToString();
            }
            else
            {
                e.Row.Cells[5].Text = "";
            }
            #endregion

            #region Bind Datarow at run time with Statusid to Status
            int statusid = Convert.ToInt16(e.Row.Cells[6].Text);
            objStatus = objStatus.Get_By_id(statusid);
            if (objStatus.Statusid != 0)
            {
                e.Row.Cells[6].Text = objStatus.Statusname.ToString();
            }
            else
            {
                e.Row.Cells[6].Text = "";
            }
            #endregion

            #region Bind Datarow at run time with Priorityid to Priority
            int priorityid = Convert.ToInt16(e.Row.Cells[7].Text);
            objPriority = objPriority.Get_By_id(priorityid);
            if (objPriority.Priorityid != 0)
            {
                e.Row.Cells[7].Text = objPriority.Name.ToString();
            }
            else
            {
                e.Row.Cells[7].Text = "";
            }
            #endregion


            #region Bind Datarow at run time with Siteid to Site
            int siteid = Convert.ToInt16(e.Row.Cells[8].Text);
            objSite = objSite.Get_By_id(siteid);
            if (objSite.Siteid != 0)
            {
                string custSiteName;
                int    custid = 0;
                colCustToSite = objCustToSite.Get_All_By_siteid(objSite.Siteid);
                foreach (CustomerToSiteMapping objCuToSite in colCustToSite)
                {
                    custid = objCuToSite.Custid;
                }
                objCustomer = objCustomer.Get_By_id(custid);

                e.Row.Cells[8].Text = objCustomer.Customer_name + "/" + objSite.Sitename.ToString();
            }
            else
            {
                e.Row.Cells[8].Text = "";
            }
            #endregion

            #region Apply Color Coding to Open Calls,According to define SLA
            if (varStatusOpen.ToLower() == objStatus.Statusname.ToString().ToLower())
            {
                Incident_mst obj = new Incident_mst();
                obj = obj.Get_By_id(varIncidentid);
                if (obj.Incidentid != 0)
                {
                    if (obj.Slaid != 0)
                    {
                        #region Declare local variables,and objects of various classes
                        int percent;

                        ProcessEscalateEmail objPro = new ProcessEscalateEmail();
                        #endregion
                        #region Get Total Resolution time define for particular SLA and Time Spent on Request
                        TotalResolutionTime  = objPro.GetResolutionTimeInMins(obj.Slaid);
                        TotalTimeSpentonCall = objIncident.Get_TimeSpentonRequest(varIncidentid, siteid, varCreateDatetime, DateTime.Now.ToString());
                        if (TotalTimeSpentonCall < 0)
                        {
                            TotalTimeSpentonCall = 0;
                        }
                        #endregion
                        #region Calculate Percent
                        percent = (TotalTimeSpentonCall * 100) / TotalResolutionTime;

                        #endregion

                        ColorScheme_mst objColor = new ColorScheme_mst();
                        colColor = objColor.Get_All_By_CallStatus(varStatusOpen);


                        foreach (ColorScheme_mst objCol in colColor)
                        {
                            if (objCol.Percnt_to != 0)
                            {
                                if (percent >= objCol.Percnt && percent <= objCol.Percnt_to)
                                {
                                    e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname);
                                }
                            }
                            else
                            {
                                if (percent >= objCol.Percnt)
                                {
                                    e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname);
                                }
                            }
                        }
                    }
                    else
                    {
                        ColorScheme_mst objColor = new ColorScheme_mst();
                        colColor = objColor.Get_All_By_CallStatus("NonSLA");


                        foreach (ColorScheme_mst objCol in colColor)
                        {
                            e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname);
                        }
                    }
                }
            }
            #endregion

            #region Apply Color Coding to Close Calls
            if (varStatusClose.ToLower() == objStatus.Statusname.ToString().ToLower())
            {
                ColorScheme_mst objColor = new ColorScheme_mst();
                colColor = objColor.Get_All_By_CallStatus(varStatusClose);
                foreach (ColorScheme_mst obj in colColor)
                {
                    try { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname); }
                    catch (Exception ex)
                    { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString("White"); }
                }
            }
            #endregion

            #region Apply Color Coding to On Hold Calls
            if (varStatusOnHold.ToLower() == objStatus.Statusname.ToString().ToLower())
            {
                ColorScheme_mst objColor = new ColorScheme_mst();
                colColor = objColor.Get_All_By_CallStatus(varStatusOnHold);
                foreach (ColorScheme_mst obj in colColor)
                {
                    e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname);
                }
            }
            #endregion

            #region Apply Color Coding to Resolved Calls
            if (varStatusResolved.ToLower() == objStatus.Statusname.ToString().ToLower())
            {
                ColorScheme_mst objColor = new ColorScheme_mst();
                colColor = objColor.Get_All_By_CallStatus(varStatusResolved);
                foreach (ColorScheme_mst obj in colColor)
                {
                    e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname);
                }
            }
            #endregion
        }
    }
    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 Showchangeinfo()
    {
        Approvalpanal.Visible        = true;
        btnApprove.Visible           = true;
        btnReject.Visible            = true;
        Alreadyapprovedpanal.Visible = false;
        NameValueCollection n = Request.QueryString;

        int changeid = Convert.ToInt32(Request.QueryString[0]);

        //lblchangeid.Text = changeid.ToString();
        ObjChange           = ObjChange.Get_By_id(changeid);
        lblchangeid.Text    = ObjChange.Changeid.ToString();
        lbltitle.Text       = ObjChange.Title;
        lbldescription.Text = ObjChange.Description;
        //lblDateDisp.Text = ObjChange.Createdtime.ToString();
        int requesterid = Convert.ToInt32(ObjChange.Requestedby);



        //lblTitle.Text = ObjChange.Title.ToString();

        //lblDescription.Text = ObjChange.Description.ToString();

        lblserviceeffected.Text = "Email";
        int chantypeid = Convert.ToInt32(ObjChange.Changetype);

        ObjChangeType = ObjChangeType.Get_By_id(chantypeid);
        if (chantypeid != 0)
        {
            lblchangetype.Text = ObjChangeType.Changetypename.ToString();
        }
        int changestatus = Convert.ToInt32(ObjChange.Statusid);

        Objchangestatus = Objchangestatus.Get_By_id(changestatus);
        if (changestatus != 0)
        {
            lblStatus.Text = Objchangestatus.Statusname;
        }
        int priorityid = Convert.ToInt32(ObjChange.Priority);

        ObjPriority = ObjPriority.Get_By_id(priorityid);
        if (priorityid != 0)
        {
            lblpriority.Text = ObjPriority.Name.ToString();
        }
        else
        {
            lblpriority.Text = "";
        }

        int category = Convert.ToInt32(ObjChange.Categoryid);

        ObjCategory = ObjCategory.Get_By_id(category);
        if (category != 0)
        {
            lblcategory.Text = ObjCategory.CategoryName.ToString();
        }
        else
        {
            lblcategory.Text = "";
        }


        int subcategory = Convert.ToInt32(ObjChange.Subcategoryid);

        Objsubcategory = Objsubcategory.Get_By_id(subcategory);
        if (subcategory != 0)
        {
            lblsubcategory.Text = Objsubcategory.Subcategoryname.ToString();
        }
        else
        {
            lblsubcategory.Text = "";
        }

        int creator = Convert.ToInt32(ObjChange.CreatedByID);

        ObjUser             = ObjUser.Get_By_id(creator);
        lblCreatedby.Text   = ObjUser.Username.ToString();
        lblCreatedDate.Text = ObjChange.Createdtime.ToString();
        int techid = Convert.ToInt32(ObjChange.Technician);

        ObjUser = ObjUser.Get_By_id(techid);

        if (techid != 0)
        {
            lbltechid.Text = ObjUser.Username.ToString();
        }
        else
        {
            lbltechid.Text = "";
        }
        colassetincludeinchange = objincludeasset.Get_All_IncludeAssetinchange(changeid);
        BLLCollection <Configuration_mst> colasset = new BLLCollection <Configuration_mst>();
        Configuration_mst ObjAsset = new Configuration_mst();

        foreach (IncludedAssetinchange obj in colassetincludeinchange)
        {
            ObjAsset = ObjAsset.Get_By_id(obj.Assetid);
            colasset.Add(ObjAsset);
        }
        lstAsset.DataTextField  = "Serialno";
        lstAsset.DataValueField = "assetid";
        lstAsset.DataSource     = colasset;
        lstAsset.DataBind();
    }
    protected void Showchangeinfo()
    {
        Approvalpanal.Visible = true;
        btnApprove.Visible = true;
        btnReject.Visible = true;
        Alreadyapprovedpanal.Visible = false;
        NameValueCollection n = Request.QueryString;

        int changeid = Convert.ToInt16(Request.QueryString[0]);
        //lblchangeid.Text = changeid.ToString();
        ObjChange = ObjChange.Get_By_id(changeid);
        lblchangeid.Text = ObjChange.Changeid.ToString();
        lbltitle.Text = ObjChange.Title;
        lbldescription.Text = ObjChange.Description;
        //lblDateDisp.Text = ObjChange.Createdtime.ToString();
        int requesterid = Convert.ToInt16(ObjChange.Requestedby);

        //lblTitle.Text = ObjChange.Title.ToString();

        //lblDescription.Text = ObjChange.Description.ToString();

        lblserviceeffected.Text = "Email";
        int chantypeid = Convert.ToInt16(ObjChange.Changetype);
        ObjChangeType = ObjChangeType.Get_By_id(chantypeid);
        if (chantypeid != 0)
        {
            lblchangetype.Text = ObjChangeType.Changetypename.ToString();
        }
        int changestatus = Convert.ToInt16(ObjChange.Statusid);
        Objchangestatus = Objchangestatus.Get_By_id(changestatus);
        if (changestatus != 0)
        {
            lblStatus.Text = Objchangestatus.Statusname;
        }
        int priorityid = Convert.ToInt16(ObjChange.Priority);
        ObjPriority = ObjPriority.Get_By_id(priorityid);
        if (priorityid != 0)
        {
            lblpriority.Text = ObjPriority.Name.ToString();

        }
        else
        {
            lblpriority.Text = "";

        }

        int category = Convert.ToInt16(ObjChange.Categoryid);
        ObjCategory = ObjCategory.Get_By_id(category);
        if (category != 0)
        {
            lblcategory.Text = ObjCategory.CategoryName.ToString();

        }
        else
        {
            lblcategory.Text = "";

        }

        int subcategory = Convert.ToInt16(ObjChange.Subcategoryid);
        Objsubcategory = Objsubcategory.Get_By_id(subcategory);
        if (subcategory != 0)
        {
            lblsubcategory.Text = Objsubcategory.Subcategoryname.ToString();

        }
        else
        {
            lblsubcategory.Text = "";

        }

        int creator = Convert.ToInt16(ObjChange.CreatedByID);
        ObjUser = ObjUser.Get_By_id(creator);
        lblCreatedby.Text = ObjUser.Username.ToString();
        lblCreatedDate.Text = ObjChange.Createdtime.ToString();
        int techid = Convert.ToInt16(ObjChange.Technician);
        ObjUser = ObjUser.Get_By_id(techid);

        if (techid != 0)
        {
            lbltechid.Text = ObjUser.Username.ToString();

        }
        else
        {
            lbltechid.Text = "";

        }
        colassetincludeinchange = objincludeasset.Get_All_IncludeAssetinchange(changeid);
        BLLCollection<Configuration_mst> colasset = new BLLCollection<Configuration_mst>();
        Configuration_mst ObjAsset = new Configuration_mst();

        foreach (IncludedAssetinchange obj in colassetincludeinchange)
        {
            ObjAsset = ObjAsset.Get_By_id(obj.Assetid);
            colasset.Add(ObjAsset);

        }
        lstAsset.DataTextField = "Serialno";
        lstAsset.DataValueField = "assetid";
        lstAsset.DataSource = colasset;
        lstAsset.DataBind();
    }
    protected void btnMapped_Click(object sender, EventArgs e)
    {
        /////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            //lblErrorMsg.Text = "";
            int flag = 0;
            int tempuser;
            tempuser = Convert.ToInt32(Session["tempuser"]);

            foreach (GridViewRow gv in grdvwViewAsset.Rows)
            {
                string gvIDs;
                RadioButton selectonebutton = (RadioButton)gv.FindControl("selectone");
                if (selectonebutton.Checked)
                {
                    flag = 1;
                    int assetid;
                    gvIDs = ((Label)gv.FindControl("lblAssetID")).Text.ToString();
                    assetid = Convert.ToInt32(gvIDs);
                    string Username = lblusername.Text.ToString().Trim();
                    objUser = objUser.Get_UserLogin_By_UserName_Like(Username);
                    userid = objUser.Userid;
                    if (lblusername.Text == "")
                    {

                        //lblErrorMsg.Text = "Enter the user name for mapped a particular Asset";
                        break;
                    }

                    else if (tempuser == 1)
                    {
                        assetcount = objusertoasset.Get_AssetId_From_UserToAssetMap(assetid);
                        int tempuser1 = 0;
                        if (assetcount == 0)
                        {
                            int flag1 = 1;
                            ObjAsset = ObjAsset.Get_By_id(assetid);
                            string compname = ObjAsset.Computername.ToString();
                            string username = lblusername.Text.ToString();
                            Session["compname"] = compname;
                            Session["flag"] = flag1;
                            Session["username"] = username;
                            Session["assetid"] = assetid;
                            Session["userid"] = userid;
                            tempuser1 = 1;
                            Session["tempuser1"] = tempuser1;
                            Session["flag1"] = flag1;
                            break;
                        }
                        else
                        {
                            //lblErrorMsg.Text = "Asset already mapped";
                            break;
                        }
                    }
                    else if (userid == 0)
                    {
                        //lblErrorMsg.Text = "User Name doen not exist";
                        break;
                    }
                    else
                    {
                        assetcount = objusertoasset.Get_AssetId_From_UserToAssetMap(assetid);
                        usercount = objusertoasset.Get_UserId_From_UserToAssetMap(userid);
                        //  objcontactinfo = objcontactinfo.Get_By_id(userid);
                        objUser = objUser.Get_By_id(userid);
                        if (assetcount == 0)
                        {
                            if (usercount == 0)
                            {
                                int flag1 = 1;
                                objusertoasset.Insert(userid, assetid, objUser.City, objUser.Company);
                                //lblErrorMsg.Text = "Mapped Succussfully";
                                ObjAsset = ObjAsset.Get_By_id(assetid);
                                string compname = ObjAsset.Computername.ToString();
                                string username = lblusername.Text.ToString();
                                Session["compname"] = compname;
                                Session["flag"] = flag1;
                                Session["username"] = username;
                                Session["assetid"] = assetid;
                                Session["userid"] = userid;
                                Session["flag1"] = flag1;
                                break;

                            }
                            else  //Update Asset id from UserToAsset table.
                            {
                                int flag1 = 1;
                                int oldassetid = Convert.ToInt32(Session["assignassetid"]);
                                objusertoasset.Update_Assetid(oldassetid, assetid, objUser.City, objUser.Company);
                                ObjAsset = ObjAsset.Get_By_id(assetid);
                                string compname = ObjAsset.Computername.ToString();
                                string username = lblusername.Text.ToString();
                                Session["compname"] = compname;
                                Session["flag"] = flag1;
                                Session["username"] = username;
                                Session["assetid"] = assetid;
                                Session["userid"] = userid;
                                Session["flag1"] = flag1;
                                break;
                            }
                        }
                        else
                        {
                            //lblErrorMsg.Text = "Asset already mapped";
                            break;
                        }
                    }
                }

            }
            if (flag == 0)
            {
                //lblErrorMsg.Text = "Select Asset for mapping";
            }

            string myScript;
            myScript = "<script language=javascript>javascript:refreshParent(); javascript:window.close();</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
    protected void grdvwChange_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        //Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                #region Bind Data Row at Run time with requesterid to Requester name
                int requesterid = Convert.ToInt32(e.Row.Cells[3].Text);
                objUser = objUser.Get_By_id(requesterid);

                if (objUser.Userid != 0)
                {
                    e.Row.Cells[3].Text = objUser.Username.ToString();
                }
                else
                {
                    e.Row.Cells[3].Text = "";
                }
                #endregion

                #region Bind Datarow at Run Time with Createdbyid to Created by name
                int createdbyid = Convert.ToInt32(e.Row.Cells[4].Text);
                objUser = objUser.Get_By_id(createdbyid);
                if (objUser.Userid != 0)
                {
                    e.Row.Cells[4].Text = objUser.Username.ToString();
                }
                else
                {
                    e.Row.Cells[4].Text = "";
                }
                #endregion

                #region Bind Datarow at Run Time with technicianid to technician name
                int technicianid = Convert.ToInt32(e.Row.Cells[5].Text);
                objUser = objUser.Get_By_id(technicianid);
                if (objUser.Userid != 0)
                {
                    e.Row.Cells[5].Text = objUser.Username.ToString();
                }
                else
                {
                    e.Row.Cells[5].Text = "";
                }
                #endregion

                #region Bind Datarow at run time with Statusid to Status
                int statusid = Convert.ToInt32(e.Row.Cells[6].Text);
                objStatus = objStatus.Get_By_id(statusid);

                if (objStatus.ChangeStatusid != 0)
                {
                    e.Row.Cells[6].Text = objStatus.Statusname.ToString();
                }
                else
                {
                    e.Row.Cells[6].Text = "";
                }
                #endregion

                #region Bind Datarow at run time with Priorityid to Priority
                int priorityid = Convert.ToInt32(e.Row.Cells[7].Text);
                objPriority = objPriority.Get_By_id(priorityid);
                if (objPriority.Priorityid != 0)
                {
                    e.Row.Cells[7].Text = objPriority.Name.ToString();
                }
                else
                {
                    e.Row.Cells[7].Text = "";
                }
                #endregion


                #region Bind Datarow at run time with CategoryId to Category
                int categoryid = Convert.ToInt32(e.Row.Cells[8].Text);
                objCategory = objCategory.Get_By_id(categoryid);
                if (objCategory.Categoryid != 0)
                {
                    e.Row.Cells[8].Text = objCategory.CategoryName.ToString();
                }
                else
                {
                    e.Row.Cells[8].Text = "";
                }
                #endregion
            }
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
    public void SentMailToChangeCommittee(int changeid, int changetypeid)
    {
        string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString();
        string strContactNumber = Resources.MessageResource.strContactNumber.ToString();
        Cab_mst Objcabmember = new Cab_mst();
        ObjChange = ObjChange.Get_By_id(changeid);

        BLLCollection<Cab_mst> colmembers = new BLLCollection<Cab_mst>();
        UserLogin_mst objUserCreator = new UserLogin_mst();

        int FlagUser;

        int roleid;
        string varServerName;
        varServerName = Resources.MessageResource.serverNameForChangePage.ToString();

        string url11;
        //////////////change done by meenakshi
        //url11 = "http://" + varServerName + "/BEST/LoginPageAccess/ApproveorRejectChangeRequest.aspx?changeid=" + changeid;
        url11 = "http://" + varServerName + "/" + getpath() + "/LoginPageAccess/ApproveorRejectChangeRequest.aspx?changeid=" + changeid;

        ///////////////end
        colmembers = Objcabmember.Get_All_By_ChangeTypeid(changetypeid);

        string url;
        foreach (Cab_mst objmember in colmembers)
        {
            url = "<a  href=" + url11 + "&userid=" + objmember.Membername + " onclick=window.open()>Click Here For Approval</a>";

            //url = "<a id=" + mylink + " runat=" + varServerName + " href=" + url11 + "&userid=" + objmember.Membername + " 'onclick=window.open()></a>";
            //////////change don eby meenakshi

            objUserCreator = objUserCreator.Get_By_id(ObjChange.CreatedByID);
            ///////////////end
            obj.From = Resources.MessageResource.strAdminEmail.ToString();

            obj.To = objmember.Emailid;
            obj.Subject = "New Change Added. Change Id : " + changeid;
            obj.Body = "Dear Sir/Madam,<br/>A New Change has been requested.Please.<br/><br/><b>Solution Description & Plan of Action : </b> <br/><br/><b>Changeid Id &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + ObjChange.Changeid + "<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>" + ObjChange.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>" + ObjChange.Createdtime + "<br/><b>Solution Details&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + ObjChange.Description + "<br/><br/>This is an auto generated mail. Please do not reply.</b><br/><br/></b><br/><b>Kindly Click the following link to Aprove or Reject the Change Request. <br></br>" + url + " <b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>";
            ////obj.Body="Dear Sir/Madam,<br/>A New Change has been requested.Please.<br/><br/><b>Solution Details : </b> <br/><br/><b>Changeid Id &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>10<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>testcall done by meenakshi <br/><b>Added By &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>1<br/><b>Created Date &nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>8/30/2012 4:45:17 PM<br/><b>Content&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>testcall done by meenakshi<br/><br/>This is an auto generated mail. Please do not reply.</b><br/><br/></b><br/><b>Kindly Click the following link to Aprove or Reject the Change Request. <br></br> "<a  href="http://10.80.0.136/GPI/LoginPageAccess/ApproveorRejetChangeRequest.aspx?changeid=10&userid=meenakshi 'onclick=window.open()">Click Here For Approval</a>"
            obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
            obj.SentMail();

        }
    }
    protected void grdvwChange_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        //Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            //System.Drawing.ColorConverter colConvert = new ColorConverter();
            //BLLCollection<ColorScheme_mst> colColor = new BLLCollection<ColorScheme_mst>();

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //if(col.Count!=0)
                //{

                #region Autogenerate Serial number
                //Label lblSerial = (Label)e.Row.FindControl("lblSerial");
                //lblSerial.Text = i.ToString();
                //i++;
                #endregion

                int TotalTimeSpentonCall;
                int TotalResolutionTime;

                string varStatusOpen = Resources.MessageResource.strStatusOpen.ToString();
                string varStatusClose = Resources.MessageResource.strStatusClose.ToString();
                string varStatusOnHold = Resources.MessageResource.strStatusOnHold.ToString();
                string varStatusResolved = Resources.MessageResource.strStatusResolved.ToString();

                #region Bind Data Row at Run time with requesterid to Requester name
                int requesterid = Convert.ToInt32(e.Row.Cells[2].Text);
                objUser = objUser.Get_By_id(requesterid);

                if (objUser.Userid != 0)
                {
                    e.Row.Cells[2].Text = objUser.Username.ToString();
                }
                else { e.Row.Cells[2].Text = ""; }
                #endregion

                #region Bind Datarow at Run Time with Createdbyid to Created by name
                int createdbyid = Convert.ToInt32(e.Row.Cells[3].Text);
                objUser = objUser.Get_By_id(createdbyid);
                if (objUser.Userid != 0)
                {
                    e.Row.Cells[3].Text = objUser.Username.ToString();
                }
                else { e.Row.Cells[3].Text = ""; }
                #endregion

                #region Bind Datarow at Run Time with technicianid to technician name
                int technicianid = Convert.ToInt32(e.Row.Cells[4].Text);
                objUser = objUser.Get_By_id(technicianid);
                if (objUser.Userid != 0)
                {
                    e.Row.Cells[4].Text = objUser.Username.ToString();
                }
                else { e.Row.Cells[4].Text = ""; }
                #endregion

                #region Bind Datarow at run time with Statusid to Status
                int statusid = Convert.ToInt32(e.Row.Cells[5].Text);

                ObjChangeStatus = ObjChangeStatus.Get_By_id(statusid);
                if (ObjChangeStatus.ChangeStatusid != 0)
                {

                    e.Row.Cells[5].Text = ObjChangeStatus.Statusname.ToString();

                }
                else { e.Row.Cells[5].Text = ""; }
                #endregion

                #region Bind Datarow at run time with Priorityid to Priority
                int priorityid = Convert.ToInt32(e.Row.Cells[6].Text);
                objPriority = objPriority.Get_By_id(priorityid);
                if (objPriority.Priorityid != 0)
                { e.Row.Cells[6].Text = objPriority.Name.ToString(); }
                else { e.Row.Cells[6].Text = ""; }
                #endregion

            }
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
Beispiel #29
0
    public void SentmailUser(int userid, int incidentid, string status)
    {
        objIncident = objIncident.Get_By_id(incidentid);
        //added by lalit 02 nov to get resolution and show it to user when call closed mail goes to user
        objIncidentResolution = objIncidentResolution.Get_By_id(incidentid);
        //end
        objSite           = objSite.Get_By_id(objIncident.Siteid);
        objAreaManager    = objAreaManager.Get_By_id(objSite.Siteid);
        objIncidentStates = objIncidentStates.Get_By_id(incidentid);
        objPriority       = objPriority.Get_By_id(objIncidentStates.Priorityid);
        objUser           = objUser.Get_By_id(objIncident.Requesterid);
        objC_info         = objC_info.Get_By_id(userid);
        objtech           = objtech.Get_By_id(objIncidentStates.Technicianid);
        colemailid        = objemail.Get_All_userid(userid);
        string strStatusOpen     = Resources.MessageResource.strStatusOpen.ToString();
        string strStatusClose    = Resources.MessageResource.strStatusClose.ToString();
        string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString();
        string strContactNumber  = Resources.MessageResource.strContactNumber.ToString();

        if (strStatusOpen.ToLower() == status.ToLower())
        {
            foreach (UserEmail obj1 in colemailid)
            {
                if (obj1.Emailid != null)
                {
                    obj.From    = Resources.MessageResource.strAdminEmail.ToString();
                    obj.To      = obj1.Emailid;
                    obj.CC      = objAreaManager.Email;
                    obj.Subject = "Call Logged. Ticket Id : " + incidentid;
                    obj.Body    = "Dear " + objC_info.Firstname + ",<br/><br/> Thank you for contacting IT Service desk, please find below the new Ticket Id details for your future reference.<br/><br/><b>Incident Details : </b> <br/><br/><b>Ticket Id&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;&nbsp;:</b> "
                                  + incidentid + "<br/><b>Site&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                  + objSite.Sitename + "<br/><b>Logged Date & Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                  + objIncident.Createdatetime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                  + objIncident.Description + "<br/><b>Priority&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;&nbsp;&nbsp;&nbsp;:</b> "
                                  + objPriority.Name + "<br/><b>Username&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> "
                                  + objUser.Username + "<br/><b>EstimatedResolutionTime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                  + GetResolutionTimeInHours(objIncident.Slaid)
                                  + "<br/><b>Email Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "

                                  + objC_info.Emailid + "<br/><br/> For any other support, kindly get in touch with us at " + strContactNumber + ".<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b> " + strYourSinscerely + "</b>";
                    obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
                    obj.SentMail();
                    string varPriority = Resources.MessageResource.strPriorityHigh.ToString();
                    if (objPriority.Priorityid != 0)
                    {
                        if (objPriority.Name.ToLower() == varPriority.ToLower())
                        {
                            SentMailToSDM(objSite.Siteid, incidentid, objUser.Userid);
                        }
                    }
                }
            }
            //if (objC_info.Emailid != null)
            //{
            //    obj.From = Resources.MessageResource.strAdminEmail.ToString();
            //    obj.To = objC_info.Emailid;
            //    obj.Subject = " New Call Logged. Ticket Id : " + incidentid;
            //    obj.Body = "Dear User,<br/> Thank you for contacting Service desk, please find below the Ticket Id details for your future reference.<br/><br/><b>Complaints Details : </b> <br/><br/><b>Ticket Id&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;&nbsp;:</b>" + incidentid + "<br/><b>Title of Call&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Title + " <br/><b>Site&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSite.Sitename + "<br/><b>Logged Date & Time&nbsp;&nbsp&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Createdatetime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Description + "<br/><b>Priority&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;&nbsp;&nbsp;:</b> " + objPriority.Name + "<br/><b>UserName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objUser.Username + "<br/><b>Mail Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objC_info.Emailid + "<br/><br/> For any other support kindly get in touch with us at <b>" + strContactNumber + "</b>.<br/><br/> <b>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();
            //    string varPriority = Resources.MessageResource.strPriorityHigh.ToString();
            //    if (objPriority.Priorityid != 0)
            //    {
            //        if (objPriority.Name.ToLower() == varPriority.ToLower())
            //        {
            //            SentMailToSDM(objSite.Siteid, incidentid, objUser.Userid);
            //        }
            //    }
            //}
        }
        if (strStatusClose.ToLower() == status.ToLower())
        {
            foreach (UserEmail obj1 in colemailid)
            {
                if (obj1.Emailid != null)
                {
                    int    id = Convert.ToInt16(objIncident.Incidentid);
                    string varServerName1;
                    string varfeedbackmode;
                    varServerName1 = Resources.MessageResource.serverNameForChangePage.ToString();
                    //added by lalit to check feedback mode. feedback should add in mail or not.
                    //fetching value from resouce file which is from appsettting page.
                    varfeedbackmode = Resources.MessageResource.UserFeedbackmode.ToString();
                    string url11;
                    url11 = "http://" + varServerName1 + "/" + getpath() + "/LoginPageAccess/CustomerFeedback.aspx?userid=" + userid + "&Clid=" + objIncident.Incidentid;
                    //url11 = "../LoginPageAccess/CustomerFeedback.aspx?userid=" + userid + "&Clid=" + objIncident.Incidentid;
                    if (objC_info.Emailid != null)
                    {
                        // string url;
                        //    url = "<a  href=" + url11 + "&userid=" + objC_info.Firstname + " ' onclick=window.open()>Your Feedback</a>";
                        string url = "<a  href=" + url11 + " ' onclick=window.open()>Your Feedback</a>";
                        obj.From    = Resources.MessageResource.strAdminEmail.ToString();
                        obj.To      = obj1.Emailid;
                        obj.CC      = objAreaManager.Email;
                        obj.Subject = "Call Closed Ticket id : " + incidentid;
                        //added by lalit
                        if (varfeedbackmode == "0") //0 means default mode where user will not recieve link in mail to give feedback
                        {
                            obj.Body = "Dear " + objC_info.Firstname
                                       + ",<br/><br/> <b>Incident Status:</b> Issue Resolved and call closed by&nbsp;<b>"
                                       + objtech.Username + "</b>&nbsp;on&nbsp;<b>"
                                       + objIncident.Completedtime + ".<br/><br/></b>We are pleased to confirm that the Service Call reported by you has been attended and resolved, should there be any further questions or queries, please do not hesitate to contact the Service Desk." + "<br/><br/><b>Incident Details : </b> <br/><br/><b>Ticket Id&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;&nbsp;:</b> "
                                       + incidentid + "<br/><b>Site&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objSite.Sitename + "<br/><b>Logged Date & Time&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;:</b> "
                                       + objIncident.Createdatetime + "<br/><b>Closed Date & Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objIncident.Completedtime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objIncident.Description + "<br/><b>Resolution&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> "
                                       + objIncidentResolution.Resolution + "<br/><b>Priority&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;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objPriority.Name + "<br/><b>Username&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> "
                                       + objUser.Username + "<br/><b>Email Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objC_info.Emailid + "<br/><br/> For any other support, kindly get in touch with us at "
                                       + strContactNumber + ".<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b>"
                                       + strYourSinscerely + "</b>";
                        }
                        else
                        {
                            obj.Body = "Dear " + objC_info.Firstname
                                       + ",<br/><br/> <b>Incident Status:</b> Issue Resolved and call closed by&nbsp;<b>"
                                       + objtech.Username + "</b>&nbsp;on&nbsp;<b>"
                                       + objIncident.Completedtime + ".<br/><br/></b>We are pleased to confirm that the Service Call reported by you has been attended and resolved, should there be any further questions or queries, please do not hesitate to contact the Service Desk." + "<br/><br/><b>Incident Details : </b> <br/><br/><b>Ticket Id&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;&nbsp;:</b> "
                                       + incidentid + "<br/><b>Site&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objSite.Sitename + "<br/><b>Logged Date & Time&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;:</b> "
                                       + objIncident.Createdatetime + "<br/><b>Closed Date & Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objIncident.Completedtime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objIncident.Description + "<br/><b>Resolution&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> "
                                       + objIncidentResolution.Resolution + "<br/><b>Priority&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;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objPriority.Name + "<br/><b>Username&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> "
                                       + objUser.Username + "<br/><b>Email Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objC_info.Emailid + "<br/><br/> For any other support, kindly get in touch with us at "
                                       + strContactNumber + ".<br/><br/>To give feedback click on "
                                       + url + ".<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b>"
                                       + strYourSinscerely + "</b>";
                        }
                        obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
                        obj.SentMail();
                    }
                }
            }
            //int id = Convert.ToInt16(objIncident.Incidentid);
            //string varServerName1;
            //varServerName1 = Resources.MessageResource.serverNameForChangePage.ToString();
            //// varServerName = "10.80.0.15";
            //string url11;
            //url11 = "http://" + varServerName1 + "/BESTN/LoginPageAccess/CustomerFeedback.aspx?incident=" + id;
            //if (objC_info.Emailid != null)
            //{
            //    string url;
            //    url = "<a  href=" + url11 + "&userid=" + objC_info.Firstname + " ' onclick=window.open()>Your Feedback</a>";
            //    obj.From = Resources.MessageResource.strAdminEmail.ToString();
            //    obj.To = objC_info.Emailid;
            //    obj.Subject = "Call Closed Ticket id : " + incidentid;
            //    obj.Body = "Dear User,<br/> <b>Complaint Status:</b>Problem solved and call closed by&nbsp;<b>" + objtech.Username + "</b>&nbsp;on&nbsp;<b>" + objIncident.Completedtime + "</b>.We are pleased to inform you that your reported Service Call has been attended and problem solved as informed by our engineer.<br/>Should there be any further questions or queries, please do not hesitate to contact the Service Desk on 0120 4393941, quoting your Ticket Reference Number.   " + "<br/><br/><b>Complaints Details : </b> <br/><br/><b>Ticket Id&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;&nbsp;:</b>" + incidentid + "<br/><b>Title of Call&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Title + " <br/><b>Site&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSite.Sitename + "</br><b>Logged Date & Time&nbsp;&nbsp&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Createdatetime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Description + "<br/><b>Priority&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;&nbsp;&nbsp;:</b> " + objPriority.Name + "<br/><b>UserName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objUser.Username + "<br/><b>Mail Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objC_info.Emailid + "<br/><br/> For any other support kindly get in touch with us at <b>" + strContactNumber + "</b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Your Feedback</b><br/><br/>" + url + "<br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>";
            //    obj.SmtpServer = obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
            //   // obj.SentMail();
            //}
        }
    }
Beispiel #30
0
    protected void grdvwProblem_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            #region Bind Data Row at Run time with requesterid to Requester name
            int requesterid = Convert.ToInt16(e.Row.Cells[3].Text);
            objUser = objUser.Get_By_id(requesterid);

            if (objUser.Userid != 0)
            {
                e.Row.Cells[3].Text = objUser.Username.ToString();
            }
            else
            {
                e.Row.Cells[3].Text = "";
            }
            #endregion

            #region Bind Datarow at Run Time with Createdbyid to Created by name
            int createdbyid = Convert.ToInt16(e.Row.Cells[4].Text);
            objUser = objUser.Get_By_id(createdbyid);
            if (objUser.Userid != 0)
            {
                e.Row.Cells[4].Text = objUser.Username.ToString();
            }
            else
            {
                e.Row.Cells[4].Text = "";
            }
            #endregion

            #region Bind Datarow at Run Time with technicianid to technician name
            int technicianid = Convert.ToInt16(e.Row.Cells[5].Text);
            objUser = objUser.Get_By_id(technicianid);
            if (objUser.Userid != 0)
            {
                e.Row.Cells[5].Text = objUser.Username.ToString();
            }
            else
            {
                e.Row.Cells[5].Text = "";
            }
            #endregion

            #region Bind Datarow at run time with Statusid to Status
            int statusid = Convert.ToInt16(e.Row.Cells[6].Text);
            objStatus = objStatus.Get_By_id(statusid);
            if (objStatus.Statusid != 0)
            {
                e.Row.Cells[6].Text = objStatus.Statusname.ToString();
            }
            else
            {
                e.Row.Cells[6].Text = "";
            }
            #endregion

            #region Bind Datarow at run time with Priorityid to Priority
            int priorityid = Convert.ToInt16(e.Row.Cells[7].Text);
            objPriority = objPriority.Get_By_id(priorityid);
            if (objPriority.Priorityid != 0)
            {
                e.Row.Cells[7].Text = objPriority.Name.ToString();
            }
            else
            {
                e.Row.Cells[7].Text = "";
            }
            #endregion


            #region Bind Datarow at run time with CategoryId to Category
            int categoryid = Convert.ToInt16(e.Row.Cells[8].Text);
            objCategory = objCategory.Get_By_id(categoryid);
            if (objCategory.Categoryid != 0)
            {
                e.Row.Cells[8].Text = objCategory.CategoryName.ToString();
            }
            else
            {
                e.Row.Cells[8].Text = "";
            }
            #endregion
        }
    }
Beispiel #31
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;
        }
    }
Beispiel #32
0
    protected void grdvwChange_RowDataBound(Object sender, GridViewRowEventArgs e)
    {//Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            //System.Drawing.ColorConverter colConvert = new ColorConverter();
            //BLLCollection<ColorScheme_mst> colColor = new BLLCollection<ColorScheme_mst>();

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //if(col.Count!=0)
                //{

                #region Autogenerate Serial number
                //Label lblSerial = (Label)e.Row.FindControl("lblSerial");
                //lblSerial.Text = i.ToString();
                //i++;
                #endregion

                int TotalTimeSpentonCall;
                int TotalResolutionTime;



                string varStatusOpen     = Resources.MessageResource.strStatusOpen.ToString();
                string varStatusClose    = Resources.MessageResource.strStatusClose.ToString();
                string varStatusOnHold   = Resources.MessageResource.strStatusOnHold.ToString();
                string varStatusResolved = Resources.MessageResource.strStatusResolved.ToString();

                #region Bind Data Row at Run time with requesterid to Requester name
                int requesterid = Convert.ToInt32(e.Row.Cells[2].Text);
                objUser = objUser.Get_By_id(requesterid);

                if (objUser.Userid != 0)
                {
                    e.Row.Cells[2].Text = objUser.Username.ToString();
                }
                else
                {
                    e.Row.Cells[2].Text = "";
                }
                #endregion

                #region Bind Datarow at Run Time with Createdbyid to Created by name
                int createdbyid = Convert.ToInt32(e.Row.Cells[3].Text);
                objUser = objUser.Get_By_id(createdbyid);
                if (objUser.Userid != 0)
                {
                    e.Row.Cells[3].Text = objUser.Username.ToString();
                }
                else
                {
                    e.Row.Cells[3].Text = "";
                }
                #endregion

                #region Bind Datarow at Run Time with technicianid to technician name
                int technicianid = Convert.ToInt32(e.Row.Cells[4].Text);
                objUser = objUser.Get_By_id(technicianid);
                if (objUser.Userid != 0)
                {
                    e.Row.Cells[4].Text = objUser.Username.ToString();
                }
                else
                {
                    e.Row.Cells[4].Text = "";
                }
                #endregion

                #region Bind Datarow at run time with Statusid to Status
                int statusid = Convert.ToInt32(e.Row.Cells[5].Text);

                ObjChangeStatus = ObjChangeStatus.Get_By_id(statusid);
                if (ObjChangeStatus.ChangeStatusid != 0)
                {
                    e.Row.Cells[5].Text = ObjChangeStatus.Statusname.ToString();
                }
                else
                {
                    e.Row.Cells[5].Text = "";
                }
                #endregion

                #region Bind Datarow at run time with Priorityid to Priority
                int priorityid = Convert.ToInt32(e.Row.Cells[6].Text);
                objPriority = objPriority.Get_By_id(priorityid);
                if (objPriority.Priorityid != 0)
                {
                    e.Row.Cells[6].Text = objPriority.Name.ToString();
                }
                else
                {
                    e.Row.Cells[6].Text = "";
                }
                #endregion
            }
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
    protected void grdvwChange_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        //Add Exception handilng try catch change by vishal 21-05-2012
        try
        {

            if (e.Row.RowType == DataControlRowType.DataRow)
            {

                #region Bind Data Row at Run time with requesterid to Requester name
                int requesterid = Convert.ToInt32(e.Row.Cells[3].Text);
                objUser = objUser.Get_By_id(requesterid);

                if (objUser.Userid != 0)
                {
                    e.Row.Cells[3].Text = objUser.Username.ToString();
                }
                else { e.Row.Cells[3].Text = ""; }
                #endregion

                #region Bind Datarow at Run Time with Createdbyid to Created by name
                int createdbyid = Convert.ToInt32(e.Row.Cells[4].Text);
                objUser = objUser.Get_By_id(createdbyid);
                if (objUser.Userid != 0)
                {
                    e.Row.Cells[4].Text = objUser.Username.ToString();
                }
                else { e.Row.Cells[4].Text = ""; }
                #endregion

                #region Bind Datarow at Run Time with technicianid to technician name
                int technicianid = Convert.ToInt32(e.Row.Cells[5].Text);
                objUser = objUser.Get_By_id(technicianid);
                if (objUser.Userid != 0)
                {
                    e.Row.Cells[5].Text = objUser.Username.ToString();
                }
                else { e.Row.Cells[5].Text = ""; }
                #endregion

                #region Bind Datarow at run time with Statusid to Status
                int statusid = Convert.ToInt32(e.Row.Cells[6].Text);
                objStatus = objStatus.Get_By_id(statusid);

                if (objStatus.ChangeStatusid != 0)
                { e.Row.Cells[6].Text = objStatus.Statusname.ToString(); }
                else { e.Row.Cells[6].Text = ""; }
                #endregion

                #region Bind Datarow at run time with Priorityid to Priority
                int priorityid = Convert.ToInt32(e.Row.Cells[7].Text);
                objPriority = objPriority.Get_By_id(priorityid);
                if (objPriority.Priorityid != 0)
                { e.Row.Cells[7].Text = objPriority.Name.ToString(); }
                else { e.Row.Cells[7].Text = ""; }
                #endregion

                #region Bind Datarow at run time with CategoryId to Category
                int categoryid = Convert.ToInt32(e.Row.Cells[8].Text);
                objCategory = objCategory.Get_By_id(categoryid);
                if (objCategory.Categoryid != 0)
                { e.Row.Cells[8].Text = objCategory.CategoryName.ToString(); }
                else { e.Row.Cells[8].Text = ""; }
                #endregion
            }

        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
    public void SentMailToSDM(int siteid, int incidentid, int requesterid)
    {
        string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString();
        string strContactNumber = Resources.MessageResource.strContactNumber.ToString();
        int FlagUser;
        string varRole = Resources.MessageResource.strSDMRole.ToString();
        int roleid;
        roleid = objRole.Get_By_RoleName(varRole);
        colUser = objUser.Get_All_By_Role(roleid);
        foreach (UserLogin_mst objusr in colUser)
        {

            FlagUser = objUserToSiteMapping.Get_By_Id(objusr.Userid, siteid);
            if (FlagUser != 0)
            {
                objIncident = objIncident.Get_By_id(incidentid);
                objSite = objSite.Get_By_id(objIncident.Siteid);
                objIncidentStates = objIncidentStates.Get_By_id(incidentid);
                objPriority = objPriority.Get_By_id(objIncidentStates.Priorityid);

                UserLogin_mst obju = new UserLogin_mst();
                UserLogin_mst objReq = new UserLogin_mst();
                obju = obju.Get_By_id(objUserToSiteMapping.Userid);
                objC_info = objC_info.Get_By_id(objusr.Userid);
                objReq = objReq.Get_By_id(requesterid);
                ContactInfo_mst objReqContInfo = new ContactInfo_mst();
                objReqContInfo = objReqContInfo.Get_By_id(objReq.Userid);

                obj.From = Resources.MessageResource.strAdminEmail.ToString();
                obj.To = objC_info.Emailid;
                obj.Subject = "High Priority Call. Ticket Id: " + incidentid;
                obj.Body = "Dear Sir/Madam,<br/>High Priority Call has been logged, please find below the Complaint  details .<br/><br/><b>Complaints Details : </b> <br/><br/><b>Ticket Id&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;&nbsp;:</b>" + incidentid + "<br/><b>Title of Call&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Title + " <br/><b>Site&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSite.Sitename + "<br/><b>Logged Date & Time&nbsp;&nbsp&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Createdatetime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Description + "<br/><b>Priority&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;&nbsp;&nbsp;:</b> " + objPriority.Name + "<br/><b>UserName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objReq.Username + "<br/><b>Mail Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objReqContInfo.Emailid + "<br/><br/> <b>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();

            }

        }
    }
    protected void grdvwChange_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        //System.Drawing.ColorConverter colConvert = new ColorConverter();
        //BLLCollection<ColorScheme_mst> colColor = new BLLCollection<ColorScheme_mst>();

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //if(col.Count!=0)
            //{

            #region Autogenerate Serial number
            //Label lblSerial = (Label)e.Row.FindControl("lblSerial");
            //lblSerial.Text = i.ToString();
            //i++;
            #endregion

            int TotalTimeSpentonCall;
            int TotalResolutionTime;



            string varStatusOpen     = Resources.MessageResource.strStatusOpen.ToString();
            string varStatusClose    = Resources.MessageResource.strStatusClose.ToString();
            string varStatusOnHold   = Resources.MessageResource.strStatusOnHold.ToString();
            string varStatusResolved = Resources.MessageResource.strStatusResolved.ToString();

            #region Bind Data Row at Run time with requesterid to Requester name
            int requesterid = Convert.ToInt16(e.Row.Cells[2].Text);
            objUser = objUser.Get_By_id(requesterid);

            if (objUser.Userid != 0)
            {
                e.Row.Cells[2].Text = objUser.Username.ToString();
            }
            else
            {
                e.Row.Cells[2].Text = "";
            }
            #endregion

            #region Bind Datarow at Run Time with Createdbyid to Created by name
            int createdbyid = Convert.ToInt16(e.Row.Cells[3].Text);
            objUser = objUser.Get_By_id(createdbyid);
            if (objUser.Userid != 0)
            {
                e.Row.Cells[3].Text = objUser.Username.ToString();
            }
            else
            {
                e.Row.Cells[3].Text = "";
            }
            #endregion

            #region Bind Datarow at Run Time with technicianid to technician name
            int technicianid = Convert.ToInt16(e.Row.Cells[4].Text);
            objUser = objUser.Get_By_id(technicianid);
            if (objUser.Userid != 0)
            {
                e.Row.Cells[4].Text = objUser.Username.ToString();
            }
            else
            {
                e.Row.Cells[4].Text = "";
            }
            #endregion

            #region Bind Datarow at run time with Statusid to Status
            int statusid = Convert.ToInt16(e.Row.Cells[5].Text);

            ObjChangeStatus = ObjChangeStatus.Get_By_id(statusid);
            if (ObjChangeStatus.ChangeStatusid != 0)
            {
                e.Row.Cells[5].Text = ObjChangeStatus.Statusname.ToString();
            }
            else
            {
                e.Row.Cells[5].Text = "";
            }
            #endregion

            #region Bind Datarow at run time with Priorityid to Priority
            int priorityid = Convert.ToInt16(e.Row.Cells[6].Text);
            objPriority = objPriority.Get_By_id(priorityid);
            if (objPriority.Priorityid != 0)
            {
                e.Row.Cells[6].Text = objPriority.Name.ToString();
            }
            else
            {
                e.Row.Cells[6].Text = "";
            }
            #endregion
        }
    }
    protected void grdvwRequest_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        /////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            System.Drawing.ColorConverter colConvert = new ColorConverter();
            BLLCollection<ColorScheme_mst> colColor = new BLLCollection<ColorScheme_mst>();
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                #region Autogenerate Serial number
                Label lblSerial = (Label)e.Row.FindControl("lblSerial");
                lblSerial.Text = i.ToString();
                i++;
                #endregion

                int TotalTimeSpentonCall;
                int TotalResolutionTime;

                int varIncidentid = Convert.ToInt32(((Label)e.Row.FindControl("incidentid")).Text.ToString());
                string varCreateDatetime = e.Row.Cells[9].Text;
                string varStatusOpen = Resources.MessageResource.strStatusOpen.ToString();
                string varStatusClose = Resources.MessageResource.strStatusClose.ToString();
                string varStatusOnHold = Resources.MessageResource.strStatusOnHold.ToString();

                string varStatusResolved = Resources.MessageResource.strStatusResolved.ToString();

                #region Bind Data Row at Run time with requesterid to Requester name
                int requesterid = Convert.ToInt32(e.Row.Cells[3].Text);
                //objUser = objUser.Get_By_id(requesterid);
                objContactmst = objContactmst.Get_By_id(requesterid);
                //if (objUser.Userid != 0)
                //{
                //    e.Row.Cells[3].Text = objUser.Username.ToString();
                //    //e.Row.Cells[3].Text = objContactmst.Firstname.ToString();
                //}
                //else { e.Row.Cells[3].Text = ""; }
                //if (objUser.Userid != 0)
                //{
                //e.Row.Cells[3].Text = objUser.Username.ToString();
                if (objContactmst.Firstname != null)
                {
                    e.Row.Cells[3].Text = objContactmst.Firstname.ToString();
                }
                // }else { e.Row.Cells[3].Text = ""; }
                #endregion

                #region Bind Datarow at Run Time with Createdbyid to Created by name
                int createdbyid = Convert.ToInt32(e.Row.Cells[4].Text);
                objUser = objUser.Get_By_id(createdbyid);
                if (objUser.Userid != 0)
                {
                    e.Row.Cells[4].Text = objUser.Username.ToString();
                }
                else { e.Row.Cells[4].Text = ""; }
                #endregion

                #region Bind Datarow at Run Time with technicianid to technician name
                int technicianid = Convert.ToInt32(e.Row.Cells[5].Text);
                objUser = objUser.Get_By_id(technicianid);
                if (objUser.Userid != 0)
                {
                    e.Row.Cells[5].Text = objUser.Username.ToString();
                }
                else { e.Row.Cells[5].Text = ""; }
                #endregion

                #region Bind Datarow at run time with Statusid to Status
                int statusid = Convert.ToInt32(e.Row.Cells[6].Text);
                objStatus = objStatus.Get_By_id(statusid);
                if (objStatus.Statusid != 0)
                {

                    e.Row.Cells[6].Text = objStatus.Statusname.ToString();

                }
                else { e.Row.Cells[6].Text = ""; }
                #endregion

                #region Bind Datarow at run time with Priorityid to Priority
                int priorityid = Convert.ToInt32(e.Row.Cells[7].Text);
                objPriority = objPriority.Get_By_id(priorityid);
                if (objPriority.Priorityid != 0)
                { e.Row.Cells[7].Text = objPriority.Name.ToString(); }
                else { e.Row.Cells[7].Text = ""; }
                #endregion

                #region Bind Datarow at run time with Siteid to Site
                int siteid = Convert.ToInt32(e.Row.Cells[8].Text);
                objSite = objSite.Get_By_id(siteid);
                if (objSite.Siteid != 0)
                {
                    string custSiteName;
                    int custid = 0;
                    colCustToSite = objCustToSite.Get_All_By_siteid(objSite.Siteid);
                    foreach (CustomerToSiteMapping objCuToSite in colCustToSite)
                    {
                        custid = objCuToSite.Custid;

                    }
                    objCustomer = objCustomer.Get_By_id(custid);

                    e.Row.Cells[8].Text = objCustomer.Customer_name + "/" + objSite.Sitename.ToString();

                }
                else { e.Row.Cells[8].Text = ""; }
                #endregion

                #region Apply Color Coding to Open Calls,According to define SLA
                if (varStatusOpen.ToLower() == objStatus.Statusname.ToString().ToLower())
                {

                    Incident_mst obj = new Incident_mst();
                    obj = obj.Get_By_id(varIncidentid);
                    if (obj.Incidentid != 0)
                    {
                        if (obj.Slaid != 0)
                        {
                            #region Declare local variables,and objects of various classes
                            int percent;

                            ProcessEscalateEmail objPro = new ProcessEscalateEmail();
                            #endregion
                            #region Get Total Resolution time define for particular SLA and Time Spent on Request
                            TotalResolutionTime = objPro.GetResolutionTimeInMins(obj.Slaid);
                            TotalTimeSpentonCall = objIncident.Get_TimeSpentonRequest(varIncidentid, siteid, varCreateDatetime, DateTime.Now.ToString());
                            if (TotalTimeSpentonCall < 0)
                            {
                                TotalTimeSpentonCall = 0;
                            }
                            #endregion
                            #region Calculate Percent
                            if (TotalResolutionTime != 0)
                            {
                                percent = (TotalTimeSpentonCall * 100) / TotalResolutionTime;
                            }
                            else
                            {
                                percent = 0;
                            }

                            #endregion

                            ColorScheme_mst objColor = new ColorScheme_mst();
                            colColor = objColor.Get_All_By_CallStatus(varStatusOpen);

                            foreach (ColorScheme_mst objCol in colColor)
                            {
                                if (objCol.Percnt_to != 0)
                                {
                                    if (percent >= objCol.Percnt && percent <= objCol.Percnt_to)
                                    {
                                        e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname);
                                    }
                                }
                                else
                                {
                                    if (percent >= objCol.Percnt)
                                    {
                                        e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname);
                                    }

                                }

                            }

                        }
                        else
                        {
                            ColorScheme_mst objColor = new ColorScheme_mst();
                            colColor = objColor.Get_All_By_CallStatus("NonSLA");

                            foreach (ColorScheme_mst objCol in colColor)
                            {

                                e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname);
                            }

                        }
                    }

                }
                #endregion

                #region Apply Color Coding to Close Calls
                if (varStatusClose.ToLower() == objStatus.Statusname.ToString().ToLower())
                {
                    ColorScheme_mst objColor = new ColorScheme_mst();
                    colColor = objColor.Get_All_By_CallStatus(varStatusClose);
                    foreach (ColorScheme_mst obj in colColor)
                    {
                        try { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname); }
                        catch (Exception ex)
                        { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString("White"); }

                    }

                }
                #endregion

                #region Apply Color Coding to On Hold Calls
                if (varStatusOnHold.ToLower() == objStatus.Statusname.ToString().ToLower())
                {
                    ColorScheme_mst objColor = new ColorScheme_mst();
                    colColor = objColor.Get_All_By_CallStatus(varStatusOnHold);
                    foreach (ColorScheme_mst obj in colColor)
                    {
                        e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname);

                    }

                }
                #endregion

                #region Apply Color Coding to Resolved Calls
                if (varStatusResolved.ToLower() == objStatus.Statusname.ToString().ToLower())
                {
                    ColorScheme_mst objColor = new ColorScheme_mst();
                    colColor = objColor.Get_All_By_CallStatus(varStatusResolved);
                    foreach (ColorScheme_mst obj in colColor)
                    {
                        e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname);

                    }

                }
                #endregion

            }
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
    protected void Showproblempanal()
    {
        panelProblem.Visible = true;
        pan1.Visible = true;
        panelincidentproblem.Visible = false;
        //panelHistory.Visible = false;
        panaleditproblem.Visible = false;
        panalanalysis.Visible = false;
        btnUpdate.Visible = false;
        btnCancel.Visible = false;
        lnkEdit.Visible = true;
        panalsolution.Visible = false;
        panelHistory.Visible = false;

        int problemid = Convert.ToInt16(Request.QueryString[0]);
        lblProblemId.Text = problemid.ToString();
        ObjProblem = ObjProblem.Get_By_id(problemid);

           if (ObjProblem.title != null)
           {

           lblTitle.Text = ObjProblem.title.ToString();
           }

           if (ObjProblem.Description != null)
           {

           lblDescription.Text = ObjProblem.Description.ToString();
           }

           int priorityid = Convert.ToInt16(ObjProblem.Priorityid);
           ObjPriority = ObjPriority.Get_By_id(priorityid);
           if (priorityid!=0)
           {
           lblpriority.Text = ObjPriority.Name.ToString();

           }
           else
           {
           lblpriority.Text = "";

           }
           int status = Convert.ToInt16(ObjProblem.Statusid);
           ObjStatus = ObjStatus.Get_By_id(status);

           lblStatus.Text = ObjStatus.Statusname.ToString();

           int category = Convert.ToInt16(ObjProblem.Categoryid);
           ObjCategory = ObjCategory.Get_By_id(category);
           if (category != 0)
           {
           lblcategory.Text = ObjCategory.CategoryName.ToString();

           }
           else
           {
           lblcategory.Text = "";

           }

           int subcategory = Convert.ToInt16(ObjProblem.Subcategoryid);
           Objsubcategory = Objsubcategory.Get_By_id(subcategory);
           if (subcategory != 0)
           {
           lblsubcategory.Text = Objsubcategory.Subcategoryname.ToString();

           }
           else
           {
           lblsubcategory.Text = "";

           }

           int requesterid = Convert.ToInt16(ObjProblem.Requesterid);
           ObjUser = ObjUser.Get_By_id(requesterid);
           lblRequesterDisp.Text = ObjUser.Username;
           int techid = Convert.ToInt16(ObjProblem.Technicianid);
           ObjUser = ObjUser.Get_By_id(techid);

           if (techid != 0)
           {
           lbltechid.Text = ObjUser.Username.ToString();

           }
           else
           {
           lbltechid.Text = "";

           }

           int creator = Convert.ToInt16(ObjProblem.CreatedByid);
           ObjUser = ObjUser.Get_By_id(creator);
           lblCreatedby.Text = ObjUser.Username.ToString();
           lblCreatedDate.Text = ObjProblem.CreateDatetime.ToString();
           lblDateDisp.Text = ObjProblem.CreateDatetime.ToString();
           lblProblemId.Text = ObjProblem.ProblemId.ToString();
           if (ObjProblem.Closedatetime != null)
           {
           lblCompletedDate.Text = ObjProblem.Closedatetime.ToString();
           }
           else
           {
           lblCompletedDate.Text = "";
           }
    }
    protected void grdvwincidentproblem_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            if (colIncidentToProblem.Count != 0)
            {
                int requesterid = Convert.ToInt16(e.Row.Cells[2].Text);
                ObjUser = ObjUser.Get_By_id(requesterid);

                if (ObjUser.Userid != 0)
                {
                    e.Row.Cells[2].Text = ObjUser.Username.ToString();
                }
                else { e.Row.Cells[2].Text = ""; }
                #region Bind Datarow at Run Time with technicianid to technician name
                int technicianid = Convert.ToInt16(e.Row.Cells[3].Text);
                ObjUser = ObjUser.Get_By_id(technicianid);
                if (ObjUser.Userid != 0)
                {
                    e.Row.Cells[3].Text = ObjUser.Username.ToString();
                }
                else { e.Row.Cells[3].Text = ""; }
                #endregion
                #region Bind Datarow at run time with Statusid to Status
                int statusid = Convert.ToInt16(e.Row.Cells[4].Text);
                ObjStatus = ObjStatus.Get_By_id(statusid);
                if (ObjStatus.Statusid != 0)
                { e.Row.Cells[4].Text = ObjStatus.Statusname.ToString(); }
                else { e.Row.Cells[4].Text = ""; }
                #endregion
            }
            else
            {
                e.Row.Cells[6].Visible = false;
                e.Row.Cells[3].Text = "No Record Found";
            }

        }
    }
    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();

        //}
    }