コード例 #1
0
        public int AddContributionChannel(ContributionChannelDTO dto)
        {
            int id = 0;

            try
            {
                log.Debug(ContributionChannelDTO.FormatContributionChannelDTO(dto));

                R_ContributionChannel t = ContributionChannelDTO.ConvertDTOtoEntity(dto);

                // add
                id = Repository.AddContributionChannel(t);
                dto.ContributionChannelId = id;

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

                throw;
            }

            return(id);
        }
コード例 #2
0
        public void DeleteContributionChannel(ContributionChannelDTO dto)
        {
            try
            {
                log.Debug(ContributionChannelDTO.FormatContributionChannelDTO(dto));

                R_ContributionChannel t = ContributionChannelDTO.ConvertDTOtoEntity(dto);

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

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

                throw;
            }
        }
コード例 #3
0
        public void UpdateContributionChannel(ContributionChannelDTO dto)
        {
            try
            {
                //Requires.NotNull(t);
                //Requires.PropertyNotNegative(t, "ContributionChannelId");

                log.Debug(ContributionChannelDTO.FormatContributionChannelDTO(dto));

                R_ContributionChannel t = ContributionChannelDTO.ConvertDTOtoEntity(dto);

                // update
                Repository.UpdateContributionChannel(t);

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

                throw;
            }
        }