Beispiel #1
0
    protected void BindDropPriority()
    {
        Priority_mst objP = new Priority_mst();

        objP = objPriority.Get_By_id(priorityid);
        colPriority.Add(objP);
        drpPriority.DataTextField  = "name";
        drpPriority.DataValueField = "priorityid";
        drpPriority.DataSource     = colPriority;
        drpPriority.DataBind();
    }
    protected void Update()
    {
        int Slaid = Convert.ToInt32(Request.QueryString[0]);

        objSla = objSla.Get_By_id(Slaid);
        if (objSla.Slaid != 0)
        {
            int siteid = objSla.Siteid;
            objSite = objSite.Get_By_id(siteid);
            if (objSite.Siteid != 0)
            {
                lblSite.Text = objSite.Sitename;
            }
            txtSlaName.Text     = objSla.Slaname.ToString().Trim();
            txtDescription.Text = objSla.Description.ToString().Trim();
            objSlaPriority      = objSlaPriority.Get_By_id(objSla.Slaid);
            if (objSlaPriority.Priorityid != 0)
            {
                objPriority = objPriority.Get_By_id(objSlaPriority.Priorityid);
                if (objPriority.Priorityid != 0)
                {
                    lblPriority.Text     = objPriority.Name.ToString().Trim();
                    drphr.SelectedValue  = Convert.ToString(objSlaPriority.Resolutionhours);
                    drpMin.SelectedValue = Convert.ToString(objSlaPriority.Resolutionmin);
                    txtDays.Text         = Convert.ToString(objSlaPriority.Resolutiondays);
                }
            }
        }
    }
Beispiel #3
0
    protected void Prioritygrdvw_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        Priority_mst obj = new Priority_mst();
        string       name, desc, id;
        int          PriorityId = 0;

        name          = ((TextBox)Prioritygrdvw.Rows[e.RowIndex].Cells[1].Controls[0].FindControl("txtPriorityName")).Text;
        desc          = ((TextBox)Prioritygrdvw.Rows[e.RowIndex].Cells[2].Controls[0].FindControl("txtprioritydesc")).Text;
        id            = Convert.ToString(Prioritygrdvw.Rows[e.RowIndex].Cells[0].Text);
        PriorityId    = Convert.ToInt16(id);
        prioritycount = Priorityobj.Get_By_PriorityName(name);
        obj           = obj.Get_By_id(PriorityId);

        if ((prioritycount == 0) && (name != ""))
        {
            Priorityobj.Priorityid  = PriorityId;
            Priorityobj.Name        = name;
            Priorityobj.Description = desc;
            Priorityobj.Update();
            Prioritygrdvw.EditIndex = -1;
            BindGrid();
            lblerrmsg.Text = Resources.MessageResource.errupdate.ToString();
        }
        else if (name == "")
        {
            lblerrmsg.Text = Resources.MessageResource.errnotempty.ToString();
        }
        else if (obj.Name == name)
        {
            Priorityobj.Priorityid  = PriorityId;
            Priorityobj.Name        = name;
            Priorityobj.Description = desc;
            Priorityobj.Update();
            Prioritygrdvw.EditIndex = -1;
            BindGrid();
            lblerrmsg.Text = Resources.MessageResource.errupdate.ToString();
        }
        else
        {
            Prioritygrdvw.EditIndex = -1;
            BindGrid();
            lblerrmsg.Text = Resources.MessageResource.errPriorityExist.ToString();
        }
    }
Beispiel #4
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
        }
    }
Beispiel #5
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();
            //}
        }
    }
    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;
        }
    }
    protected void Prioritygrdvw_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        Priority_mst obj = new Priority_mst();
           string name, desc, id;
           int PriorityId = 0;
           name = ((TextBox)Prioritygrdvw.Rows[e.RowIndex].Cells[1].Controls[0].FindControl("txtPriorityName")).Text;
           desc = ((TextBox)Prioritygrdvw.Rows[e.RowIndex].Cells[2].Controls[0].FindControl("txtprioritydesc")).Text;
           id = Convert.ToString(Prioritygrdvw.Rows[e.RowIndex].Cells[0].Text);
           PriorityId = Convert.ToInt32(id);
           prioritycount=Priorityobj.Get_By_PriorityName(name);
           obj = obj.Get_By_id(PriorityId);

           if ((prioritycount == 0)&&(name!=""))
           {
               Priorityobj.Priorityid = PriorityId;
               Priorityobj.Name = name;
               Priorityobj.Description = desc;
               Priorityobj.Update();
               Prioritygrdvw.EditIndex = -1;
               BindGrid();
               lblerrmsg.Text = Resources.MessageResource.errupdate.ToString();
           }
           else if(name == "")
           {
               lblerrmsg.Text = Resources.MessageResource.errnotempty.ToString();
           }
           else if (obj.Name == name)
           {
               Priorityobj.Priorityid = PriorityId;
               Priorityobj.Name = name;
               Priorityobj.Description = desc;
               Priorityobj.Update();
               Prioritygrdvw.EditIndex = -1;
               BindGrid();
               lblerrmsg.Text = Resources.MessageResource.errupdate.ToString();
           }
           else
           {
               Prioritygrdvw.EditIndex = -1;
               BindGrid();
               lblerrmsg.Text = Resources.MessageResource.errPriorityExist.ToString();
           }
    }
Beispiel #8
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
        }
    }
    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 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
        }
    }
Beispiel #11
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;
        }
    }