public IHttpActionResult Get(int id)
 {
     //string accessType = "CheckIn_ViewAll";
     //ThrowIfUserHasNoRole(accessType);
     using (CheckInQuery checkInQuery = new CheckInQuery(Db))
     {
         var data = checkInQuery.GetByPrimaryKey(id);
         SaveLog("CheckIn", "Get", JsonConvert.SerializeObject(new { primaryKey = id }));
         return(Ok(new SuccessResponse(data)));
     }
 }
Exemplo n.º 2
0
        private CheckInEntryModel GetUpdateStateModel(int checkInPK)
        {
            CheckInEntryFormData formData     = new CheckInEntryFormData();
            List <Control>       formControls = CreateFormControls(checkInPK);
            CheckInDTO           checkInDTO   = checkInQuery.GetByPrimaryKey(checkInPK);

            if (checkInDTO == null)
            {
                throw new KairosException($"Record with primary key '{checkInDTO.CheckIn_PK}' is not found.");
            }

            return(new CheckInEntryModel()
            {
                FormData = formData,
                FormControls = formControls,
                Model = checkInDTO,
            });
        }