Exemplo n.º 1
0
        /// <summary>
        /// Loads the bread crumbs.
        /// </summary>
        private void LoadBreadCrumbs()
        {
            BreadCrumbs bc = GetBreadCrumbsControl();

            StageBitz.Data.Project project = GetBL <Logic.Business.Project.ProjectBL>().GetProject(ProjectId);

            int    companyId   = project.Company.CompanyId;
            string companyName = project.Company.CompanyName;
            string projectName = project.ProjectName;

            if (Support.IsCompanyAdministrator(companyId))
            {
                bc.AddLink(companyName, string.Format("~/Company/CompanyDashboard.aspx?companyid={0}", companyId));
            }
            else
            {
                bc.AddLink(companyName, "");
            }

            bc.AddLink(projectName, string.Format("~/Project/ProjectDashboard.aspx?ProjectId={0}", ProjectId));
            bc.AddLink(DisplayTitle, null);
            bc.LoadControl();

            //Build Company and Project name labels
            lblCompanyName.Text = Support.TruncateString(companyName, 100);
            lblProjectName.Text = Support.TruncateString(projectName, 100);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        /// <exception cref="System.Exception">project not found</exception>
        /// <exception cref="System.ApplicationException">Permission denied for this project </exception>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["projectid"] != null)
                {
                    ProjectID = Convert.ToInt32(Request.QueryString["projectid"].ToString());
                    projectWarningPopup.ProjectId = ProjectID;

                    StageBitz.Data.Project project = (from p in DataContext.Projects
                                                      where p.ProjectId == ProjectID && p.IsActive == true
                                                      select p).FirstOrDefault();
                    if (project == null)
                    {
                        throw new Exception("project not found");
                    }

                    this.CompanyId = project.CompanyId;
                    DisplayTitle   = string.Format("{0}'s Dashboard", Support.TruncateString(project.ProjectName, 32));

                    if (!Support.CanAccessProject(project))
                    {
                        if (GetBL <ProjectBL>().IsProjectClosed(project.ProjectId))
                        {
                            StageBitzException.ThrowException(new StageBitzException(ExceptionOrigin.ProjectClose, project.ProjectId, "This Project Is Closed."));
                        }

                        throw new ApplicationException("Permission denied for this project ");
                    }

                    warningDisplay.ProjectID = ProjectID;
                    warningDisplay.LoadData();

                    ucprojectSchedules.ProjectID      = ProjectID;
                    ucprojectItemBrief.ProjectID      = ProjectID;
                    ucProjectAdministration.ProjectID = ProjectID;

                    #region SET LINKS

                    linkTaskManager.HRef     = string.Format("~/ItemBrief/TaskManager.aspx?projectid={0}", ProjectID);
                    lnkProjectDetails.HRef   = string.Format("~/Project/ProjectDetails.aspx?ProjectID={0}", ProjectID);
                    lnkCompanyInventory.HRef = string.Format("~/Inventory/CompanyInventory.aspx?companyid={0}&relatedtable={1}&relatedid={2}", project.CompanyId, (int)BookingTypes.Project, ProjectID);
                    lnkBookings.HRef         = string.Format("~/Project/ProjectBookingDetails.aspx?projectid={0}", ProjectID);
                    reportList.ShowReportLinks(string.Format("~/ItemBrief/ItemisedPurchaseReport.aspx?projectid={0}", ProjectID), string.Format("~/ItemBrief/BudgetSummaryReport.aspx?projectid={0}", ProjectID), ProjectID);
                    projectUpdatesLink.ProjectID = ProjectID;
                    projectUpdatesLink.LoadData();

                    #endregion SET LINKS

                    LoadBreadCrumbs(project.Company);
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Loads the bread crumbs.
        /// </summary>
        /// <param name="project">The project.</param>
        private void LoadBreadCrumbs(StageBitz.Data.Project project)
        {
            BreadCrumbs bc = GetBreadCrumbsControl();

            string companyUrl = Support.IsCompanyAdministrator(project.Company.CompanyId) ?
                                string.Format("~/Company/CompanyDashboard.aspx?CompanyId={0}", project.Company.CompanyId) : null;

            bc.AddLink(project.Company.CompanyName, companyUrl);

            bc.AddLink(project.ProjectName, string.Format("~/Project/ProjectDashboard.aspx?projectid={0}", project.ProjectId));
            bc.AddLink(DisplayTitle, null);
            bc.LoadControl();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        /// <exception cref="System.Exception">project not found</exception>
        /// <exception cref="System.ApplicationException">
        /// Permission denied for this project
        /// or
        /// Permission denied to this page
        /// </exception>
        protected void Page_Load(object sender, EventArgs e)
        {
            //IsLargeContentArea = true;
            if (!IsPostBack)
            {
                StageBitz.Data.Project project = (from p in DataContext.Projects
                                                  where p.ProjectId == ProjectId && p.IsActive == true
                                                  select p).FirstOrDefault();
                if (project == null)
                {
                    throw new Exception("project not found");
                }

                if (!Support.CanAccessProject(project))
                {
                    if (GetBL <ProjectBL>().IsProjectClosed(ProjectId))
                    {
                        StageBitzException.ThrowException(new StageBitzException(ExceptionOrigin.ProjectClose, project.ProjectId, "Permission denied for this project."));
                    }

                    throw new ApplicationException("Permission denied for this project ");
                }

                if (Support.IsReadOnlyRightsForProject(ProjectId, UserID, false))
                {
                    if (GetBL <ProjectBL>().IsProjectClosed(project.ProjectId))
                    {
                        StageBitzException.ThrowException(new StageBitzException(ExceptionOrigin.ProjectClose, project.ProjectId, "Permission denied for this page."));
                    }

                    throw new ApplicationException("Permission denied to this page ");
                }

                Data.Booking booking = this.GetBL <InventoryBL>().GetBooking(ProjectId, GlobalConstants.RelatedTables.Bookings.Project);
                editBookingDetails.ItemTypeId         = ItemTypeId;
                editBookingDetails.IsToDateChange     = IsToDateChange;
                editBookingDetails.BookingId          = booking.BookingId;
                editBookingDetails.IsInventoryManager = false;
                editBookingDetails.CallBackURL        = string.Format("~/Project/ProjectBookingDetails.aspx?projectid={0}", ProjectId);

                DisplayTitle = "Bookings";
                LoadBreadCrumbs(project);
                lnkCompanyInventory.HRef = string.Format("~/Inventory/CompanyInventory.aspx?companyid={0}&relatedtable={1}&relatedid={2}", project.CompanyId, (int)BookingTypes.Project, ProjectId);
                lnkBookings.HRef         = string.Format("~/Project/ProjectBookingDetails.aspx?projectid={0}", ProjectId);
                linkTaskManager.HRef     = string.Format("~/ItemBrief/TaskManager.aspx?projectid={0}", ProjectId);
                reportList.ShowReportLinks(string.Format("~/ItemBrief/ItemisedPurchaseReport.aspx?projectid={0}", ProjectId), string.Format("~/ItemBrief/BudgetSummaryReport.aspx?projectid={0}", ProjectId), ProjectId);
                projectUpdatesLink.ProjectID = ProjectId;
                projectUpdatesLink.LoadData();
            }
        }
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        /// <exception cref="System.Exception">project not found</exception>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                StageBitz.Data.Project project = (from p in DataContext.Projects
                                                  where p.ProjectId == ProjectId
                                                  select p).FirstOrDefault();
                if (project == null)
                {
                    throw new Exception("project not found");
                }

                CompanyId = project.CompanyId;
                Response.Redirect(string.Format("~/Company/CompanyFinancialDetails.aspx?companyid={0}", CompanyId));
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        /// <exception cref="System.ApplicationException">Permission denied for this project.</exception>
        protected void Page_Load(object sender, EventArgs e)
        {
            this.ExportData1.PDFExportClick   += new EventHandler(ExportData1_PDFExportClick);
            this.ExportData1.ExcelExportClick += new EventHandler(ExportData1_ExcelExportClick);
            taskList.SetTasksGridWidth(930);
            if (!IsPostBack)
            {
                StageBitz.Data.Project project = GetBL <Logic.Business.Project.ProjectBL>().GetProject(ProjectId);

                if (!Support.CanAccessProject(project))
                {
                    if (GetBL <ProjectBL>().IsProjectClosed(project.ProjectId))
                    {
                        StageBitzException.ThrowException(new StageBitzException(ExceptionOrigin.ProjectClose, project.ProjectId, "This Project Is Closed."));
                    }

                    throw new ApplicationException("Permission denied for this project.");
                }

                this.CompanyId           = project.CompanyId;
                warningDisplay.ProjectID = ProjectId;
                warningDisplay.LoadData();
                projectWarningPopup.ProjectId = ProjectId;

                bool isReadOnly = Support.IsReadOnlyRightsForProject(ProjectId);

                LoadList();
                if (ProjectId > 0)
                {
                    LoadBreadCrumbs();
                    //For observers, do not allow delete list
                    if (isReadOnly)
                    {
                        btnDeleteList.Enabled = false;
                    }
                }

                //Set links
                lnkCompanyInventory.HRef         = string.Format("~/Inventory/CompanyInventory.aspx?companyid={0}&relatedtable={1}&relatedid={2}&ItemTypeId={3}", project.CompanyId, (int)BookingTypes.Project, ProjectId, ItemTypeId);
                lnkBookings.HRef                 = string.Format("~/Project/ProjectBookingDetails.aspx?projectid={0}", ProjectId);
                hyperLinkTaskManager.NavigateUrl = string.Format("~/ItemBrief/TaskManager.aspx?projectid={0}&ItemTypeId={1}", ProjectId, ItemTypeId);
                reportList.ShowReportLinks(string.Format("~/ItemBrief/ItemisedPurchaseReport.aspx?projectid={0}", ProjectId), string.Format("~/ItemBrief/BudgetSummaryReport.aspx?projectid={0}", ProjectId), ProjectId);
                projectUpdatesLink.ProjectID = ProjectId;
                projectUpdatesLink.LoadData();
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Loads the bread crumbs.
        /// </summary>
        private void LoadBreadCrumbs()
        {
            BreadCrumbs bc = GetBreadCrumbsControl();

            StageBitz.Data.Project project = this.GetBL <ProjectBL>().GetProject(ProjectId);
            int companyId = project.Company.CompanyId;

            if (Support.IsCompanyAdministrator(companyId))
            {
                bc.AddLink(project.Company.CompanyName, string.Format("~/Company/CompanyDashboard.aspx?companyid={0}", companyId));
            }
            else
            {
                bc.AddLink(project.Company.CompanyName, string.Empty);
            }
            bc.AddLink(project.ProjectName, string.Format("~/Project/ProjectDashboard.aspx?ProjectId={0}", ProjectId));
            bc.AddLink("Task Manager", string.Format("~/ItemBrief/TaskManager.aspx?projectid={0}&ItemTypeId={1}", ProjectId, ItemTypeId));
            bc.AddLink(DisplayTitle, null);
            bc.LoadControl();
        }
Exemplo n.º 8
0
        /// <summary>
        /// Loads the bread crumbs.
        /// </summary>
        private void LoadBreadCrumbs()
        {
            BreadCrumbs bc = GetBreadCrumbsControl();

            StageBitz.Data.Project project = DataContext.Projects.Where(p => p.ProjectId == ProjectId).FirstOrDefault();

            int companyId = project.Company.CompanyId;

            if (Support.IsCompanyAdministrator(companyId))
            {
                bc.AddLink(project.Company.CompanyName, string.Format("~/Company/CompanyDashboard.aspx?companyid={0}", companyId));
            }
            else
            {
                bc.AddLink(project.Company.CompanyName, string.Empty);
            }

            bc.AddLink(project.ProjectName, string.Format("~/Project/ProjectDashboard.aspx?ProjectId={0}", ProjectId));

            //bc.AddLink(string.Concat(itemTypeName, " List"), string.Format("~/ItemBrief/ItemBriefList.aspx?ProjectId={0}&ItemTypeId={1}", ProjectId, projectItemTypes.ItemTypeId));
            bc.AddLink("Task Manager", null);
            bc.LoadControl();
        }
Exemplo n.º 9
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        /// <exception cref="System.Exception">project not found</exception>
        /// <exception cref="System.ApplicationException">Permission denied for this project </exception>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                StageBitz.Data.Project project = (from p in DataContext.Projects
                                                  where p.ProjectId == ProjectId && p.IsActive == true
                                                  select p).FirstOrDefault();
                if (project == null)
                {
                    throw new Exception("project not found");
                }

                if (!Support.CanAccessProject(project))
                {
                    if (GetBL <ProjectBL>().IsProjectClosed(project.ProjectId))
                    {
                        StageBitzException.ThrowException(new StageBitzException(ExceptionOrigin.ProjectClose, project.ProjectId, "This Project Is Closed."));
                    }

                    throw new ApplicationException("Permission denied for this project ");
                }
                bookingDetails.CanEditBookingDates = !GetBL <ProjectBL>().IsReadOnlyRightsForProject(ProjectId, UserID, false);
                //bookingDetails.RelatedId = ProjectId;
                //bookingDetails.RelatedTableName = "Project";
                bookingDetails.BookingId          = GetBL <InventoryBL>().GetBooking(ProjectId, "Project").BookingId;
                bookingDetails.DisplayMode        = UserWeb.Controls.Inventory.BookingDetails.ViewMode.Project;
                bookingDetails.OnlyShowMyBookings = this.OnlyShowMyBookings;
                DisplayTitle = "Bookings";
                LoadBreadCrumbs(project);
                lnkCompanyInventory.HRef = string.Format("~/Inventory/CompanyInventory.aspx?companyid={0}&relatedtable={1}&relatedid={2}", project.CompanyId, (int)BookingTypes.Project, ProjectId);
                lnkBookings.HRef         = string.Format("~/Project/ProjectBookingDetails.aspx?projectid={0}", ProjectId);
                linkTaskManager.HRef     = string.Format("~/ItemBrief/TaskManager.aspx?projectid={0}", ProjectId);
                reportList.ShowReportLinks(string.Format("~/ItemBrief/ItemisedPurchaseReport.aspx?projectid={0}", ProjectId), string.Format("~/ItemBrief/BudgetSummaryReport.aspx?projectid={0}", ProjectId), ProjectId);
                projectUpdatesLink.ProjectID = ProjectId;
                projectUpdatesLink.LoadData();
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        /// <exception cref="System.ApplicationException">
        /// Permission denied for this project.
        /// or
        /// Permission denied for Budget Summary Page.
        /// </exception>
        protected void Page_Load(object sender, EventArgs e)
        {
            this.ExportData1.PDFExportClick           += new EventHandler(ExportData1_PDFExportClick);
            this.ExportData1.ExcelExportClick         += new EventHandler(ExportData1_ExcelExportClick);
            projectItemTypes.ProjectID                 = ProjectId;
            projectItemTypes.ShouldShowAllItemTypeText = true;
            if (!IsPostBack)
            {
                StageBitz.Data.Project project = GetBL <Logic.Business.Project.ProjectBL>().GetProject(ProjectId);
                this.CompanyId = project.CompanyId;

                if (!Support.CanAccessProject(project))
                {
                    if (GetBL <ProjectBL>().IsProjectClosed(project.ProjectId))
                    {
                        StageBitzException.ThrowException(new StageBitzException(ExceptionOrigin.ProjectClose, project.ProjectId, "This Project Is Closed."));
                    }

                    throw new ApplicationException("Permission denied for this project.");
                }

                if (!Support.CanSeeBudgetSummary(UserID, ProjectId))
                {
                    throw new ApplicationException("Permission denied for Budget Summary Page.");
                }

                if (project != null)
                {
                    CultureName = Support.GetCultureName(project.Country.CountryCode);
                }

                warningDisplay.ProjectID = ProjectId;
                warningDisplay.LoadData();

                //Set links
                lnkCompanyInventory.HRef = string.Format("~/Inventory/CompanyInventory.aspx?companyid={0}&relatedtable={1}&relatedid={2}&ItemTypeId={3}",
                                                         project.CompanyId, (int)BookingTypes.Project, ProjectId, projectItemTypes.SelectedItemTypeId);
                lnkBookings.HRef = string.Format("~/Project/ProjectBookingDetails.aspx?projectid={0}", ProjectId);
                hyperLinkTaskManager.NavigateUrl = string.Format("~/ItemBrief/TaskManager.aspx?projectid={0}", ProjectId);
                reportList.ShowReportLinks(string.Format("~/ItemBrief/ItemisedPurchaseReport.aspx?projectid={0}", ProjectId), string.Format("~/ItemBrief/BudgetSummaryReport.aspx?projectid={0}", ProjectId), ProjectId);
                reportList.ApplyReportLinkStyle("BudgetSummaryReport");
                projectUpdatesLink.ProjectID = ProjectId;
                projectUpdatesLink.LoadData();

                LoadData();

                projectWarningPopup.ProjectId = ProjectId;
                budgetList.ProjectID          = ProjectId;
                budgetList.ItemTypeID         = projectItemTypes.SelectedItemTypeId;
                budgetList.BudgetListViewMode = UserWeb.Controls.ItemBrief.BudgetList.ViewMode.BudgetSummary;
                LoadBreadCrumbs();

                if (projectItemTypes.SelectedItemTypeId > 0)
                {
                    DisplayTitle = "Budget Summary Report - " + Utils.GetItemTypeById(projectItemTypes.SelectedItemTypeId).Name;
                }
                else
                {
                    DisplayTitle = "Budget Summary Report";
                }
            }
            projectItemTypes.InformParentToReload += delegate()
            {
                //Response.Redirect(HttpContext.Current.Request.Url.AbsoluteUri);
                ReloadByItemType();
            };

            bool IsItemTypeColVisible = true;

            foreach (GridColumn col in gvItems.MasterTableView.RenderColumns)
            {
                if (col.UniqueName == "ItemType" && projectItemTypes.SelectedItemTypeId != -1)
                {
                    col.Visible          = false;
                    IsItemTypeColVisible = false;
                }
                else if (IsItemTypeColVisible)
                {
                    switch (col.UniqueName)
                    {
                    case "Budget":
                    {
                        col.HeaderStyle.Width = 110;
                        break;
                    }

                    case "Expended":
                    {
                        col.HeaderStyle.Width = 110;
                        break;
                    }

                    case "Remaining":
                    {
                        col.HeaderStyle.Width = 110;
                        break;
                    }

                    case "Balance":
                    {
                        col.HeaderStyle.Width = 110;
                        break;
                    }
                    }
                }
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        /// <exception cref="System.ApplicationException">Permission denied for this project.</exception>
        protected void Page_Load(object sender, EventArgs e)
        {
            this.ExportData1.PDFExportClick   += new EventHandler(ExportData1_PDFExportClick);
            this.ExportData1.ExcelExportClick += new EventHandler(ExportData1_ExcelExportClick);
            projectItemTypes.ProjectID         = ProjectId;
            if (!IsPostBack)
            {
                StageBitz.Data.Project project = this.GetBL <ProjectBL>().GetProject(ProjectId);

                if (!Support.CanAccessProject(project))
                {
                    if (GetBL <ProjectBL>().IsProjectClosed(project.ProjectId))
                    {
                        StageBitzException.ThrowException(new StageBitzException(ExceptionOrigin.ProjectClose, project.ProjectId, "This Project Is Closed."));
                    }

                    throw new ApplicationException("Permission denied for this project.");
                }

                this.CompanyId = project.CompanyId;
                projectWarningPopup.ProjectId = ProjectId;
                warningDisplay.ProjectID      = ProjectId;
                warningDisplay.LoadData();

                if (Support.IsReadOnlyRightsForProject(ProjectId) || projectItemTypes.SelectedItemTypeId == 0)
                {
                    IsReadOnly = true;
                    //Can not create lists, can not add tasks to lists, can view lists
                    //Set visibility and enabling
                    txtListName.Enabled      = false;
                    btnAddList.Enabled       = false;
                    gridviewTaskList.Enabled = false;
                }

                #region SET Links

                lnkCompanyInventory.HRef = string.Format("~/Inventory/CompanyInventory.aspx?companyid={0}&relatedtable={1}&relatedid={2}&ItemTypeId={3}",
                                                         project.CompanyId, (int)BookingTypes.Project, ProjectId, projectItemTypes.SelectedItemTypeId);
                lnkBookings.HRef = string.Format("~/Project/ProjectBookingDetails.aspx?projectid={0}", ProjectId);
                hyperLinkTaskManager.NavigateUrl = string.Format("~/ItemBrief/TaskManager.aspx?projectid={0}", ProjectId);
                reportList.ShowReportLinks(string.Format("~/ItemBrief/ItemisedPurchaseReport.aspx?projectid={0}", ProjectId), string.Format("~/ItemBrief/BudgetSummaryReport.aspx?projectid={0}", ProjectId), ProjectId);
                projectUpdatesLink.ProjectID = ProjectId;
                projectUpdatesLink.LoadData();

                #endregion SET Links

                LoadData();
                if (projectItemTypes.SelectedItemTypeId != 0)
                {
                    string itemTypename = Utils.GetItemTypeById(projectItemTypes.SelectedItemTypeId).Name;
                    litTitleAT.Text   = string.Concat("All Active " + itemTypename + " Tasks");
                    litItemtype1.Text = litItemtype2.Text = itemTypename;
                    DisplayTitle      = "Task Manager - " + Utils.GetItemTypeById(projectItemTypes.SelectedItemTypeId).Name;
                }
                else
                {
                    litTitleAT.Text = "All Active Tasks";
                    DisplayTitle    = "Task Manager";
                }
            }

            projectItemTypes.InformParentToReload += delegate()
            {
                //Response.Redirect(HttpContext.Current.Request.Url.AbsoluteUri);
                ReloadByItemType();
            };
        }