public void Insert(RoleDto item) { var newItem = new Role { Name = item.Name }; db.Roles.Add(newItem); db.SaveChanges(); item.Id = newItem.Id; item.LastChanged = newItem.LastChanged; }
public void Insert(ResourceDto item) { var newItem = new Resource { FirstName = item.FirstName, LastName = item.LastName }; db.Resources.Add(newItem); db.SaveChanges(); item.Id = newItem.Id; item.LastChanged = newItem.LastChanged; }
public void Insert(AssignmentDto item) { var newItem = new Assignment { ProjectId = item.ProjectId, ResourceId = item.ResourceId, Assigned = item.Assigned, RoleId = item.RoleId }; db.Assignments.Add(newItem); db.SaveChanges(); item.LastChanged = newItem.LastChanged; }
public void Insert(ProjectDto item) { var newItem = new Project { Name = item.Name, Description = item.Description, Started = item.Started, Ended = item.Ended }; db.Projects.Add(newItem); db.SaveChanges(); item.Id = newItem.Id; item.LastChanged = newItem.LastChanged; }