示例#1
0
        // GET api/Areas
        public IHttpActionResult Get()
        {
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap <AreaDTO, AreaVM>()).CreateMapper();
            var result = mapper.Map <IEnumerable <AreaDTO>, IEnumerable <AreaVM> >(db.Get());

            return(Ok(result));
        }
示例#2
0
        private void SaveUpdateValidate(Seat seat, IAreaService @as)
        {
            var asAll = @as.GetAll();
            var all   = GetAll();

            if (!(from x in asAll where x.Id == seat.AreaId select x).Any())
            {
                throw new Exception("No such area");
            }
            var r = from x in asAll where x.Id == seat.AreaId select x;

            if (r.Any())
            {
                int coordX = @as.Get(seat.AreaId).CoordX;
                int coordY = @as.Get(seat.AreaId).CoordY;
                int lid    = r.First().LayoutId;
                if ((from x in asAll
                     where x.Id != seat.AreaId && x.LayoutId == lid && x.CoordX > coordX && x.CoordY > coordY &&
                     (coordX + seat.Row >= x.CoordX || coordY + seat.Number >= x.CoordY)
                     select x).Any())
                {
                    throw new Exception("Seat coords out of range");
                }
            }
        }
示例#3
0
        public ActionResult Details(int id)
        {
            Admin admin = adminService.Get(id);

            admin.AreaName = areaService.Get(admin.AreaId).AreaName;

            return(View(admin));
        }
        public ActionResult Details(int id)
        {
            Buyer buyer = buyerService.Get(id);

            buyer.AreaName = areaService.Get(buyer.AreaId).AreaName;

            return(View(buyer));
        }
示例#5
0
        public async Task <AreaDto> Get(string id)
        {
            var entity = await _areaService.Get(id);

            var result = _mapper.Map <AreaDto>(entity);

            return(result);
        }
        public async Task <IActionResult> Get(Guid areaId)
        {
            try
            {
                var result = await _areaService.Get(areaId);

                return(Ok(result));
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#7
0
        public OperationResult Get()
        {
            OperationResult result = new OperationResult();

            try
            {
                result.Data   = lArea.Get();
                result.Status = OperationStatus.SUCCESS;
            }
            catch (Exception ex)
            {
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
 public Task <AreaDto> AreaManagementGet(AreaRequestDto requestDto)
 {
     return(_areaService.Get(requestDto));
 }