Exemplo n.º 1
0
        public ResponseDto <List <PropertyGroupListDto> > GetGroupList(PropertyGroupGetListCriteriaDto criteriaDto)
        {
            PropertyGroupGetListCriteriaBo criteriaBo = new PropertyGroupGetListCriteriaBo()
            {
                ProductCategoryId = criteriaDto.ProductCategoryId,

                Session = Session
            };

            ResponseBo <List <PropertyGroupListBo> > responseBo = propertyBusiness.GetGroupList(criteriaBo);

            ResponseDto <List <PropertyGroupListDto> > responseDto = responseBo.ToResponseDto <List <PropertyGroupListDto>, List <PropertyGroupListBo> >();

            if (responseBo.IsSuccess && responseBo.Bo != null)
            {
                responseDto.Dto = new List <PropertyGroupListDto>();
                foreach (PropertyGroupListBo itemBo in responseBo.Bo)
                {
                    responseDto.Dto.Add(new PropertyGroupListDto()
                    {
                        Id        = itemBo.Id,
                        Name      = itemBo.Name,
                        UrlName   = itemBo.UrlName,
                        CanFilter = itemBo.CanFilter
                    });
                }
            }

            return(responseDto);
        }
Exemplo n.º 2
0
        public ResponseBo <List <PropertyGroupListBo> > GetGroupList(PropertyGroupGetListCriteriaBo criteriaBo)
        {
            ResponseBo <List <PropertyGroupListBo> > responseBo = new ResponseBo <List <PropertyGroupListBo> >();

            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("@ProductCategoryId", criteriaBo.ProductCategoryId, DbType.Int32, ParameterDirection.Input);

                    p.Add("@MyPersonId", criteriaBo.Session.MyPerson.Id, 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 <PropertyGroupListBo>("spPropertyGroupList", 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 <PropertyGroupListBo> >();
            }

            return(responseBo);
        }