private void ExecuteTimerAlert(SPWeb web, SPList list, Alert alert)
        {
            try
            {
                if (web != null && list != null)
                {
                    DateTime startTime = web.RegionalSettings.TimeZone.UTCToLocalTime(DateTime.UtcNow).AddMinutes(-30.0);
                    DateTime endTime   = web.RegionalSettings.TimeZone.UTCToLocalTime(DateTime.UtcNow);
                    TimerJobHelper.CaliculateExecutionTime(ref startTime, alert, false);
                    TimerJobHelper.CaliculateExecutionTime(ref endTime, alert, false);

                    int num  = !alert.Repeat ? 1 : (alert.RepeatCount + 1);
                    int num2 = 1;
                    while (num2 <= num)
                    {
                        //We need to get all alerts which are fall
                        SPQuery query = new SPQuery();
                        query.Query = string.Format("<Where>" +
                                                    "<And>" +
                                                    "<Gt>" +
                                                    "<FieldRef Name=\"{0}\" />" +
                                                    "<Value Type=\"DateTime\" IncludeTimeValue=\"TRUE\">{1}</Value>" +
                                                    "</Gt>" +
                                                    "<Leq>" +
                                                    "<FieldRef Name=\"{0}\" />" +
                                                    "<Value Type=\"DateTime\" IncludeTimeValue=\"TRUE\">{2}</Value>" +
                                                    "</Leq>" +
                                                    "</And>" +
                                                    "</Where>",
                                                    new object[] { alert.DateColumnName, SPUtility.CreateISO8601DateTimeFromSystemDateTime(startTime), SPUtility.CreateISO8601DateTimeFromSystemDateTime(endTime) });
                        SPListItemCollection items = list.GetItems(query);
                        if (items.Count > 0)
                        {
                            foreach (SPListItem item in items)
                            {
                                if (alert.IsValid(item, AlertEventType.DateColumn, null))
                                {
                                    Notifications mailSender = new Notifications();
                                    //mailSender.SendAlert(alert, ChangeTypes.DateColumn, item2, null);
                                    mailSender.SendMail(alert, AlertEventType.DateColumn, item);
                                }
                                else
                                {
                                    //Some conditions are not passthrough
                                }
                            }
                        }
                        else
                        { //No items returned as part of Query
                        }
                        if (num2 < num)
                        {
                            TimerJobHelper.CaliculateExecutionTime(ref startTime, alert, true);
                            TimerJobHelper.CaliculateExecutionTime(ref endTime, alert, true);
                        }
                        num2++;
                    }
                }
            }
            catch
            {
                //Error occured while executing timer alerts
            }
        }
        private void ExecuteTimerAlert(SPWeb web, SPList list, Alert alert)
        {
            try
            {
                if (web != null && list != null)
                {


                    DateTime startTime = web.RegionalSettings.TimeZone.UTCToLocalTime(DateTime.UtcNow).AddMinutes(-30.0);
                    DateTime endTime = web.RegionalSettings.TimeZone.UTCToLocalTime(DateTime.UtcNow);
                    TimerJobHelper.CaliculateExecutionTime(ref startTime, alert, false);
                    TimerJobHelper.CaliculateExecutionTime(ref endTime, alert, false);

                    int num = !alert.Repeat ? 1 : (alert.RepeatCount + 1);
                    int num2 = 1;
                    while (num2 <= num)
                    {

                        //We need to get all alerts which are fall
                        SPQuery query = new SPQuery();
                        query.Query = string.Format("<Where>" +
                                                      "<And>" +
                                                       "<Gt>" +
                                                        "<FieldRef Name=\"{0}\" />" +
                                                          "<Value Type=\"DateTime\" IncludeTimeValue=\"TRUE\">{1}</Value>" +
                                                        "</Gt>" +
                                                        "<Leq>" +
                                                          "<FieldRef Name=\"{0}\" />" +
                                                          "<Value Type=\"DateTime\" IncludeTimeValue=\"TRUE\">{2}</Value>" +
                                                        "</Leq>" +
                                                       "</And>" +
                                                       "</Where>",
                                                        new object[] { alert.DateColumnName, SPUtility.CreateISO8601DateTimeFromSystemDateTime(startTime), SPUtility.CreateISO8601DateTimeFromSystemDateTime(endTime) });
                        SPListItemCollection items = list.GetItems(query);
                        if (items.Count > 0)
                        {
                            foreach (SPListItem item in items)
                            {
                                if (alert.IsValid(item, AlertEventType.DateColumn, null))
                                {
                                    Notifications mailSender = new Notifications();
                                    //mailSender.SendAlert(alert, ChangeTypes.DateColumn, item2, null);
                                    mailSender.SendMail(alert, AlertEventType.DateColumn, item);

                                }
                                else
                                {
                                    //Some conditions are not passthrough
                                }
                            }
                        }
                        else
                        { //No items returned as part of Query
                        }
                        if (num2 < num)
                        {
                            TimerJobHelper.CaliculateExecutionTime(ref startTime, alert, true);
                            TimerJobHelper.CaliculateExecutionTime(ref endTime, alert, true);
                        }
                        num2++;
                    }
                }
            }
            catch
            {
                //Error occured while executing timer alerts
            }
        }