Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        protected void SetOrganizationLevelView(int orgId)
        {
            // Load record from BusinessObject
            ProjectOrganization org = new ProjectOrganization();

            org.Get(orgId);
            // Set Heading And Hide Grid
            OrgHeading.Text           = "Organization";
            OrganizationsGrid.Visible = false;
            ContactsGrid.Visible      = false;

            OrgAddress.Visible = true;
            // Set Address
            OrgName.Text      = org[ProjectOrganization.Name].ToString();
            OrgShortName.Text = org[ProjectOrganization.ShortName].ToString();
            OrgAddress1.Text  = org[ProjectOrganization.Address1].ToString();
            OrgAddress2.Text  = org[ProjectOrganization.Address2].ToString();
            OrgCity.Text      = org[ProjectOrganization.City].ToString();
            OrgState.Text     = org[ProjectOrganization.State].ToString();
            OrgPostal.Text    = org[ProjectOrganization.PostalCode].ToString();

            ProjectManagementDa da = new ProjectManagementDa();
            // Filter list of contacts in this project by this organization
            DataView orgsContacts = da.GetAllContactsWithOrgNameByProjectId(projectId).DefaultView;

            orgsContacts.RowFilter     = ProjectOrganization.OrganizationId + " = " + OrganizationId;
            OrgContactsRptr.DataSource = orgsContacts;
            OrgContactsRptr.DataBind();
        }
Exemplo n.º 2
0
        protected void ViewAllButton_Click(object sender, ImageClickEventArgs e)
        {
            projectId = -1;

            ProjectManagementDa projDA = new ProjectManagementDa();

            ContactsGrid.DataSource = CombineRows(projDA.GetAllContactsWithOrgNameByProjectId(projectId), "organization");
            ContactsGrid.DataBind();
        }
Exemplo n.º 3
0
 public ProjectCommunicationLogDetails()
     : base()
 {
     // set project id
     this.Load += (a, b) =>
     {
         projectId = int.Parse(ProjectId);
         // fill lists
         AllContacts      = da.GetAllContactsWithOrgNameByProjectId(projectId).DefaultView;
         AllOrganizations = da.GetAllOrganizationsSortedByProjectId(projectId).DefaultView;
     };
 }
Exemplo n.º 4
0
        private void LoadContactsGrid()
        {
            ProjectManagementDa projDA             = new ProjectManagementDa();
            DataTable           contactsDataSource = new DataTable();

            string     filterBy   = Request.QueryString["FilterBy"];
            ContactsDa contactsDa = new ContactsDa();

            if (isAdmin)
            {
                contactsDataSource = contactsDa.GetAllContacts();
            }
            else if (string.IsNullOrEmpty(filterBy))
            {
                if (contactType == "Project")
                {
                    contactsDataSource = CombineRows(projDA.GetAllContactsWithOrgNameByProjectId(projectId), "Organization");
                }
                else
                {
                    if (!string.IsNullOrEmpty(contactType))
                    {
                        contactsDataSource = contactsDa.GetContactByContactType(contactType);
                    }
                }
            }
            else
            {
                switch (filterBy)
                {
                case ("Organization"):
                    contactsDataSource = CombineRows(projDA.GetAllContactsByOrgId(Int32.Parse(Request.QueryString["FilterID"])), "Organization");
                    break;

                case ("Protocols"):
                    contactsDataSource = CombineRows(projDA.GetAllContactsByProtocol(Int32.Parse(Request.QueryString["FilterID"])), "Organization");
                    break;

                case ("Projects"):
                    contactsDataSource = CombineRows(projDA.GetAllContactsWithOrgNameByProjectId(Int32.Parse(Request.QueryString["FilterID"])), "Organization");
                    break;

                default:
                    break;
                }
            }

            // Bind grid to datasource
            ContactsGrid.DataSource = contactsDataSource;
            ContactsGrid.DataBind();

            // Determine if there are any records and show message
            if (contactsDataSource.Rows.Count == 0)
            {
                EmptyMessageLabel.Visible = true;
            }
            else
            {
                EmptyMessageLabel.Visible = false;
            }
        }