コード例 #1
0
ファイル: PRJ0104S2.aspx.cs プロジェクト: schifflee/bscgit
    public void BindSchedule(TreeView treeView
                             , bool isCheckBox
                             , TreeNodeSelectAction treeNodeSelectAction
                             , string checkedValues)
    {
        string    valueStr    = "TASK_REF_ID";
        string    up_valueStr = "UP_TASK_REF_ID";
        string    textStr     = "TASK_NAME";
        string    iconStr     = "TASK_TYPE";
        string    imageUrlDir = "../images/treeview/";
        bool      isExtended  = true;
        DataTable dataTable   = null;



        Biz_Prj_Schedule objSchedule = new Biz_Prj_Schedule();
        DataSet          ds          = objSchedule.GetAllList(PRJ_REF_ID, 0);

        ds.Relations.Add("NodeRelation"
                         , ds.Tables[0].Columns[valueStr]
                         , ds.Tables[0].Columns[up_valueStr]
                         , false);

        treeView.Nodes.Clear();


        foreach (DataRow dbRow in ds.Tables[0].Rows)
        {
            if (DataTypeUtility.GetToInt32(dbRow[up_valueStr]) == 0)
            {
                TreeNode rootNode = CreateNode(dbRow
                                               , imageUrlDir + "root.gif"
                                               , isExtended
                                               , treeNodeSelectAction
                                               , isCheckBox);

                if (isCheckBox && (checkedValues != null || checkedValues == ""))
                {
                    TreeNodeCheck(rootNode, dataTable);
                }

                treeView.Nodes.Add(rootNode);
                PopulateScheduleTree(dbRow, rootNode, valueStr, textStr, imageUrlDir, iconStr, treeNodeSelectAction, isExtended, isCheckBox, dataTable);
            }
        }
    }
コード例 #2
0
    public void BindSchedule(string valueStr, string up_valueStr)
    {
        DataTable dataTable = GetDataTableSchema();

        Biz_Prj_Schedule objSchedule = new Biz_Prj_Schedule();
        DataSet          ds          = objSchedule.GetAllList(this.IPrjRefID, 0);

        object oRate = objSchedule.GetTotalRate(this.IPrjRefID, 0);

        if (ds.Tables.Count > 0)
        {
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                if (ds.Tables[0].Rows[i]["UP_TASK_REF_ID"] == DBNull.Value | ds.Tables[0].Rows[i]["UP_TASK_REF_ID"].ToString() == "0")
                {
                    ds.Tables[0].Rows[i]["PROCEED_RATE"] = DataTypeUtility.GetString(oRate);
                    break;
                }
            }
        }

        ds.Relations.Add("NodeRelation"
                         , ds.Tables[0].Columns[valueStr]
                         , ds.Tables[0].Columns[up_valueStr]
                         , false);

        foreach (DataRow dbRow in ds.Tables[0].Rows)
        {
            DataTable dt = ds.Tables[0];

            if (DataTypeUtility.GetToInt32(dbRow[up_valueStr]) == 0)
            {
                dataTable.Rows.Add(MakeDataRow(dataTable, dbRow));

                PopulateSchedule(dbRow, dataTable);
            }
        }

        grdTaskList.DataSource = dataTable.DefaultView;
        grdTaskList.DataBind();
    }
