Esempio n. 1
0
    public void GetAllContract()
    {
        int FlagTotalTime;

        colContract = objContract.Get_All_Escalate_Notification();
        foreach (Contract_mst obj in colContract)
        {
            FlagTotalTime = objContract.Get_Contract_Notification_Time(obj.Contractid);
            if (FlagTotalTime <= 0)
            {
                objContractNotification = objContractNotification.Get_By_id(obj.Contractid);
                objContractNotification.Sendnotification = true;
                objContractNotification.Contractid       = obj.Contractid;

                string   varemail    = objContractNotification.Sentto;
                string[] arrEmail    = varemail.Split(',');
                int      lengthCount = Convert.ToInt32(arrEmail.Length.ToString());
                for (int i = 0; i < lengthCount - 1; i++)
                {
                    string emailId = arrEmail[i].ToString();
                    if (emailId != "," && emailId != "")
                    {
                        objEmail.To         = emailId;
                        objEmail.From       = Resources.MessageResource.strEmailFromLevel1Escalate.ToString();
                        objEmail.Subject    = "Contract is About to Expire  -" + obj.Contractname;
                        objEmail.Body       = "Dear Sir, The Contract " + obj.Contractname + " is going to expire on  " + obj.Activeto + " Please send mail to Renew Contract.  Thanks & Regards Admin";
                        objEmail.SmtpServer = Resources.MessageResource.strMailServer.ToString();
                        objEmail.SentMail();
                    }
                }
                objContractNotification.Update();
            }
        }
    }
