Ejemplo n.º 1
0
        protected void BindStageEventsGrid()
        {
            //ProjectStageEvent stageEvents = new ProjectStageEvent();
            //stageEvents.GetByParent(stageId);
            //ProjectStageEventsGrid.DataSource = stageEvents.DataSourceView;
            ProjectManagementDa da = new ProjectManagementDa();
            DataView            dv = da.GetStageEvents(stageId).DefaultView;

            dv.Sort = "SortOrder";
            ProjectStageEventsGrid.DataSource = dv;
            ProjectStageEventsGrid.DataBind();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sets values for each stage
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void BindProjectStageEvents(object sender, RepeaterItemEventArgs e)
        {
            // Row For Stages (Item Template)
            if (e.Item.DataItem != null)
            {
                int    stageId        = int.Parse(DataBinder.Eval(e.Item.DataItem, ProjectStage.StageId).ToString());
                string stageName      = DataBinder.Eval(e.Item.DataItem, ProjectStage.Name).ToString();
                string stageColorCode = DataBinder.Eval(e.Item.DataItem, ProjectStage.ColorCode).ToString();

                HiddenField projectStageId = e.Item.FindControl("ProjectStageId") as HiddenField;
                projectStageId.Value = stageId.ToString();

                Label stageLabel = e.Item.FindControl("StageLabel") as Label;
                stageLabel.Text = stageName;

                HiddenField stageColor = e.Item.FindControl("StageColor") as HiddenField;
                stageColor.Value = stageColorCode;

                Repeater OrgSingleStageRptr = e.Item.FindControl("OrgSingleStageRptr") as Repeater;
                if (OrgSingleStageRptr != null)
                {
                    OrgSingleStageRptr.DataSource = organizationListDataView;
                    OrgSingleStageRptr.DataBind();
                }

                // Get a list of Events which belong to this stage
                //ProjectStageEvent stageEvents = new ProjectStageEvent();
                //stageEvents.GetByParent(stageId);
                DataView dv = da.GetStageEvents(stageId).DefaultView;
                dv.Sort = "SortOrder";

                // Binds Rows of Events which belong to Stage
                Repeater projectStageEventsRptr = e.Item.FindControl("ProjectStageEventsRptr") as Repeater;
                //projectStageEventsRptr.DataSource = stageEvents.DataSourceView;
                projectStageEventsRptr.DataSource = dv;
                projectStageEventsRptr.DataBind();


                Panel stageCheckBoxContainer = e.Item.FindControl("DoCheckBoxContainer") as Panel;
                if (!string.IsNullOrEmpty(stageColorCode))
                {
                    stageCheckBoxContainer.Style["border"] = "2px solid " + stageColorCode;
                }
            }
        }