Esempio n. 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (patientView.SelectedItems.Count == 0 || Streams.SelectedItems.Count == 0)
            {
                return;
            }


            PatientChain patientChain = new PatientChain();

            var config     = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            var privatekey = config.AppSettings.Settings["privkey"].Value;

            patientChain.SetChainData(new PatientChain.ParameterClass
            {
                DataToStore = ToevoegingInStream.Text,
                Streamname  = Streams.SelectedItems[0].SubItems[1].Text.Replace("-items", string.Empty) + "-" + type.Text,
                PhysicianId = docId.Text,
                Signature   = patientChain.SignMessage(privatekey, docId.Text),
                Address     = config.AppSettings.Settings["address"].Value,
                PatientId   = patientView.SelectedItems[0].SubItems[2].Text
            });
        }
        public string SetContentData(DataItemToStore request)
        {
            bool reply;

            var contentData = new ContentData();

            PatientChain patientChain = new PatientChain();

            //var reply =
            patientChain.SetChainData(new PatientChain.ParameterClass
            {
                Streamname  = request.StreamName,
                PhysicianId = request.ContentId,
                DataToStore = request.DataToStore,
                Signature   = request.Signature,
                Address     = request.Address,
                PatientId   = request.PatientId
            });

            reply = true;

            return(reply ? "{ \"Result\": \"Ok\" }" : "{ \"Result\": \"Failure\" }");
        }