private void Fetch(string name, [Inject] IProjectDal dal) { using (LoadListMode) { List <Dal.ProjectDto> list = null; if (name == null) { list = dal.Fetch(); } else { list = dal.Fetch(name); } foreach (var item in list) { Add(DataPortal.FetchChild <ProjectInfo>(item)); } } }
private void Fetch(ProjectTracker.Dal.AssignmentDto data, [Inject] IProjectDal dal) { using (BypassPropertyChecks) { ProjectId = data.ProjectId; Role = data.RoleId; LoadProperty(AssignedProperty, data.Assigned); TimeStamp = data.LastChanged; var project = dal.Fetch(data.ProjectId); ProjectName = project.Name; } }
private void Execute([Inject] IProjectDal dal) { var data = dal.Fetch(ProjectId); if (data.Ended.HasValue) { throw new InvalidOperationException("Project already closed"); } data.Ended = DateTime.Today; dal.Update(data); Closed = true; }
private void Create(int projectId, [Inject] IProjectDal dal) { using (BypassPropertyChecks) { ProjectId = projectId; RoleList.CacheList(); Role = RoleList.DefaultRole(); LoadProperty(AssignedProperty, DateTime.Today); var project = dal.Fetch(projectId); ProjectName = project.Name; } BusinessRules.CheckRules(); }
private void Fetch(int id, [Inject] IProjectDal dal) { var data = dal.Fetch(id); using (BypassPropertyChecks) { Id = data.Id; Name = data.Name; Description = data.Description; Started = data.Started; Ended = data.Ended; TimeStamp = data.LastChanged; Resources = DataPortal.FetchChild <ProjectResources>(id); } }