示例#1
0
        public ActionResult Circles()//+
        {
            try
            {
                ParametrsForView  p       = new ParametrsForView();
                List <CirlceView> cirlces = new List <CirlceView>();

                ParametrsForViewBll pBll = new ParametrsForViewBll()
                {
                    Page       = p.Page,
                    PageSize   = Parametrs.PageSize,
                    PartOfName = p.PartOfName
                };
                foreach (var item in _figuresService.GetAllCirlces(pBll))
                {
                    cirlces.Add(new CirlceView()
                    {
                        Id = item.Id, Name = item.Name, Radius = item.Radius
                    });
                }
                PagingInfoView pagingInfo = new PagingInfoView
                {
                    CurrentPage  = p.Page,
                    ItemsPerPage = Parametrs.PageSize,
                    TotalItems   = _figuresService.GetCirclesCount(pBll)
                };
                CirlcesView c = new CirlcesView()
                {
                    Cirlces    = cirlces,
                    PagingInfo = pagingInfo,
                };
                return(View(c));
            }
            catch (Exception ex)
            {
                return(HttpNotFound(ex.Message));
            }
        }