Beispiel #1
0
        public Group CreateGroup(Group group)
        {
            id += 1;
            string idGroup = "Group-";
            string idNum   = "";

            if (id < 10)
            {
                idNum = "00";
            }
            else if (id < 100)
            {
                idNum = "0";
            }
            else
            {
                idNum = "";
            }
            group.Id = idGroup + idNum + id;
            if (group.Name.Length <= 50 && group.Name != null)
            {
                Data.Models.Group groupToAdd = DTOMappers.MapGroup(group);
                _dbContext.AddGroup(groupToAdd);
            }
            return(group);
        }
Beispiel #2
0
 public Group DeleteGroup(Group group)
 {
     Data.Models.Group groupToDelete = DTOMappers.MapGroup(group);
     _dbContext.DeleteGroup(groupToDelete);
     return(group);
 }
Beispiel #3
0
 public Group UpdateGroup(Group group)
 {
     Data.Models.Group groupToUpdate = DTOMappers.MapGroup(group);
     _dbContext.UpdateGroup(groupToUpdate);
     return(group);
 }
Beispiel #4
0
        public List <Group> GetAllGroups()
        {
            List <Data.Models.Group> groups = _dbContext.GetAll();

            return(DTOMappers.MapGroups(groups));
        }
 public Group createGroup(Group group)
 {
     dbContext.add(DTOMappers.MapGroup(group));
     return(group);
 }
 public List <Group> getAll()
 {
     return(DTOMappers.MapGroups(dbContext.getAll()));
 }