Exemplo n.º 1
0
        /// <summary>
        /// Binds To and From Selects to show available and selected Contacts
        /// </summary>
        protected void BindContactsData()
        {
            ProjectManagementDa da = new ProjectManagementDa();

            unassociatedContact = da.GetAllUnassignedContacts(projectId).DefaultView;
            associatedContacts  = da.GetProjectContactsByProjectId(projectId).DefaultView;

            FromContactsOrgRptr.DataSource = da.GetProjectOrganizationsByProjectId(projectId).DefaultView;
            FromContactsOrgRptr.DataBind();

            ToContactsOrgRptr.DataSource = da.GetProjectOrganizationsByProjectId(projectId).DefaultView;
            ToContactsOrgRptr.DataBind();
        }
        /// <summary>
        /// Bind grid to exitsing orgs for project
        /// </summary>
        protected void BindOrganizationData()
        {
            ProjectManagementDa da = new ProjectManagementDa();

            // Set global views used for bind grid and dropdowns
            associatedOrgs = da.GetProjectOrganizationsByProjectId(projectId).DefaultView;
            // Insert helper column for sorting associated organizations
            string     helpSortCol = "TempSortCol";
            DataColumn bob         = new DataColumn(helpSortCol);

            bob.DefaultValue = 1;
            associatedOrgs.Table.Columns.Add(bob);
            foreach (DataRow row in associatedOrgs.Table.Rows)
            {
                row[helpSortCol] = 0;
            }
            associatedOrgs.Sort = helpSortCol + " ASC," + ProjectOrganization.Name + " ASC";

            // Unassociated organizations should also be sorted by name
            unAssociatedOrgs      = da.GetAllProjectOrganizationsExcludingProject(projectId).DefaultView;
            unAssociatedOrgs.Sort = ProjectOrganization.Name + " ASC";

            AssociatedOrgsGrid.DataSource = associatedOrgs;
            AssociatedOrgsGrid.DataBind();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates child ProjectStage, ProjectStageEvents and ProjectEventAttributes records
        /// based off of child/parent Lookup scheme.
        /// NOTE: Child records will not be created if any ProjectStage records exists.
        /// </summary>
        /// <param name="projBiz"></param>
        private static void CreateProjectRecords(Project projBiz)
        {
            int projectId = int.Parse(projBiz[Project.ProjectId].ToString());

            ProjectManagementDa m  = new ProjectManagementDa();
            DataTable           dt = m.GetProjectOrganizationsByProjectId(projectId);

            CreateProjectStagesRecords(projBiz, dt);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets the DataSource for Organizations. Returns a list filtered
        /// by Project if records exits.
        /// </summary>
        /// <param name="sortExpr">Optional sort expression</param>
        /// <returns>A view of the Organizations List</returns>
        private DataView GetOrgDataSource(string sortExpr)
        {
            DataView dataSource = new DataView();

            if (projectId != -1)
            {
                ProjectManagementDa projDA = new ProjectManagementDa();
                DataTable           dt     = projDA.GetProjectOrganizationsByProjectId(projectId);
                dataSource = dt.DefaultView;
            }
            else
            {
                //ProjectOrganization biz = new ProjectOrganization();
                //biz.GetAll();
                //dataSource = biz.DataSourceView;
                dataSource = BusinessObject.GetAllAsDataView <ProjectOrganization>();
            }
            dataSource.Sort = sortExpr;
            return(dataSource);
        }