public static ScheduleItem Convert(DataRow dataRow) { if (dataRow == null) { return(null); } DataRowContainer row = new DataRowContainer(dataRow); ScheduleItem obj = new ScheduleItem(); obj.Id = row.String("ScheduleId"); //obj.UserId = row.String("UserId"); //obj.Username = row.String("Username"); obj.Title = row.String("Title"); obj.Enabled = row.Bool("Enabled", true); obj.TypeFullName = row.String("TypeFullName"); obj.CatchUpEnabled = row.Bool("CatchUpEnabled", false); obj.TimeLapse = row.Int("TimeLapse", 0); obj.TimeLapseMeasurement = row.String("TimeLapseMeasurement"); obj.RetryTimeLapse = row.Int("RetryTimeLapse", 0); obj.RetryTimeLapseMeasurement = row.String("RetryTimeLapseMeasurement"); obj.RetainHistoryNum = row.Int("RetainHistoryNum", 0); obj.AttachToEvent = row.String("AttachToEvent"); obj.ObjectDependencies = row.String("ObjectDependencies"); obj.Servers = row.String("Servers"); obj.NextStart = row.DateTime("NextStart"); obj.LastUpdateTime = row.DateTime("LastUpdateTime"); obj.Status = row.Int("Status", 2); obj.CreateTime = row.DateTime("CreateTime"); return(obj); }
new public static ScheduleHistoryItem Convert(DataRow dataRow) { if (dataRow == null) { return(null); } DataRowContainer row = new DataRowContainer(dataRow); ScheduleHistoryItem obj = new ScheduleHistoryItem(); obj.ScheduleHistoryId = row.Int("ScheduleHistoryId"); obj.ScheduleId = row.Int("ScheduleId"); obj.Server = row.String("Server"); obj.StartTime = row.DateTime("StartTime"); obj.EndTime = row.DateTime("EndTime"); obj.Succeed = row.Bool("Succeed", false); obj.NextStart = row.DateTime("NextStart"); obj.LogNotes = row.String("LogNotes"); obj.Status = row.Int("Status", 2); obj.CreateTime = row.DateTime("CreateTime"); return(obj); }