示例#1
0
文件: RoleDal.cs 项目: mlivensp/csla
        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;
        }
示例#2
0
        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;
        }
示例#3
0
        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;
        }
示例#4
0
        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;
        }