private Item SelectDepartmentFromOptions()
        {
            IList items        = QDepartments.SelectItems2();
            Item  selectedItem = TemplatesController.ShowListBoxOptionsForm(items, view.ParentControl);

            return(selectedItem);
        }
        private void ShowSelectedTitleComments()
        {
            ProtocolTemplate title    = GetSelectedTemplateFromView();
            IList            comments = QProtocolComments.SelectItems(title);
            IList            columns  = new ArrayList()
            {
                "Date", "User", "Comments"
            };

            TemplatesController.ShowReadOnlyListViewForm(columns, comments, view.ParentControl);
        }
        private void ShowSelectedTitleEvents()
        {
            ProtocolTemplate title   = GetSelectedTemplateFromView();
            IList            events  = QProtocolActivities.SelectItems(this.request.ID, title.TemplateID);
            IList            columns = new ArrayList()
            {
                "Date", "User", "Event"
            };

            TemplatesController.ShowReadOnlyListViewForm(columns, events, view.ParentControl);
        }
        public void ChangeContactButtonClicked()
        {
            IList items        = QMatrix.GetSponsorContacts_NameAndCodeOnly(this.request.Contact.SponsorCode);
            Item  selectedItem = TemplatesController.ShowListBoxOptionsForm(items, view.ParentControl);

            if (selectedItem.Value != "")
            {
                CheckAndAddToAuditItems("ContactCode", this.request.Contact.ContactCode, selectedItem.Value);
                this.request.SetContact(selectedItem.Value);
                UpdateViewWithSponsorContact();
            }
        }
        public void ProtocolTypeButtonClicked()
        {
            IList items        = QListItems.SelectItems(OptionFields.ProtocolType.ToString());
            Item  selectedItem = TemplatesController.ShowListBoxOptionsForm(items, view.ParentControl);

            if (selectedItem.Value != "")
            {
                CheckAndAddToAuditItems("ProtocolType", this.request.ProtocolType, selectedItem.Value);
                this.request.ProtocolType = selectedItem.Value;
                this.view.ProtocolType    = selectedItem.Value;
            }
        }
        public void ComplianceButtonClicked()
        {
            IList items        = QListItems.SelectItems(OptionFields.Compliance.ToString());
            Item  selectedItem = TemplatesController.ShowListBoxOptionsForm(items, view.ParentControl);

            if (selectedItem.Name != "")
            {
                CheckAndAddToAuditItems("Compliance", this.request.Guidelines, selectedItem.Value);
                this.request.Compliance = selectedItem.Value;
                this.view.Compliance    = selectedItem.Value;
            }
        }
        private void AddCommentsToSelectedTitle()
        {
            string popupResult = TemplatesController.ShowOneTextBoxForm("Comments: ", "",
                                                                        this.view.ParentControl);

            if (popupResult != String.Empty)
            {
                ProtocolTemplate title = GetSelectedTemplateFromView();
                QProtocolComments.InsertItem(title, popupResult, loginInfo.UserName);
                RefreshTemplateListView();
            }
        }
 private void GetSelectedSponsorRequests()
 {
     if (this.sponsors.Count != 0)
     {
         this.selectedItem = TemplatesController.ShowListBoxOptionsForm(this.sortedsponsors,
                                                                        this.view.ParentControl);
         GetRequests();
     }
     else
     {
         MessageBox.Show("No records found.");
     }
 }
        public void AssignedToButtonClicked()
        {
            IList items        = QUsers.SelectUsersByRoleID(UserRoles.DocControl);
            Item  selectedItem = TemplatesController.ShowListBoxOptionsForm(items, view.ParentControl);

            if (selectedItem.Value != "")
            {
                CheckAndAddToAuditItems("AssignedTo", this.request.AssignedTo.FullName, selectedItem.Text);
                this.request.AssignedTo.UserName = selectedItem.Value;
                this.request.AssignedTo.FullName = selectedItem.Text;
                this.view.AssignedTo             = selectedItem.Text;
            }
        }
        public void GuidelinesButtonClicked()
        {
            IList         items         = QListItems.SelectItems(OptionFields.Guidelines.ToString());
            List <string> selectedItems = TemplatesController.ShowCheckBoxOptionsForm(items, view.ParentControl);

            if (selectedItems.Count != 0)
            {
                string itemsString = String.Join(", ", selectedItems);
                CheckAndAddToAuditItems("Guidelines", this.request.Guidelines, itemsString);
                this.request.Guidelines = itemsString;
                this.view.Guidelines    = itemsString;
            }
        }
        private void UpdateSelectedTitleProjectNumber()
        {
            ProtocolTemplate title         = GetSelectedTemplateFromView();
            string           oldValue      = title.ProjectNumber;
            string           projectNumber = TemplatesController.ShowOneTextBoxForm("Project Number: ",
                                                                                    title.ProjectNumber, this.view.ParentControl);

            if (projectNumber != String.Empty)
            {
                title.AddProjectNumber(projectNumber);
                AuditHandler.Insert_ProjectNumber_AuditItem(oldValue, title, loginInfo.UserName);
                this.RefreshTemplateListView();
            }
        }
        public void ContactButtonClicked()
        {
            IList items = QMatrix.GetSponsorContacts_NameAndCodeOnly(this.request.Contact.SponsorCode);

            if (items != null)
            {
                Item selectedContact = TemplatesController.ShowListBoxOptionsForm(items, view.ParentControl);
                Debug.WriteLine(selectedContact.Text);
                Debug.WriteLine(selectedContact.Value);
                if (selectedContact != null)
                {
                    this.request.Contact.ContactName = selectedContact.Text;
                    this.request.Contact.ContactCode = selectedContact.Value;
                    this.view.ContactName            = selectedContact.Text;
                    this.request.Contact.Email       = QMatrix.GetSponsorByContactCode(selectedContact.Value).Email;
                    this.view.Email = this.request.Contact.Email;
                }
            }
            else
            {
                MessageBox.Show("There are no contacts for this sponsor!");
            }
        }