Пример #1
0
        public int AddPartnershipType(PartnershipTypeDTO dto)
        {
            int id = 0;

            try
            {
                log.Debug(PartnershipTypeDTO.FormatPartnershipTypeDTO(dto));

                R_PartnershipType t = PartnershipTypeDTO.ConvertDTOtoEntity(dto);

                // add
                id = Repository.AddPartnershipType(t);
                dto.PartnershipTypeId = id;

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

                throw;
            }

            return(id);
        }
Пример #2
0
        public void DeletePartnershipType(PartnershipTypeDTO dto)
        {
            try
            {
                log.Debug(PartnershipTypeDTO.FormatPartnershipTypeDTO(dto));

                R_PartnershipType t = PartnershipTypeDTO.ConvertDTOtoEntity(dto);

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

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

                throw;
            }
        }
Пример #3
0
        public void UpdatePartnershipType(PartnershipTypeDTO dto)
        {
            try
            {
                //Requires.NotNull(t);
                //Requires.PropertyNotNegative(t, "PartnershipTypeId");

                log.Debug(PartnershipTypeDTO.FormatPartnershipTypeDTO(dto));

                R_PartnershipType t = PartnershipTypeDTO.ConvertDTOtoEntity(dto);

                // update
                Repository.UpdatePartnershipType(t);

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

                throw;
            }
        }