示例#1
0
        public int AddPlannedRoute(PlannedRouteDTO dto)
        {
            int id = 0;

            try
            {
                log.Debug(PlannedRouteDTO.FormatPlannedRouteDTO(dto));

                R_PlannedRoute t = PlannedRouteDTO.ConvertDTOtoEntity(dto);

                // add
                id = Repository.AddPlannedRoute(t);
                dto.PlannedRouteId = id;

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

                throw;
            }

            return(id);
        }
示例#2
0
        public void DeletePlannedRoute(PlannedRouteDTO dto)
        {
            try
            {
                log.Debug(PlannedRouteDTO.FormatPlannedRouteDTO(dto));

                R_PlannedRoute t = PlannedRouteDTO.ConvertDTOtoEntity(dto);

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

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

                throw;
            }
        }
示例#3
0
        public void UpdatePlannedRoute(PlannedRouteDTO dto)
        {
            try
            {
                //Requires.NotNull(t);
                //Requires.PropertyNotNegative(t, "PlannedRouteId");

                log.Debug(PlannedRouteDTO.FormatPlannedRouteDTO(dto));

                R_PlannedRoute t = PlannedRouteDTO.ConvertDTOtoEntity(dto);

                // update
                Repository.UpdatePlannedRoute(t);

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

                throw;
            }
        }