Ejemplo n.º 1
0
        public ResponseDto <PersonTableDto> Get(PersonTableGetCriteriaDto criteriaDto)
        {
            PersonTableGetCriteriaBo criteriaBo = new PersonTableGetCriteriaBo()
            {
                Id = criteriaDto.Id,

                Session = Session
            };

            ResponseBo <PersonTableBo> responseBo = personTableBusiness.Get(criteriaBo);

            ResponseDto <PersonTableDto> responseDto = responseBo.ToResponseDto <PersonTableDto, PersonTableBo>();

            if (responseBo.IsSuccess && responseBo.Bo != null)
            {
                responseDto.Dto = new PersonTableDto()
                {
                    Id = responseBo.Bo.Id,

                    GroupId = responseBo.Bo.GroupId,

                    Name = responseBo.Bo.Name,
                    PersonTableStatId = responseBo.Bo.PersonTableStatId,
                    Order             = responseBo.Bo.Order,
                    Notes             = responseBo.Bo.Notes
                };
            }

            return(responseDto);
        }
Ejemplo n.º 2
0
        public ResponseBo <PersonTableBo> Get(PersonTableGetCriteriaBo criteriaBo)
        {
            ResponseBo <PersonTableBo> responseBo = new ResponseBo <PersonTableBo>();

            try
            {
                using (SqlConnection conn = DbAccess.Connection.GetConn())
                {
                    var p = new DynamicParameters();
                    base.AddStandartSpParams(ref p, criteriaBo);

                    p.Add("@Id", criteriaBo.Id, DbType.Int64, ParameterDirection.Input);

                    responseBo.Bo        = conn.Query <PersonTableBo>("spPersonTableGet", p, commandType: CommandType.StoredProcedure).FirstOrDefault();
                    responseBo.Message   = p.Get <string>("@Message");
                    responseBo.IsSuccess = p.Get <bool>("@IsSuccess");
                }
            }
            catch (Exception ex)
            {
                responseBo = base.SaveExLog(ex, this.GetType(), MethodBase.GetCurrentMethod().Name, criteriaBo).ToResponse <PersonTableBo>();
            }

            return(responseBo);
        }