Example #1
0
 private void UpdatePersonAccess(int buildingId, int total, int failed, PersonAccess personTran)
 {
     personTran.NumberFail  = failed;
     personTran.NumberPass  = total - failed;
     personTran.NumberTotal = total;
     _personTrackingService.UpdatePersonTracking(personTran);
     log.Info($"Update BuildingId:{buildingId},NumberPass:{total - failed},NumberFail:{failed},TranDate:{personTran.TranDate.ToShortTimeString()}");
 }
Example #2
0
        public ActionResult <PersonAccess> Put(PersonAccess p)
        {
            if ((p.BuildingId == 0) || (p.NumberTotal == 0) || (p.TranDate.Year == 1))
            {
                return(BadRequest());
            }
            var p1 = _personTrackingService.GetPersonTrackingByTranDate(p.BuildingId.Value, p.TranDate);

            if (p1 == null)
            {
                _logger.LogInformation($"Update Not found BuildingId:{p.BuildingId},TranDate:{p.TranDate.ToLongDateString()}");
            }

            _personTrackingService.UpdatePersonTracking(p);
            _logger.LogInformation($"Update BuildingId:{p.BuildingId},NumberPass:{p.NumberTotal - p.NumberFail},NumberFail:{p.NumberFail},TranDate:{p.TranDate.ToLongDateString()}");

            return(p);
        }