public void GetAllCalls() { #region Declaretion of local variables int totalResolutionTimeInMins; int totalSpentMinOnCall; int totalEscalateEmailLevel1Min; int totalEscalateEmailLevel2Min; int totalEscalateEmailLevel3Min; string status = Resources.MessageResource.strStatusOpen.ToString(); int statusId = objStatus.Get_By_StatusName(status); int requesttypeid = Convert.ToInt32(Resources.MessageResource.strRequestTypeIncident.ToString()); #endregion #region Get All Open Calls,of Incident Type colIncident = objIncident.Get_All_For_ProcessEmailEscalate(statusId, requesttypeid); #endregion #region Process Each Call , and check Time spent on call and Escalation Time foreach (Incident_mst obj in colIncident) { #region Get Total Resolution Time Define for Selected SLA totalResolutionTimeInMins = GetResolutionTimeInMins(obj.Slaid); #endregion #region Get Total time Spent on Call,till now totalSpentMinOnCall = obj.Get_TimeSpentonRequest(obj.Incidentid, obj.Siteid, obj.Createdatetime, DateTime.Now.ToString()); #endregion #region Get Total Time Define for Level 1 Escalation to shoot mail totalEscalateEmailLevel1Min = GetLevel1EscalationTimeInMins(obj.Slaid); #endregion #region Check ,If Email Escalation time is defined to shoot mail if (totalEscalateEmailLevel1Min > 0) { #region If Call is not resolved till Email shoot time ,then Sent a mail if ((totalSpentMinOnCall + totalEscalateEmailLevel1Min) > totalResolutionTimeInMins) { SendEmail(obj.Incidentid, 1, obj.Slaid); } #endregion } #endregion #region Get Total Time Define for Level 2 Escalation to shoot mail totalEscalateEmailLevel2Min = GetLevel2EscalationTimeInMins(obj.Slaid); #endregion #region Check ,If Email Escalation time is defined to shoot mail if (totalEscalateEmailLevel2Min > 0) { #region If Call is not resolved till Email shoot time ,then Sent a mail if ((totalSpentMinOnCall + totalEscalateEmailLevel2Min) > totalResolutionTimeInMins) { SendEmail(obj.Incidentid, 2, obj.Slaid); } #endregion } #endregion #region Get Total Time Define for Level 3 Escalation to shoot mail totalEscalateEmailLevel3Min = GetLevel3EscalationTimeInMins(obj.Slaid); if (totalEscalateEmailLevel3Min > 0) { #region Check ,If Email Escalation time is defined to shoot mail if ((totalSpentMinOnCall + totalEscalateEmailLevel3Min) > totalResolutionTimeInMins) { SendEmail(obj.Incidentid, 3, obj.Slaid); } #endregion } #endregion } #endregion }