public static ProjectProgressDto ToDto(this ProjectProgressStatus progress) { if (progress == null) { return(null); } return(new ProjectProgressDto { Id = progress.Id, ProjId = progress.ProjectId, Month = progress.Month, OK = progress.OK }); }
public void AddOrUpdateProgress(long projId, DateTime month, bool ok) { var mStr = GetMonth(month); var progress = _progressRepo.Table.FirstOrDefault(c => c.ProjectId == projId && mStr == c.Month); if (progress == null) { progress = new ProjectProgressStatus { ProjectId = projId, Month = mStr, OK = ok }; _progressRepo.Insert(progress); } else { progress.OK = ok; UpdateProgress(progress); } }
public void UpdateProgress(ProjectProgressStatus progress) { _progressRepo.Update(progress); }