Ejemplo n.º 1
0
        public ResponseGetWindowPlastics GetWindowPlastics(RequestGetWindowPlastics request)
        {
            var response = new ResponseGetWindowPlastics(request?.Paging);

            var data = dbManager.GetWindowPlastics();

            var result = data.Sorting(request?.Sorting).Pagination(response.Paging).ToList();

            var cData = result.Select(t => new WindowPlasticDTO()
            {
                Id         = t.Id,
                Feature    = t.Feature,
                ImageUrl   = t.ImageUrl,
                Name       = t.Name,
                Size       = t.Size,
                TotalValue = t.Total,
                HasSetup   = t.HasSetup,
                Total      = $"{string.Format("{0:#.##}", t.Total)} {(t.HasSetup ? "с установкой" : "без установки")}",
            }).ToList();

            response.Data = cData;


            return(response);
        }
Ejemplo n.º 2
0
        public ResponseGetWindowPlastics GetWindows()
        {
            var data = dbManager.GetWindowPlastics().ToList();

            var mData = data.Select(d => new WindowPlasticDTO()
            {
                Feature    = d.Feature,
                Name       = d.Name,
                Size       = d.Size,
                Total      = $"{string.Format("{0:#.##}", d.Total)} {(d.HasSetup ? "с установкой" : "без установки")}",
                TotalValue = d.Total,
                ImageUrl   = d.ImageUrl,
            }).ToList();

            return(new ResponseGetWindowPlastics()
            {
                Data = mData
            });
        }