Exemple #1
0
        public void Init(CMSViewAdapter viewAdapter)
        {
            this.viewAdapter = viewAdapter;
            this.idConfig    = viewAdapter.IdentificationConfig;
            this.logConfig   = viewAdapter.LogConfig;

            adultConsentControl              = new AdultConsentControl();
            adultConsentControl.IdConfig     = idConfig;
            adultConsentControl.AgreeClick  += new EventHandler(adultConsentControl_AgreeClick);
            adultConsentControl.GoBackClick += new EventHandler(adultConsentControl_GoBackClick);

            idControl              = new IdentificationControl();
            idControl.IdConfig     = idConfig;
            idControl.OkClick     += new EventHandler(idControl_OkClick);
            idControl.CancelClick += new EventHandler(idControl_CancelClick);

            loggingControl = new LoggingControl();
            loggingControl.Init();
            loggingControl.OkClick           += new EventHandler(loggingControl_OkClick);
            loggingControl.PersonalInfoClick += new EventHandler(loggingControl_PersonalInfoClick);
            loggingControl.ViewConsentClick  += new EventHandler(loggingControl_ViewConsentClick);
            loggingControl.ViewAdapter        = viewAdapter;
            loggingControl.LoadControls();

            childConsentControl              = new ChildAssentControl();
            childConsentControl.AgreeClick  += new EventHandler(childConsentControl_AgreeClick);
            childConsentControl.GoBackClick += new EventHandler(childConsentControl_GoBackClick);
            childConsentControl.IdConfig     = idConfig;

            parentConsentControl              = new ParentConsentControl();
            parentConsentControl.AgreeClick  += new EventHandler(parentConsentControl_AgreeClick);
            parentConsentControl.GoBackClick += new EventHandler(parentConsentControl_GoBackClick);
            parentConsentControl.IdConfig     = idConfig;

            researchControl             = new ParticipationRequestControl();
            researchControl.AgreeClick += new EventHandler(researchControl_AgreeClick);

            LoggingInfoState state = CurState;

            if (state.Equals(LoggingInfoState.None))
            {
                SetPage(LoggingInfoCurPage.ResearchIntroPage);
            }
            else if (state.Equals(LoggingInfoState.PersonalInfoEntered))
            {
                SetPage(LoggingInfoCurPage.PersonalIdPage);
            }
            else if (state.Equals(LoggingInfoState.HasConsent))
            {
                SetPage(LoggingInfoCurPage.LogginPage);
            }
        }
Exemple #2
0
 public static void Init(CMSLogConfig logConfig, CMSIdentificationConfig idConfig)
 {
     logger           = new CMSLogger();
     logger.LogConfig = logConfig;
     logger.IdConfig  = idConfig;
     System.Collections.IDictionary environment = Environment.GetEnvironmentVariables();
     if (environment.Contains("DateTimeSendPeriod"))
     {
         long sendPeriod = Int32.Parse(Environment.GetEnvironmentVariables()["DateTimeSendPeriod"] as string);
         logger.DateTimeStampWaitPeriodMillis = sendPeriod;
     }
     if (environment.Contains("NeverConnect"))
     {
         bool neverConnect = Boolean.Parse(Environment.GetEnvironmentVariables()["NeverConnect"] as string);
         logger.NeverConnect = neverConnect;
     }
     logger.Update();
 }
 public void UpdateIdentificationConfig(CMSIdentificationConfig idConfig)
 {
     FirstName             = idConfig.FirstName;
     LastName              = idConfig.LastName;
     Email                 = idConfig.Email;
     City                  = idConfig.City;
     StateProvince         = idConfig.StateProvince;
     Country               = idConfig.Country;
     AgeGroup              = idConfig.AgeGroup;
     ConsentAdultSignature = idConfig.ConsentAdultSignature;
     ConsentAdultWitness   = idConfig.ConsentAdultWitness;
     //ConsentAdultWitnessRelationship = idConfig.ConsentAdultWitnessRelationship;
     ConsentAdultDate                = idConfig.ConsentAdultDate;
     ConsentChildWitness             = idConfig.ConsentChildWitness;
     ConsentChildWitnessRelationship = idConfig.ConsentChildWitnessRelationship;
     ConsentChildDate                = idConfig.ConsentChildDate;
     ConsentParentDate               = idConfig.ConsentParentDate;
     ConsentParentSignature          = idConfig.ConsentParentSignature;
     Condition = idConfig.Condition;
     NotStudy  = idConfig.NotStudy;
 }
        public CMSIdentificationConfig Clone()
        {
            CMSIdentificationConfig idConfig = new CMSIdentificationConfig();

            //idConfig.NickName = NickName;
            idConfig.FirstName                       = FirstName;
            idConfig.LastName                        = LastName;
            idConfig.Email                           = Email;
            idConfig.City                            = City;
            idConfig.StateProvince                   = StateProvince;
            idConfig.Country                         = Country;
            idConfig.AgeGroup                        = AgeGroup;
            idConfig.ConsentAdultSignature           = ConsentAdultSignature;
            idConfig.ConsentAdultWitness             = ConsentAdultWitness;
            idConfig.ConsentAdultDate                = ConsentAdultDate;
            idConfig.ConsentChildWitness             = ConsentChildWitness;
            idConfig.ConsentChildWitnessRelationship = ConsentChildWitnessRelationship;
            idConfig.ConsentChildDate                = ConsentChildDate;
            idConfig.ConsentParentSignature          = ConsentParentSignature;
            idConfig.ConsentParentDate               = ConsentParentDate;
            idConfig.Condition                       = Condition;
            idConfig.NotStudy                        = NotStudy;
            return(idConfig);
        }
Exemple #5
0
        private void LoadIdConfig()
        {
            bool generateFile = true;

            if (File.Exists(idConfigFile))
            {
                try
                {
                    generateFile = false;
                    TextReader    tr    = new StreamReader(idConfigFile);
                    XmlSerializer xmSer = new XmlSerializer(typeof(CMSIdentificationConfig));
                    idConfig = (CMSIdentificationConfig)xmSer.Deserialize(tr);

                    tr.Close();
                }
                catch
                {
                    generateFile = true;
                    try
                    {
                        File.Delete(idConfigFile);
                    }
                    catch
                    {
                    }
                }
            }

            if (generateFile)
            {
                idConfig = new CMSIdentificationConfig();

                try
                {
                    FileStream    fs    = new FileStream(idConfigFile, FileMode.Create, FileAccess.ReadWrite, FileShare.Delete | FileShare.ReadWrite);
                    TextWriter    tw    = new StreamWriter(fs);
                    XmlSerializer xmSer = new XmlSerializer(typeof(CMSIdentificationConfig));
                    xmSer.Serialize(tw, idConfig);
                    tw.Close();
                }
                catch
                {
                }
            }

            if (idConfig != null)
            {
                if (Environment.GetEnvironmentVariables().Contains("NotStudy"))
                {
                    try
                    {
                        idConfig.NotStudy = Boolean.Parse(Environment.GetEnvironmentVariables()["NotStudy"] as string);
                    }
                    catch
                    {
                    }
                }
                else
                {
                    idConfig.NotStudy = false;
                }
            }
        }