Esempio n. 2
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 SendEmail(int incidentid, int level, int slaid)
    {
        SentEmail objEmail = new SentEmail();

        #region Sent Mail for Level 1 Escalation
        if (level == 1)
        {
            objLevel1 = objLevel1.Get_By_Slaid(slaid);
            if (objLevel1 != null)
            {
                string   varemail    = objLevel1.Emailid;
                string[] arrEmail    = varemail.Split(',');
                int      lengthCount = Convert.ToInt32(arrEmail.Length.ToString());
                for (int i = 0; i < lengthCount - 1; i++)
                {
                    string emailId = arrEmail[i].ToString();
                    if (emailId != "," && emailId != "")
                    {
                        objIncident = objIncident.Get_By_id(incidentid);
                        if (objIncident != null)
                        {
                            objCheckLevel1 = objCheckLevel1.Get_By_id(incidentid);
                            if (objCheckLevel1.Incidentid == 0)
                            {
                                CheckLevel1Escalate obj = new CheckLevel1Escalate();
                                obj.Incidentid     = incidentid;
                                obj.Level1escalate = true;
                                obj.Insert();
                                objEmail.To         = emailId;
                                objEmail.From       = Resources.MessageResource.strEmailFromLevel1Escalate.ToString();
                                objEmail.Subject    = "Problem Not Resolve for Call -" + objIncident.Title;
                                objEmail.Body       = "Dear Sir, The Current Request is not Solved whose Incident Id is " + objIncident.Incidentid + " and Title of Call is " + objIncident.Title + " Thanks & Regards Admin";
                                objEmail.SmtpServer = Resources.MessageResource.strMailServer.ToString();
                                objEmail.SentMail();
                            }
                        }
                    }
                }
            }
        }
        #endregion
        #region Sent Mail for Level 2 Escalation
        if (level == 2)
        {
            objLevel2 = objLevel2.Get_By_Slaid(slaid);
            if (objLevel2.Slaid != 0)
            {
                string   varemail    = objLevel2.Emailid;
                string[] arrEmail    = varemail.Split(',');
                int      lengthCount = Convert.ToInt32(arrEmail.Length.ToString());
                for (int i = 0; i < lengthCount - 1; i++)
                {
                    string emailId = arrEmail[i].ToString();
                    if (emailId != "," && emailId != "")
                    {
                        objIncident = objIncident.Get_By_id(incidentid);
                        if (objIncident != null)
                        {
                            objCheckLevel2 = objCheckLevel2.Get_By_id(incidentid);
                            if (objCheckLevel2.Incidentid == 0)
                            {
                                CheckLevel2Escalate obj = new CheckLevel2Escalate();
                                obj.Incidentid     = incidentid;
                                obj.Level2escalate = true;
                                obj.Insert();
                                objEmail.To         = emailId;
                                objEmail.From       = Resources.MessageResource.strEmailFromLevel2Escalate.ToString();
                                objEmail.Subject    = "Problem Not Resolve for Call -" + objIncident.Title;
                                objEmail.Body       = "Dear Sir, The Current Request is not Solved whose Incident Id is " + objIncident.Incidentid + " and Title of Call is " + objIncident.Title + " Thanks & Regards <br/> Admin";
                                objEmail.SmtpServer = Resources.MessageResource.strMailServer.ToString();
                                objEmail.SentMail();
                            }
                        }
                    }
                }
            }
        }
        #endregion
        #region Sent Mail for Level 3 Escalation
        if (level == 3)
        {
            objLevel3 = objLevel3.Get_By_Slaid(slaid);
            if (objLevel3.Slaid != 0)
            {
                string   varemail    = objLevel3.Emailid;
                string[] arrEmail    = varemail.Split(',');
                int      lengthCount = Convert.ToInt32(arrEmail.Length.ToString());
                for (int i = 0; i < lengthCount - 1; i++)
                {
                    string emailId = arrEmail[i].ToString();
                    if (emailId != "," && emailId != "")
                    {
                        objIncident = objIncident.Get_By_id(incidentid);
                        if (objIncident != null)
                        {
                            objCheckLevel3 = objCheckLevel3.Get_By_id(incidentid);
                            if (objCheckLevel3.Incidentid == 0)
                            {
                                CheckLevel3Escalate obj = new CheckLevel3Escalate();
                                obj.Incidentid     = incidentid;
                                obj.Level3escalate = true;
                                obj.Insert();

                                objEmail.To         = emailId;
                                objEmail.From       = Resources.MessageResource.strEmailFromLevel3Escalate.ToString();
                                objEmail.Subject    = "Problem Not Resolve for Call -" + objIncident.Title;
                                objEmail.Body       = "Dear Sir, The Current Request is not Solved whose Incident Id is " + objIncident.Incidentid + " and Title of Call is " + objIncident.Title + "  Thanks & Regards  Admin";
                                objEmail.SmtpServer = Resources.MessageResource.strMailServer.ToString();
                                objEmail.SentMail();
                            }
                        }
                    }
                }
            }
        }
        #endregion
    }
    protected void SendEmail(int incidentid, int level,int slaid)
    {
        SentEmail objEmail = new SentEmail();
        #region Sent Mail for Level 1 Escalation
        if (level==1)
          {
            objLevel1 = objLevel1.Get_By_Slaid(slaid);
            if (objLevel1!=null )
            {
                string varemail = objLevel1.Emailid;
                string[] arrEmail = varemail.Split(',');
                int lengthCount = Convert.ToInt16(arrEmail.Length.ToString());
                for (int i = 0; i < lengthCount - 1; i++)
                {
                    string emailId = arrEmail[i].ToString();
                    if (emailId != "," && emailId!="")
                    {
                        objIncident = objIncident.Get_By_id(incidentid);
                        if (objIncident!=null)
                        {

                            objCheckLevel1 = objCheckLevel1.Get_By_id(incidentid);
                            if (objCheckLevel1.Incidentid ==0)
                            {
                                CheckLevel1Escalate obj = new CheckLevel1Escalate();
                                obj.Incidentid = incidentid;
                                obj.Level1escalate = true;
                                obj.Insert();
                                objEmail.To = emailId;
                                objEmail.From = Resources.MessageResource.strEmailFromLevel1Escalate.ToString();
                                objEmail.Subject = "Problem Not Resolve for Call -" + objIncident.Title;
                                objEmail.Body = "Dear Sir, The Current Request is not Solved whose Incident Id is " + objIncident.Incidentid + " and Title of Call is " + objIncident.Title + " Thanks & Regards Admin";
                                objEmail.SmtpServer = Resources.MessageResource.strMailServer.ToString();
                                objEmail.SentMail();
                            }

                        }

                        }

                    }

                }
          }
        #endregion
        #region Sent Mail for Level 2 Escalation
        if (level == 2)
        {
            objLevel2 = objLevel2.Get_By_Slaid(slaid);
            if (objLevel2.Slaid  != 0)
            {
                string varemail = objLevel2.Emailid;
                string[] arrEmail = varemail.Split(',');
                int lengthCount = Convert.ToInt16(arrEmail.Length.ToString());
                for (int i = 0; i < lengthCount - 1; i++)
                {
                    string emailId = arrEmail[i].ToString();
                    if (emailId != "," && emailId != "")
                    {
                        objIncident = objIncident.Get_By_id(incidentid);
                        if (objIncident != null)
                        {

                            objCheckLevel2 = objCheckLevel2.Get_By_id(incidentid);
                            if (objCheckLevel2.Incidentid == 0)
                            {
                                CheckLevel2Escalate obj = new CheckLevel2Escalate();
                                obj.Incidentid = incidentid;
                                obj.Level2escalate = true;
                                obj.Insert();
                                objEmail.To = emailId;
                                objEmail.From = Resources.MessageResource.strEmailFromLevel2Escalate.ToString();
                                objEmail.Subject = "Problem Not Resolve for Call -" + objIncident.Title;
                                objEmail.Body = "Dear Sir, The Current Request is not Solved whose Incident Id is " + objIncident.Incidentid + " and Title of Call is " + objIncident.Title + " Thanks & Regards <br/> Admin";
                                objEmail.SmtpServer = Resources.MessageResource.strMailServer.ToString();
                                objEmail.SentMail();

                            }

                        }

                    }

                }

            }
        }
        #endregion
        #region Sent Mail for Level 3 Escalation
        if (level == 3)
        {
            objLevel3 = objLevel3.Get_By_Slaid(slaid);
            if (objLevel3.Slaid  != 0)
            {
                string varemail = objLevel3.Emailid;
                string[] arrEmail = varemail.Split(',');
                int lengthCount = Convert.ToInt16(arrEmail.Length.ToString());
                for (int i = 0; i < lengthCount - 1; i++)
                {
                    string emailId = arrEmail[i].ToString();
                    if (emailId != "," && emailId != "")
                    {
                        objIncident = objIncident.Get_By_id(incidentid);
                        if (objIncident != null)
                        {

                            objCheckLevel3 = objCheckLevel3.Get_By_id(incidentid);
                            if (objCheckLevel3.Incidentid == 0)
                            {
                                CheckLevel3Escalate obj = new CheckLevel3Escalate();
                                obj.Incidentid = incidentid;
                                obj.Level3escalate = true;
                                obj.Insert();

                                objEmail.To = emailId;
                                objEmail.From = Resources.MessageResource.strEmailFromLevel3Escalate.ToString();
                                objEmail.Subject = "Problem Not Resolve for Call -" + objIncident.Title;
                                objEmail.Body = "Dear Sir, The Current Request is not Solved whose Incident Id is " + objIncident.Incidentid + " and Title of Call is " + objIncident.Title + "  Thanks & Regards  Admin";
                                objEmail.SmtpServer = Resources.MessageResource.strMailServer.ToString();
                                objEmail.SentMail();

                            }

                        }

                    }

                }

            }
        }
        #endregion
    }