Beispiel #1
0
 /// <summary>
 /// The GetEquipment
 /// </summary>
 /// <param name="id">The id<see cref="int"/></param>
 /// <returns>The <see cref="ServiceResult"/></returns>
 public ServiceResult GetEquipment(int id)
 {
     return(new ServiceResult(true)
     {
         Data = _repository.Get(x => x.Identifier == id)
     });
 }
        public async Task <ApiResult <Equipment> > GetAsync(int Id)
        {
            _logger.LogInformation(_localizer["LogMethodCalled", "api/Equipment/Get"]);
            ApiResult <Equipment> response = await _equipmentRepository.Get(Id);

            _logger.LogInformation(_localizer["LogMethodResult", "api/Equipment/Get", response.Deserialize()]);
            return(response);
        }
Beispiel #3
0
        public Room GetEager(long id)
        {
            Room room = base.Get(id);

            room.RoomType = _roomTypeRepository.Get(room.RoomType.GetId());

            foreach (KeyValuePair <Equipment, int> pair in room.Equipment_inventory)
            {
                Equipment temp = _equipmentRepository.Get(pair.Key.Id);
                pair.Key.Name   = temp.Name;
                pair.Key.Type   = temp.Type;
                pair.Key.Amount = temp.Amount;
            }
            return(room);
        }
        public async Task <IActionResult> CreateNew(Equipment equip)
        {
            equip.EquipmentId = util.RandomString(8);
            Equipment check;

            do
            {
                check = null;
                check = equipment.Get(equip.EquipmentId);
            }while (check != null);
            equip.EquipmentSercurityCode = util.RandomString(10);
            equip.CreateDate             = DateTime.Now;
            equip.Username = HttpContext.Session.GetString("adminName");

            equipment.Add(equip);
            await equipmentGroup.SaveChangesAsync();

            if (equip.Type == 2)
            {
                string url = "https://feedbackwebqr.azurewebsites.net/" + "Home/GetFeedback?equipmentId=" + equip.EquipmentId;
                return(RedirectToAction("ShowQR", new { qrText = url }));
            }
            return(RedirectToAction("ShowAll"));
        }
Beispiel #5
0
 public IEnumerable <GetEquipmentsQuery> Get()
 {
     return(_repository.Get());
 }
Beispiel #6
0
 public void TestGet()
 {
     _repo.Get(1);
     _mockSet.Verify(m => m.Find(It.IsAny <object[]>()));
 }
 public IHttpActionResult Get(int id)
 {
     return(Json(equipmentRepository.Get(id)));
 }
 public Equipment Get(long id)
 {
     return(_repository.Get(id));
 }