Пример #1
0
 public void SaveData()
 {
     using (var context = new MedicalDataManagerDataBaseContainer())
     {
         Token newToken = new Token();
         newToken.Person_Id = SelectedPerson.Id;
         newToken.Id        = int.Parse(TokenId);
         context.Tokens.Add(newToken);
         context.SaveChanges()
         ;
     }
 }
        public void SaveAction(int actionid, string payload, DateTime timeStamp, string devUid)
        {
            int token = DecryptPayload(payload);

            using (var context = new MedicalDataManagerDataBaseContainer())
            {
                Action act = new Action();
                act.ActionTypeId = actionid;
                act.DeviceId     = devUid;
                act.Payload      = payload;
                act.TimeStamp    = timeStamp;
                act.TokenId      = token;
                context.Actions.Add(act);
                context.SaveChanges();
            }
        }