public ResponseBo <List <ApprovalRelationListBo> > GetList(ApprovalRelationGetListCriteriaBo criteriaBo)
        {
            ResponseBo <List <ApprovalRelationListBo> > responseBo = new ResponseBo <List <ApprovalRelationListBo> >();

            try
            {
                using (SqlConnection conn = DbAccess.Connection.GetConn())
                {
                    var p = new DynamicParameters();
                    p.Add("@Message", dbType: DbType.String, direction: ParameterDirection.Output, size: 255);
                    p.Add("@IsSuccess", dbType: DbType.Boolean, direction: ParameterDirection.Output);

                    p.Add("@GetIncomings", criteriaBo.GetIncomings, DbType.Boolean, ParameterDirection.Input);
                    p.Add("@MyPersonId", criteriaBo.MyPersonId, DbType.Int64, ParameterDirection.Input);

                    p.Add("@OperatorRealId", criteriaBo.Session.RealPerson.Id, DbType.Int64, ParameterDirection.Input);
                    p.Add("@LanguageId", criteriaBo.Session.RealPerson.LanguageId, DbType.Int32, ParameterDirection.Input);

                    responseBo.Bo        = conn.Query <ApprovalRelationListBo>("spApprovalRelationList", p, commandType: CommandType.StoredProcedure).ToList();
                    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 <List <ApprovalRelationListBo> >();
            }

            return(responseBo);
        }
        public ResponseDto <List <ApprovalRelationListDto> > GetList(ApprovalRelationGetListCriteriaDto criteriaDto)
        {
            ApprovalRelationGetListCriteriaBo criteriaBo = new ApprovalRelationGetListCriteriaBo()
            {
                MyPersonId   = criteriaDto.MyPersonId,
                GetIncomings = criteriaDto.GetIncomings,

                Session = Session
            };

            ResponseBo <List <ApprovalRelationListBo> > responseBo = approvalRelationBusiness.GetList(criteriaBo);

            ResponseDto <List <ApprovalRelationListDto> > responseDto = responseBo.ToResponseDto <List <ApprovalRelationListDto>, List <ApprovalRelationListBo> >();

            if (responseBo.IsSuccess && responseBo.Bo != null)
            {
                responseDto.Dto = new List <ApprovalRelationListDto>();
                foreach (ApprovalRelationListBo itemBo in responseBo.Bo)
                {
                    responseDto.Dto.Add(new ApprovalRelationListDto()
                    {
                        ApprovalRelationId = itemBo.ApprovalRelationId,

                        ParentPersonId       = itemBo.ParentPersonId,
                        ParentPersonTypeId   = itemBo.ParentPersonTypeId,
                        ParentPersonFullName = itemBo.ParentPersonFullName,

                        ChildPersonId       = itemBo.ChildPersonId,
                        ChildPersonTypeId   = itemBo.ChildPersonTypeId,
                        ChildPersonFullName = itemBo.ChildPersonFullName,

                        RelationTypeId = itemBo.RelationTypeId,

                        CreateDateNumber = itemBo.CreateDate.ToNumberFromDateTime()
                    });
                }
            }

            return(responseDto);
        }