示例#1
0
        public async void GetAllOffers()
        {
            var result = await _service.GetAll();

            foreach (var offer in result)
            {
                _offers.Add(offer);
            }
        }
示例#2
0
 // GET: api/Offer
 public IHttpActionResult Get(int status = 0, int idBuyer = 0)
 {
     if (idBuyer > 0)
     {
         return(Ok(offerService.GetToABuyerByStatus(idBuyer, status)));
     }
     else
     {
         return(Ok(offerService.GetAll(status)));
     }
 }
示例#3
0
        public async void LoadFromWeb()
        {
            var result = await _service.GetAll();

            //_aserivce.Register(new RegisterBindingModel
            //{
            //    Email = "*****@*****.**",
            //    Password = "******",
            //    ConfirmPassword = "******"

            //});

            _aserivce.Login(new LoginBindingModel
            {
                grant_type = "password",
                Username   = "******",
                Password   = "******"
            });


            foreach (var item in result)
            {
                _offers.Add(new Offer
                {
                    OfferId   = item.OfferId,
                    Title     = item.Title,
                    Location  = item.Location,
                    StartTime = item.StartTime,
                    EndTime   = item.EndTime
                });
            }
        }