public static List <SchedulerLog> GetLatestExecutionLogs() { SchedulerLog schedulerExecutionLog; List <SchedulerLog> schedulerExecutionLogs = null; DataSet dsSchedulerExecutionLogs = SchedulerDao.GetLatestExecutionLogs(); if (dsSchedulerExecutionLogs != null) { if (dsSchedulerExecutionLogs.Tables[0].Rows.Count > 0) { schedulerExecutionLogs = new List <SchedulerLog>(); foreach (DataRow dr in dsSchedulerExecutionLogs.Tables[0].Rows) { schedulerExecutionLog = new SchedulerLog(); int.TryParse(dr["SchedulerLogId"].ToString(), out int iSchedulerLogId); schedulerExecutionLog.SchedulerLogId = iSchedulerLogId; int.TryParse(dr["SchedulerExecutionId"].ToString(), out int iSchedulerExecutionId); schedulerExecutionLog.SchedulerExecutionId = iSchedulerExecutionId; int.TryParse(dr["SchedulerSettingsId"].ToString(), out int iSchedulerSettingsId); schedulerExecutionLog.SchedulerSettingsId = iSchedulerSettingsId; int.TryParse(dr["SchedulerId"].ToString(), out int iSchedulerId); schedulerExecutionLog.SchedulerId = iSchedulerId; schedulerExecutionLog.Name = dr["Name"].ToString(); int.TryParse(dr["ActionTye"].ToString(), out int iActionTye); schedulerExecutionLog.ActionTye = iActionTye; int.TryParse(dr["TransactionType"].ToString(), out int iTransactionType); schedulerExecutionLog.TransactionType = iTransactionType; int.TryParse(dr["PartnerType"].ToString(), out int iPartnerType); schedulerExecutionLog.PartnerType = iPartnerType; int.TryParse(dr["PartnerId"].ToString(), out int iPartnerId); schedulerExecutionLog.PartnerId = iPartnerId; DateTime.TryParse(dr["ExecutionTimeStamp"].ToString(), out DateTime dExecutionTimeStamp); schedulerExecutionLog.ExecutionTimeStamp = dExecutionTimeStamp; schedulerExecutionLog.Content = dr["Content"].ToString(); int.TryParse(dr["Status"].ToString(), out int iStatus); schedulerExecutionLog.Status = iStatus; // Add log to the list schedulerExecutionLogs.Add(schedulerExecutionLog); } } } return(schedulerExecutionLogs); }