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

            try
            {
                log.Debug(SupplierDTO.FormatSupplierDTO(dto));

                R_Supplier t = SupplierDTO.ConvertDTOtoEntity(dto);

                // add
                id             = Repository.AddSupplier(t);
                dto.SupplierId = id;

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

                throw;
            }

            return(id);
        }
コード例 #2
0
        public void DeleteSupplier(SupplierDTO dto)
        {
            try
            {
                log.Debug(SupplierDTO.FormatSupplierDTO(dto));

                R_Supplier t = SupplierDTO.ConvertDTOtoEntity(dto);

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

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

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

                log.Debug(SupplierDTO.FormatSupplierDTO(dto));

                R_Supplier t = SupplierDTO.ConvertDTOtoEntity(dto);

                // update
                Repository.UpdateSupplier(t);

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

                throw;
            }
        }