Exemplo n.º 1
0
        public int AddTeam(TeamDTO dto)
        {
            int id = 0;

            try
            {
                log.Debug(TeamDTO.FormatTeamDTO(dto));

                R_Team t = TeamDTO.ConvertDTOtoEntity(dto);

                // add
                id         = Repository.AddTeam(t);
                dto.TeamId = id;

                log.Debug("result: 'success', id: " + id);
            }
            catch (System.Exception e)
            {
                // error
                log.Error(e.ToString());

                throw;
            }

            return(id);
        }
Exemplo n.º 2
0
        public void DeleteTeam(TeamDTO dto)
        {
            try
            {
                log.Debug(TeamDTO.FormatTeamDTO(dto));

                R_Team t = TeamDTO.ConvertDTOtoEntity(dto);

                // delete
                Repository.DeleteTeam(t);
                dto.IsDeleted = t.IsDeleted;

                log.Debug("result: 'success'");
            }
            catch (System.Exception e)
            {
                // error
                log.Error(e.ToString());

                throw;
            }
        }
Exemplo n.º 3
0
        public void UpdateTeam(TeamDTO dto)
        {
            try
            {
                //Requires.NotNull(t);
                //Requires.PropertyNotNegative(t, "TeamId");

                log.Debug(TeamDTO.FormatTeamDTO(dto));

                R_Team t = TeamDTO.ConvertDTOtoEntity(dto);

                // update
                Repository.UpdateTeam(t);

                log.Debug("result: 'success'");
            }
            catch (System.Exception e)
            {
                // error
                log.Error(e.ToString());

                throw;
            }
        }