コード例 #3
0
ファイル: PRJ0102S3.aspx.cs プロジェクト: schifflee/bscgit
    private void BindGanttChart(int iPrjRefID)
    {
        IPrjRefID = iPrjRefID;

        if (PAGE_TYPE.Equals("N"))
        {
            _iPrjRefID = WebUtility.GetIntByValueDropDownList(ddlPrjName);
        }

        if (PAGE_TYPE.Equals("N") && _iPrjRefID < 1)
        {
            return;
        }

        Biz_Prj_Schedule objSchedule = new Biz_Prj_Schedule();

        objSchedule.IPrj_Ref_Id = IPrjRefID;
        DataSet ds = objSchedule.GetAllList(objSchedule.IPrj_Ref_Id, 0);

        if (ds.Tables.Count == 0 && ds.Tables[0].Rows.Count == 0)
        {
            return;
        }

        DataSet tmpDs = ds.Clone();

        ds.Relations.Add("NodeRelation"
                         , ds.Tables[0].Columns["TASK_REF_ID"]
                         , ds.Tables[0].Columns["UP_TASK_REF_ID"]
                         , false);

        foreach (DataRow dbRow in ds.Tables[0].Rows)
        {
            if (DataTypeUtility.GetToInt32(dbRow["UP_TASK_REF_ID"]) == 0)
            {
                tmpDs.Tables[0].ImportRow(dbRow);
                PopulateScheduleTree(dbRow, tmpDs);
            }
        }

        _dataTable = tmpDs.Tables[0];

        // Set Gantt chart type
        Chart1.Series["Tasks"].Type    = SeriesChartType.Gantt;
        Chart1.Series["Progress"].Type = SeriesChartType.Gantt;

        Chart1.Legends["Default"].Enabled = true;

        Chart1.ChartAreas["Default"].AxisX.MajorGrid.Interval = 2;
        Chart1.ChartAreas["Default"].AxisX.LabelsAutoFit      = false;

        Chart1.ChartAreas["Default"].AxisX.Interval = 1;
        Chart1.ChartAreas["Default"].AxisX.Reverse  = true;

        Chart1.ChartAreas["Default"].AxisY.LabelStyle.Format = "yy.MM.dd";
        //Chart1.ChartAreas["Default"].AxisY.MajorGrid.Interval = 28;
        //Chart1.ChartAreas["Default"].AxisY.Interval = 10;
        Chart1.ChartAreas["Default"].AxisY.LabelsAutoFitStyle ^= LabelsAutoFitStyle.IncreaseFont;
        Chart1.ChartAreas["Default"].AxisY.LabelsAutoFit       = true;

        Chart1.ChartAreas["Default"].Area3DStyle.Enable3D = false;
        Chart1.Series["Progress"]["DrawSideBySide"]       = "false";
        Chart1.Series["Tasks"]["DrawSideBySide"]          = "false";

        Chart1.Series["Tasks"]["PointWidth"]    = "0.7";
        Chart1.Series["Progress"]["PointWidth"] = "0.4";

        //Chart1.BackColor = Color.White;
        //Chart1.BackGradientType = GradientType.None;
        //Chart1.BorderColor = Color.Gray;
        //Chart1.BorderLineStyle = ChartDashStyle.Solid;
        //Chart1.BorderStyle = ChartDashStyle.NotSet;

        _htPoints.Clear();

        for (int i = 0; i < _dataTable.Rows.Count; i++)
        {
            DataRow row = _dataTable.Rows[i];

            object oPlanStartDate   = row["PLAN_START_DATE"];
            object oPlanEndDate     = row["PLAN_END_DATE"];
            object oActualStartDate = row["ACTUAL_START_DATE"];
            object oActualEndDate   = row["ACTUAL_END_DATE"];

            if (oPlanStartDate.ToString() == oPlanEndDate.ToString() && oPlanEndDate != DBNull.Value)
            {
                oPlanEndDate = (object)DataTypeUtility.GetToDateTime(oPlanEndDate).AddDays(1);
            }

            if (oActualStartDate.ToString() == oActualEndDate.ToString() && oActualEndDate != DBNull.Value)
            {
                oActualEndDate = (object)DataTypeUtility.GetToDateTime(oActualEndDate).AddDays(1);
            }

            if (oPlanStartDate != DBNull.Value && oPlanEndDate != DBNull.Value)
            {
                Chart1.Series["Tasks"].Points.AddXY(i, oPlanStartDate, oPlanEndDate);
            }
            else
            {
                Chart1.Series["Tasks"].Points.AddXY(i, null, null);
            }

            if (oActualStartDate == DBNull.Value || oActualStartDate == null)
            {
                oActualStartDate = null;
            }

            if (oActualEndDate == DBNull.Value || oActualEndDate == null)
            {
                oActualEndDate = null;
            }

            if (oActualStartDate == null || oActualEndDate == null)
            {
                oActualStartDate = null;
                oActualEndDate   = null;
            }

            //if (oActualStartDate == DBNull.Value && oActualEndDate != null)
            //    oActualStartDate =  oPlanStartDate;

            //if (oActualStartDate != DBNull.Value && (oActualEndDate == null || oActualEndDate == DBNull.Value))
            //    oActualEndDate    = oPlanEndDate;

            Chart1.Series["Progress"].Points.AddXY(i, oActualStartDate, oActualEndDate);

            //Chart1.Series["Tasks"].Points.AddXY(i, row["PLAN_START_DATE"], row["PLAN_END_DATE"]);

            //Chart1.Series["Progress"].Points.AddXY(i, row["ACTUAL_START_DATE"], row["ACTUAL_END_DATE"]);

            Chart1.Series["Tasks"].Points[i].AxisLabel    = row["TASK_NAME"].ToString();
            Chart1.Series["Progress"].Points[i].AxisLabel = row["TASK_NAME"].ToString();

            //Chart1.Series["Tasks"].Points[i].ToolTip = "계획기간 : " + DataTypeUtility.GetToDateTimeText(row["PLAN_START_DATE"]) + " ~ " + DataTypeUtility.GetToDateTimeText(row["PLAN_END_DATE"]);
            //Chart1.Series["Progress"].Points[i].ToolTip = "계획기간 : " + DataTypeUtility.GetToDateTimeText(row["PLAN_START_DATE"]) + " ~ " + DataTypeUtility.GetToDateTimeText(row["PLAN_END_DATE"]);
            //Chart1.Series["Progress"].Points[i].ToolTip = "실행기간 : " + DataTypeUtility.GetToDateTimeText(row["ACTUAL_START_DATE"]) + " ~ " + DataTypeUtility.GetToDateTimeText(row["ACTUAL_END_DATE"]);

            if (DataTypeUtility.GetToInt32(row["UP_TASK_REF_ID"]) > 0)
            {
                Chart1.Series["Tasks"].Points[i].ToolTip = "계획기간 : " + DataTypeUtility.GetToDateTimeText(row["PLAN_START_DATE"]) + " ~ " + DataTypeUtility.GetToDateTimeText(row["PLAN_END_DATE"]) + "\r\n" +
                                                           "실행기간 : " + DataTypeUtility.GetToDateTimeText(row["ACTUAL_START_DATE"]) + " ~ " + DataTypeUtility.GetToDateTimeText(row["ACTUAL_END_DATE"]);

                Chart1.Series["Progress"].Points[i].ToolTip = "계획기간 : " + DataTypeUtility.GetToDateTimeText(row["PLAN_START_DATE"]) + " ~ " + DataTypeUtility.GetToDateTimeText(row["PLAN_END_DATE"]) + "\r\n" +
                                                              "실행기간 : " + DataTypeUtility.GetToDateTimeText(row["ACTUAL_START_DATE"]) + " ~ " + DataTypeUtility.GetToDateTimeText(row["ACTUAL_END_DATE"]);
            }
            else
            {
                DataSet actualDs = objSchedule.GetActualDate(this.IPrjRefID);

                Chart1.Series["Tasks"].Points[i].ToolTip = "계획기간 : " + DataTypeUtility.GetToDateTimeText(row["PLAN_START_DATE"]) + " ~ " + DataTypeUtility.GetToDateTimeText(row["PLAN_END_DATE"]) + "\r\n" +
                                                           "실행기간 : " + DataTypeUtility.GetToDateTimeText(actualDs.Tables[0].Rows[0]["ACTUAL_START_DATE"]) + " ~ " + DataTypeUtility.GetToDateTimeText(actualDs.Tables[0].Rows[0]["ACTUAL_END_DATE"]);

                Chart1.Series["Progress"].Points[i].ToolTip = "계획기간 : " + DataTypeUtility.GetToDateTimeText(row["PLAN_START_DATE"]) + " ~ " + DataTypeUtility.GetToDateTimeText(row["PLAN_END_DATE"]) + "\r\n" +
                                                              "실행기간 : " + DataTypeUtility.GetToDateTimeText(actualDs.Tables[0].Rows[0]["ACTUAL_START_DATE"]) + " ~ " + DataTypeUtility.GetToDateTimeText(actualDs.Tables[0].Rows[0]["ACTUAL_END_DATE"]);
            }

            if (DataTypeUtility.GetToInt32(row["UP_TASK_REF_ID"]) > 0)
            {
                Chart1.Series["Tasks"].Points[i].Href    = "javascript:OpenSchedule('" + row["TASK_REF_ID"].ToString() + "');";
                Chart1.Series["Progress"].Points[i].Href = "javascript:OpenSchedule('" + row["TASK_REF_ID"].ToString() + "');";
            }

            //Chart1.Series["Tasks"].Points[i].Label = Chart1.Series["Tasks"].Points[i].XValue.ToString();

            _htPoints.Add(row["TASK_REF_ID"], Chart1.Series["Tasks"].Points[i]);
        }
    }