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
    }
 public int Update_CheckLevel3Escalate_By_id(CheckLevel3Escalate objCheckLevel3Escalate)
 {
     return (int)ExecuteNonQuery(sp_CheckLevel3Escalate_Update, new object[] { objCheckLevel3Escalate.Level3escalate, objCheckLevel3Escalate.Incidentid });
 }
 public int Insert_CheckLevel3Escalate(CheckLevel3Escalate objCheckLevel3Escalate)
 {
     return (int)ExecuteNonQuery(sp_CheckLevel3Escalate_Insert, new object[] { objCheckLevel3Escalate.Level3escalate, objCheckLevel3Escalate.Incidentid });
 }
    public object GenerateCheckLevel3EscalateObject(ref IDataReader returnData)
    {
        CheckLevel3Escalate obj = new CheckLevel3Escalate();
        while (returnData.Read())
        {
            obj.Incidentid = (int)returnData["Incidentid"];
            obj.Level3escalate = (bool)returnData["Level3escalate"];

        }
        returnData.Close();
        returnData.Dispose();
        return obj;
    }
    public CollectionBase GenerateCheckLevel3EscalateCollection(ref IDataReader returnData)
    {
        BLLCollection<CheckLevel3Escalate> col = new BLLCollection<CheckLevel3Escalate>();
        while (returnData.Read())
        {

            CheckLevel3Escalate obj = new CheckLevel3Escalate();
            obj.Incidentid = (int)returnData["Incidentid"];
            obj.Level3escalate = (bool)returnData["Level3escalate"];

            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }