public IActionResult Add([FromBody] EntryLogViewModel viewModel)
        {
            viewModel.UserId = this.UserId;
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            entryLogAppService.Create(viewModel);

            return(Ok());
        }
        public IActionResult Edit([FromBody] EntryLogViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            viewModel.UserId = this.UserId;
            entryLogAppService.Update(viewModel);

            return(Ok());
        }
示例#3
0
        public void Entry([FromBody] EntryLogViewModel entryLog)
        {
            LogEntry(entryLog);
            var storedPlate = storedPlateService.Get(s => s.Plate == entryLog.Plate).FirstOrDefault();

            if (storedPlate != null && storedPlate.AutoOpen)
            {
                OpenGate();
            }
            else
            {
                firebaseService.SendMessage(entryLog.Plate);
            }
        }
示例#4
0
 private void LogEntry(EntryLogViewModel entryLog)
 {
     entryLogService.Insert(entryLog);
 }
        public void Update(EntryLogViewModel entryLogViewModel)
        {
            var addCommand = mapper.Map <UpdateEntryLogCommand>(entryLogViewModel);

            mediatorHandler.SendCommand(addCommand);
        }