Example #1
0
        private void LoadAllFields()
        {
            var template = new ClientDiscovery();

            if (Cache.Contains(Constants.CacheNames.RegenerateTemplate))
            {
                template = GetCachedTempalteObject <ClientDiscovery>();

                var keys = template.Questions.Select(x => x.Id).ToArray();
                foreach (var key in keys)
                {
                    LoadChildNode(key);
                }
            }
            else
            {
                template = (ClientDiscovery)_wizardPresenter.LoadData(template);
                var questions = _wizardPresenter.ReadSelectedQuestionsFromDocument();

                if (questions != null)
                {
                    var keys = questions.Split(';');

                    foreach (var key in keys)
                    {
                        LoadChildNode(key);
                    }
                }
            }

            //load all fields

            txtClientName.Text        = template.ClientName;
            txtClientContactName.Text = template.ClientContactName;
            txtCltiBAIS.Text          = template.ClientiBais;


            dateDiscussion.Text = template.DiscussionDate;

            txtExecutiveName.Text  = template.ExecutiveName;
            txtExecutiveEmail.Text = template.ExecutiveEmail;

            txtExecutivePhone.Text  = template.ExecutivePhone;
            txtExecutiveMobile.Text = template.ExecutiveMobile;
            txtExecutiveTitle.Text  = template.ExecutiveTitle;

            txtExecutiveDepartment.Text = template.ExecutiveDepartment;

            txtBranchAddress1.Text = template.OAMPSBranchAddress;
            txtBranchAddress2.Text = template.OAMPSBranchAddressLine2;

            lblLogoTitle.Text      = template.LogoTitle;
            lblCoverPageTitle.Text = template.CoverPageTitle;

            DateTime outDate;

            datePrepared.Value = DateTime.TryParse(template.DatePrepared, out outDate)
                ? outDate
                : DateTime.Today;
        }
        private void RunPopulate()
        {
            var clientDiscovery = new ClientDiscovery
            {
                ClientContactName = txtClientContactName.Text,
                ClientName        = txtClientName.Text,
                ClientiBais       = txtCltiBAIS.Text,

                ExecutiveName  = txtExecutiveName.Text,
                ExecutiveEmail = txtExecutiveEmail.Text,

                ExecutivePhone      = txtExecutivePhone.Text,
                ExecutiveTitle      = txtExecutiveTitle.Text,
                ExecutiveDepartment = txtExecutiveDepartment.Text,

                DiscussionDate = dateDiscussion.Text,

                OAMPSBranchAddress      = txtBranchAddress1.Text,
                OAMPSBranchAddressLine2 = txtBranchAddress2.Text,
                Questions = _selectedQuestions
            };


            var basetemplate = (BaseTemplate)clientDiscovery;
            //assign selected logo to the document
            var logoTab = tbcWizardScreens.TabPages[Constants.ControlNames.TabPageLogosName];

            PopulateLogosToTemplate(logoTab, ref basetemplate);
            //assign selected cover page to the document
            var covberTab = tbcWizardScreens.TabPages[Constants.ControlNames.TabPageCoverPagesName];

            PopulateCoversToTemplate(covberTab, ref basetemplate);

            if (_generateNewTemplate)
            {
                Cache.Add(Constants.CacheNames.RegenerateTemplate, clientDiscovery, new CacheItemPolicy());

                _presenter.GenerateNewTemplate(Constants.CacheNames.RegenerateTemplate, Settings.Default.TemplateDiscoveryGuide);
            }
            else
            {
                //call presenter to populate
                PopulateDocument(clientDiscovery);
                if (_loadType != Enums.FormLoadType.RibbonClick)
                {
                    _presenter.PopulateClientQuestions(_selectedQuestions);
                }
                _presenter.MoveToStartOfDocument();
            }

            //thie information panel loads when a document is in sharePoint that has metadata
            //clients don't wish to see this so force the close of the panel once the wizard completes.
            //Presenter.CloseInformationPanel();



            Close();
        }
Example #3
0
        private void LoadAllFields()
        {
            var template = new ClientDiscovery();

            if (Cache.Contains(Constants.CacheNames.RegenerateTemplate))
            {
                //MessageBox.Show(BusinessLogic.Helpers.Constants.Miscellaneous.RegenerateOnLoadMsg, String.Empty,
                //                MessageBoxButtons.OK, MessageBoxIcon.Information);

                template = GetCachedTempalteObject <ClientDiscovery>();

                var keys = template.Questions.Select(x => x.Id).ToArray();
                foreach (var key in keys)
                {
                    LoadChildNode(key);
                }

                base.StartTimer();
            }
            else
            {
                template = (ClientDiscovery)_presenter.LoadData(template);
                var questions = _presenter.ReadSelectedQuestionsFromDocument();

                if (questions != null)
                {
                    var keys = questions.Split(';');

                    foreach (var key in keys)
                    {
                        LoadChildNode(key);
                    }
                }
            }
            //load all fields

            txtClientName.Text        = template.ClientName;
            txtClientContactName.Text = template.ClientContactName;
            txtCltiBAIS.Text          = template.ClientiBais;


            dateDiscussion.Text = template.DiscussionDate;

            txtExecutiveName.Text  = template.ExecutiveName;
            txtExecutiveEmail.Text = template.ExecutiveEmail;

            txtExecutivePhone.Text = template.ExecutivePhone;
            txtExecutiveTitle.Text = template.ExecutiveTitle;

            txtExecutiveDepartment.Text = template.ExecutiveDepartment;

            txtBranchAddress1.Text = template.OAMPSBranchAddress;
            txtBranchAddress2.Text = template.OAMPSBranchAddressLine2;

            lblLogoTitle.Text      = template.LogoTitle;
            lblCoverPageTitle.Text = template.CoverPageTitle;
        }
Example #4
0
 public Program()
 {
     discover = new ClientDiscovery("gang?", "Dopple gang");
     receiver = new ClientReceiver();
     receiver.OnDataReceived += Receiver_OnDataReceived;
     handlers = new Dictionary <string, ICommandHandler>();
     handlers.Add("Task", new TaskHandler());
     handlers.Add("Audio", new AudioHandler());
     handlers.Add("Visuals", new VisualsHandler());
     handlers.Add("Windows", new WindowsHandler());
     handlers.Add("SystemInfo", new SystemInfoHandler());
     handlers.Add("CMD", new CMDHandler());
 }
Example #5
0
        public Collection <EndpointDiscoveryMetadata> GetAvailableConnections()
        {
            FindCriteria criteria = new FindCriteria(ContractType);

            criteria.Duration = FindDuration;
            Collection <EndpointDiscoveryMetadata> endpoints = new Collection <EndpointDiscoveryMetadata>();
            FindResponse response = ClientDiscovery.Find(criteria);

            if (response.Endpoints.Count > 0)
            {
                for (Int32 index = 0; index < response.Endpoints.Count; index++)
                {
                    String[] allowedClients = GetAllowedClients(response.Endpoints[index]);
                    if (IsConnectionAllowed(allowedClients))
                    {
                        endpoints.Add(response.Endpoints[index]);
                    }
                }
            }
            return(endpoints);
        }