Пример #1
0
        private XtraPivotGridHelper.DataViewTable CreateDataViewTable()
        {
            XtraPivotGridHelper.DataViewTable dt = new XtraPivotGridHelper.DataViewTable();

            dt.AddColumn(DataConst.SHOP_ID, DataConst.SHOP_ID, typeof(string), PivotArea.RowArea, null, null);
            dt.AddColumn(DataConst.EQP_GROUP, DataConst.EQP_GROUP, typeof(string), PivotArea.RowArea, null, null);

            dt.AddColumn(DataConst.BALANCE_STEP, DataConst.BALANCE_STEP, typeof(string), PivotArea.RowArea, null, null);
            dt.AddColumn(DataConst.BALANCE_WIP_QTY, DataConst.BALANCE_WIP_QTY, typeof(float), PivotArea.RowArea, null, null);

            dt.AddColumn(DataConst.TARGET_DATE, DataConst.TARGET_DATE, typeof(string), PivotArea.ColumnArea, null, null);

            dt.AddColumn(DataConst.WIP_QTY, DataConst.WIP_QTY, typeof(float), PivotArea.DataArea, null, null);
            dt.Columns[DataConst.WIP_QTY].DefaultValue = 0.0f;

            dt.AddColumn(DataConst.GAP_QTY, DataConst.GAP_QTY, typeof(float), PivotArea.DataArea, null, null);
            dt.Columns[DataConst.GAP_QTY].DefaultValue = 0.0f;

            dt.AddDataTablePrimaryKey(
                    new DataColumn[]
                    {
                        dt.Columns[DataConst.SHOP_ID],
                        dt.Columns[DataConst.BALANCE_STEP],
                        dt.Columns[DataConst.TARGET_DATE]
                    }
                );

            return dt;
        }
Пример #2
0
        private void DrawGrid(XtraPivotGridHelper.DataViewTable dt)
        {
            pivotGridControl1.BeginUpdate();

            XtraPivotGridHelper.ClearPivotGridFields(pivotGridControl1);
            XtraPivotGridHelper.CreatePivotGridFields(pivotGridControl1, dt);
            pivotGridControl1.DataSource = dt.DataTable;

            formatCells(pivotGridControl1);

            pivotGridControl1.EndUpdate();

            pivotGridControl1.OptionsView.HideAllTotals();

            foreach (PivotGridField field in pivotGridControl1.Fields)
            {
                if (field.FieldName == ColName.TOTAL)
                {
                    field.Appearance.Value.Options.UseTextOptions = true;
                    field.Appearance.Value.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
                }
            }

            pivotGridControl1.BestFit();
        }
Пример #3
0
        private void DrawGrid(XtraPivotGridHelper.DataViewTable dt)
        {
            this.pivotGridControl1.BeginUpdate();

            this.pivotGridControl1.ClearPivotGridFields();
            this.pivotGridControl1.CreatePivotGridFields(dt);

            this.pivotGridControl1.DataSource = dt.DataTable;

            ShowTotal(this.pivotGridControl1);
            this.pivotGridControl1.Fields[SmcvData.Schema.STEP_ID].SortMode = PivotSortMode.Custom;

            //for (int i = 0; i < this.pivotGridControl1.Fields.Count; i++)
            //{
            //    if (this.pivotGridControl1.Fields[i].FieldName == "IN_QTY")
            //        this.pivotGridControl1.Fields[i].Area = PivotArea.FilterArea;
            //}

            //pivotGridControl1.CustomCellDisplayText += pivotGridControl1_CellDisplayText;
            this.pivotGridControl1.EndUpdate();

            this.pivotGridControl1.BestFitColumnArea();

            pivotGridControl1.Fields[SmcvData.Schema.ACT_MOVE_QTY].CellFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            pivotGridControl1.Fields[SmcvData.Schema.ACT_MOVE_QTY].CellFormat.FormatString = "#,##0";

            pivotGridControl1.Fields[SmcvData.Schema.SIM_MOVE_QTY].CellFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            pivotGridControl1.Fields[SmcvData.Schema.SIM_MOVE_QTY].CellFormat.FormatString = "#,##0";

            pivotGridControl1.Fields[SmcvData.Schema.WIP_CUR].CellFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            pivotGridControl1.Fields[SmcvData.Schema.WIP_CUR].CellFormat.FormatString = "#,##0";

            pivotGridControl1.Fields[SmcvData.Schema.WIP_MAIN].CellFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            pivotGridControl1.Fields[SmcvData.Schema.WIP_MAIN].CellFormat.FormatString = "#,##0";
        }
Пример #4
0
        private XtraPivotGridHelper.DataViewTable CreateDataViewTable()
        {
            XtraPivotGridHelper.DataViewTable dt = new XtraPivotGridHelper.DataViewTable();

            dt.AddColumn(EuData.AREA, EuData.AREA, typeof(string), PivotArea.RowArea,
                         DevExpress.Data.PivotGrid.PivotSummaryType.Average, null);
            dt.AddColumn(EuData.SHOP_ID, EuData.SHOP_ID, typeof(string), PivotArea.RowArea,
                         DevExpress.Data.PivotGrid.PivotSummaryType.Average, null);
            dt.AddColumn(EuData.EQP_GROUP_ID, EuData.EQP_GROUP_ID, typeof(string), PivotArea.FilterArea,
                         DevExpress.Data.PivotGrid.PivotSummaryType.Average, null);
            dt.AddColumn(EuData.DATE, EuData.DATE, typeof(string), PivotArea.ColumnArea,
                         DevExpress.Data.PivotGrid.PivotSummaryType.Average, null);
            dt.AddColumn(EuData.UTILIZATION, EuData.UTILIZATION, typeof(float), PivotArea.DataArea,
                         DevExpress.Data.PivotGrid.PivotSummaryType.Average, null);

            dt.AddDataTablePrimaryKey(
                new DataColumn[]
            {
                dt.Columns[EuData.AREA],
                dt.Columns[EuData.SHOP_ID],
                dt.Columns[EuData.EQP_GROUP_ID],
                dt.Columns[EuData.DATE]
            }
                );

            return(dt);
        }
Пример #5
0
        private XtraPivotGridHelper.DataViewTable CreateDataViewTable()
        {
            XtraPivotGridHelper.DataViewTable dt = new XtraPivotGridHelper.DataViewTable();

            dt.AddColumn(StepWipData.SHOP_ID, StepWipData.SHOP_ID, typeof(string), PivotArea.RowArea, null, null);
            dt.AddColumn(StepWipData.STD_STEP, StepWipData.STD_STEP, typeof(string), PivotArea.RowArea, null, null);

            dt.AddColumn(StepWipData.PRODUCT_ID, StepWipData.PRODUCT_ID, typeof(string), PivotArea.RowArea, null, null);
            dt.AddColumn(StepWipData.PRODUCT_VERSION, StepWipData.PRODUCT_VERSION, typeof(string), PivotArea.RowArea, null, null);
            dt.AddColumn(StepWipData.OWNER_TYPE, StepWipData.OWNER_TYPE, typeof(string), PivotArea.RowArea, null, null);

            dt.AddColumn(StepWipData.TARGET_DATE, StepWipData.TARGET_DATE, typeof(string), PivotArea.ColumnArea, null, null);

            dt.AddColumn(StepWipData.WAIT_QTY, StepWipData.WAIT_QTY, typeof(float), PivotArea.DataArea, null, null);
            dt.AddColumn(StepWipData.RUN_QTY, StepWipData.RUN_QTY, typeof(float), PivotArea.DataArea, null, null);
            dt.AddColumn(StepWipData.TOTAL_QTY, StepWipData.TOTAL_QTY, typeof(float), PivotArea.DataArea, null, null);

            dt.Columns[StepWipData.TOTAL_QTY].DefaultValue = 0.0f;

            dt.AddDataTablePrimaryKey(
                new DataColumn[]
            {
                dt.Columns[StepWipData.SHOP_ID],
                dt.Columns[StepWipData.STD_STEP],
                dt.Columns[StepWipData.PRODUCT_ID],
                dt.Columns[StepWipData.PRODUCT_VERSION],
                dt.Columns[StepWipData.OWNER_TYPE],
                dt.Columns[StepWipData.TARGET_DATE]
            }
                );

            return(dt);
        }
Пример #6
0
        private XtraPivotGridHelper.DataViewTable CreateDataViewTable()
        {
            XtraPivotGridHelper.DataViewTable dt = new XtraPivotGridHelper.DataViewTable();

            dt.AddColumn(IocvData.Schema.SHOP_ID, IocvData.Schema.SHOP_ID, typeof(string), PivotArea.RowArea, null, null);
            dt.AddColumn(IocvData.Schema.IN_OUT_FLAG, IocvData.Schema.IN_OUT_FLAG, typeof(string), PivotArea.RowArea, null, null);
            dt.AddColumn(IocvData.Schema.DEPT, IocvData.Schema.DEPT, typeof(string), PivotArea.RowArea, null, null);

            dt.AddColumn(IocvData.Schema.PROD_ID, IocvData.Schema.PROD_ID, typeof(string), PivotArea.FilterArea, null, null);
            dt.AddColumn(IocvData.Schema.PROD_VER, IocvData.Schema.PROD_VER, typeof(string), PivotArea.FilterArea, null, null);

            dt.AddColumn(IocvData.Schema.TARGET_DATE, IocvData.Schema.TARGET_DATE, typeof(string), PivotArea.ColumnArea, null, null);

            dt.AddColumn(IocvData.Schema.QTY, IocvData.Schema.QTY, typeof(double), PivotArea.DataArea, null, null);

            dt.AddDataTablePrimaryKey(
                new DataColumn[]
            {
                dt.Columns[IocvData.Schema.SHOP_ID],
                dt.Columns[IocvData.Schema.IN_OUT_FLAG],
                dt.Columns[IocvData.Schema.DEPT],
                dt.Columns[IocvData.Schema.PROD_ID],
                dt.Columns[IocvData.Schema.PROD_VER],
                dt.Columns[IocvData.Schema.TARGET_DATE]
            }
                );

            return(dt);
        }
Пример #7
0
        private void DrawGrid(XtraPivotGridHelper.DataViewTable dt)
        {
            this.pivotGridControl1.BeginUpdate();

            this.pivotGridControl1.ClearPivotGridFields();
            this.pivotGridControl1.CreatePivotGridFields(dt);

            this.pivotGridControl1.DataSource = dt.DataTable;

            this.pivotGridControl1.OptionsView.ShowFilterHeaders = true;

            for (int i = 0; i < this.pivotGridControl1.Fields.Count; i++)
            {
                if (this.pivotGridControl1.Fields[i].FieldName == "WAIT_QTY" || this.pivotGridControl1.Fields[i].FieldName == "RUN_QTY")
                {
                    this.pivotGridControl1.Fields[i].Area = PivotArea.FilterArea;
                }
            }
            pivotGridControl1.CustomCellDisplayText += pivotGridControl1_CellDisplayText;

            pivotGridControl1.Fields[StepWipData.TOTAL_QTY].CellFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            pivotGridControl1.Fields[StepWipData.TOTAL_QTY].CellFormat.FormatString = "#,##0";

            pivotGridControl1.Fields[StepWipData.RUN_QTY].CellFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            pivotGridControl1.Fields[StepWipData.RUN_QTY].CellFormat.FormatString = "#,##0";

            pivotGridControl1.Fields[StepWipData.WAIT_QTY].CellFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            pivotGridControl1.Fields[StepWipData.WAIT_QTY].CellFormat.FormatString = "#,##0";

            this.pivotGridControl1.Fields[StepWipData.STD_STEP].SortMode = PivotSortMode.Custom;

            this.pivotGridControl1.EndUpdate();
            pivotGridControl1.BestFitColumnArea();
        }
Пример #8
0
        private XtraPivotGridHelper.DataViewTable BindData()
        {
            XtraPivotGridHelper.DataViewTable dataViewTable = new XtraPivotGridHelper.DataViewTable(viewName);
            dataViewTable.AddColumn(TargetPlanCompareData.SHOP_ID, TargetPlanCompareData.SHOP_ID, typeof(string), PivotArea.RowArea, null, null);

            dataViewTable.AddColumn(TargetPlanCompareData.STEP_ID, TargetPlanCompareData.STEP_ID, typeof(string), PivotArea.RowArea, null, null);
            dataViewTable.AddColumn(TargetPlanCompareData.PRODUCT_ID, TargetPlanCompareData.PRODUCT_ID, typeof(string), PivotArea.RowArea, null, null);
            dataViewTable.AddColumn(TargetPlanCompareData.OWNER_TYPE, TargetPlanCompareData.OWNER_TYPE, typeof(string), PivotArea.RowArea, null, null);
            dataViewTable.AddColumn(TargetPlanCompareData.CATEGORY, TargetPlanCompareData.CATEGORY, typeof(string), PivotArea.RowArea, null, null);
            dataViewTable.AddColumn(TargetPlanCompareData.TOTAL, TargetPlanCompareData.TOTAL, typeof(string), PivotArea.RowArea, null, null);
            dataViewTable.AddColumn(TargetPlanCompareData.TARGET_DATE, TargetPlanCompareData.TARGET_DATE, typeof(string), PivotArea.ColumnArea, null, null);

            dataViewTable.AddColumn(ColName.QTY, ColName.QTY, typeof(float), PivotArea.DataArea, null, null);

            dataViewTable.AddDataTablePrimaryKey(
                new DataColumn[]
            {
                dataViewTable.Columns[TargetPlanCompareData.SHOP_ID],
                dataViewTable.Columns[TargetPlanCompareData.STEP_ID],
                dataViewTable.Columns[TargetPlanCompareData.PRODUCT_ID],
                dataViewTable.Columns[TargetPlanCompareData.CATEGORY],
                dataViewTable.Columns[TargetPlanCompareData.TARGET_DATE]
            });

            return(dataViewTable);
        }
Пример #9
0
        private XtraPivotGridHelper.DataViewTable CreateDataViewTable()
        {
            XtraPivotGridHelper.DataViewTable dt = new XtraPivotGridHelper.DataViewTable();

            dt.AddColumn(StepMoveData.SHOP_ID, StepMoveData.SHOP_ID, typeof(string), PivotArea.RowArea, null, null);
            dt.AddColumn(StepMoveData.STD_STEP, StepMoveData.STD_STEP, typeof(string), PivotArea.RowArea, null, null);

            dt.AddColumn(StepMoveData.PRODUCT_ID, StepMoveData.PRODUCT_ID, typeof(string), PivotArea.RowArea, null, null);
            dt.AddColumn(StepMoveData.PRODUCT_VERSION, StepMoveData.PRODUCT_VERSION, typeof(string), PivotArea.RowArea, null, null);
            dt.AddColumn(StepMoveData.OWNER_TYPE, StepMoveData.OWNER_TYPE, typeof(string), PivotArea.RowArea, null, null);

            dt.AddColumn(StepMoveData.EQP_ID, StepMoveData.EQP_ID, typeof(string), PivotArea.FilterArea, null, null);
            dt.AddColumn(StepMoveData.EQP_GROUP_ID, StepMoveData.EQP_GROUP_ID, typeof(string), PivotArea.FilterArea, null, null);
            dt.AddColumn(StepMoveData.TARGET_DATE, StepMoveData.TARGET_DATE, typeof(string), PivotArea.ColumnArea, null, null);
            dt.AddColumn(StepMoveData.IN_QTY, StepMoveData.IN_QTY, typeof(float), PivotArea.DataArea, null, null);
            dt.AddColumn(StepMoveData.OUT_QTY, StepMoveData.OUT_QTY, typeof(float), PivotArea.DataArea, null, null);

            dt.AddDataTablePrimaryKey(
                new DataColumn[]
            {
                dt.Columns[StepMoveData.SHOP_ID],
                dt.Columns[StepMoveData.STD_STEP],
                dt.Columns[StepMoveData.PRODUCT_ID],
                dt.Columns[StepMoveData.PRODUCT_VERSION],
                dt.Columns[StepMoveData.OWNER_TYPE],
                dt.Columns[StepMoveData.EQP_ID],
                dt.Columns[StepMoveData.EQP_GROUP_ID],
                dt.Columns[StepMoveData.TARGET_DATE]
            }
                );

            return(dt);
        }
Пример #10
0
        private void BindData()
        {
            XtraPivotGridHelper.DataViewTable dt = CreateDataViewTable();

            FillData(dt);

            DrawGrid(dt);
        }
Пример #11
0
        private void FillData(XtraPivotGridHelper.DataViewTable dt)
        {
            string targetAreaID   = this.TargetAreaID;
            bool   isOnlyMainStep = this.ShowSubStep == false;

            var modelContext = _result.GetCtx <ModelDataContext>();
            var stdStepList  = _stdStepList;

            if (isOnlyMainStep)
            {
                stdStepList = stdStepList.FindAll(t => StringHelper.Equals(t.STEP_TYPE, "MAIN"));
            }

            var stepWip = _dict.Values;

            var query = from ps in stdStepList
                        join p in stepWip
                        on ps.SHOP_ID + ps.STEP_ID equals p.LINE_ID + p.STD_STEP into temp
                        from tp in temp.DefaultIfEmpty()
                        select new
            {
                SHOP_ID      = tp != null ? tp.LINE_ID : ps.SHOP_ID,
                STD_STEP_ID  = tp != null ? tp.STD_STEP : ps.STEP_ID,
                PROD_ID      = tp != null ? tp.PROD_ID : null,
                PROD_VER     = tp != null ? tp.PROD_VER : null,
                OWNER_TYPE   = tp != null ? tp.OWNER_TYPE : null,
                DATE_INFO    = tp != null ? tp.DATE_INFO : null,
                WAIT_QTY     = tp != null ? tp.WAIT_QTY : 0,
                RUN_QTY      = tp != null ? tp.RUN_QTY : 0,
                STD_STEP_SEQ = tp != null ? tp.STEP_SEQ : ps.STEP_SEQ,
            };

            _stepIndexs = new Dictionary <string, int>();

            var table = dt.DataTable;

            foreach (var item in query)
            {
                if (item.PROD_ID == null)
                {
                    continue;
                }

                table.Rows.Add(item.SHOP_ID,
                               item.STD_STEP_ID,
                               item.PROD_ID,
                               item.PROD_VER,
                               item.OWNER_TYPE,
                               item.DATE_INFO,
                               item.WAIT_QTY,
                               item.RUN_QTY,
                               item.WAIT_QTY + item.RUN_QTY);

                string stepKey = item.STD_STEP_ID;
                _stepIndexs[stepKey] = item.STD_STEP_SEQ;
            }
        }
Пример #12
0
        private void FillPivotGrid()
        {
            _dtChart = CreateChartTable();

            XtraPivotGridHelper.DataViewTable rsltTable = CreateDataViewTable();

            FillData(rsltTable);

            DrawPivotGrid(rsltTable);
        }
Пример #13
0
        private void Query()
        {
            DataProcessing();

            XtraPivotGridHelper.DataViewTable dt = CreateDataViewTable();

            FillPivotGrid(dt);

            DrawGrid(dt);
        }
Пример #14
0
        private void DrawGrid(XtraPivotGridHelper.DataViewTable dt)
        {
            this.pivotGridControl1.BeginUpdate();

            this.pivotGridControl1.ClearPivotGridFields();
            this.pivotGridControl1.CreatePivotGridFields(dt);

            this.pivotGridControl1.DataSource = dt.DataTable;

            this.pivotGridControl1.EndUpdate();
        }
Пример #15
0
 private void FillData(XtraPivotGridHelper.DataViewTable dt)
 {
     foreach (ResultItem item in _dict.Values)
     {
         dt.DataTable.Rows.Add(
             item.LINE_ID,
             item.PRODUCT_ID,
             item.PROCESS_ID,
             item.STEP_ID,
             item.IN_QTY,
             item.OUT_QTY
             );
     }
 }
Пример #16
0
        private void FillPivotGrid(XtraPivotGridHelper.DataViewTable dt)
        {
            foreach (EqpArrProductAnalViewData.EqpArrAnalResult resultInfo in _resultDic.Values)
            {
                DataRow dRow = dt.DataTable.NewRow();

                dRow[EqpArrProductAnalViewData.SHOP_ID]   = resultInfo.SHOP_ID;
                dRow[EqpArrProductAnalViewData.EQP_ID]    = resultInfo.EQP_ID;
                dRow[EqpArrProductAnalViewData.STEP_ID]   = resultInfo.STEP_ID;
                dRow[EqpArrProductAnalViewData.STEP_DESC] = resultInfo.STEP_DESC;
                dRow[EqpArrProductAnalViewData.PROD_QTY]  = resultInfo.PROD_QTY;

                dt.DataTable.Rows.Add(dRow);
            }
        }
Пример #17
0
        private void Query()
        {
            SetDateRange();

            LoadData();

            XtraPivotGridHelper.DataViewTable dataViewTable = BindData();

            FillData(dataViewTable);

            DrawGrid(dataViewTable);

            LoadDefaultLayOutFromXml();

            this.expandablePanel1.Text = "StepTarget VS EqpPlan : ";
        }
Пример #18
0
        private void Query()
        {
            ProcessData();

            XtraPivotGridHelper.DataViewTable dt = CreateDataViewTable();

            FillPivotData(dt);

            DrawPivotGrid(dt);

            DataTable dtChart = GetChartSchema();

            dtChart = FillChartData(dtChart);

            DrawChart(dtChart);
        }
        private void SetPivotGrid(DataTable dt, DevExpress.XtraPivotGrid.PivotGridControl pivotGrid)
        {
            XtraPivotGridHelper.DataViewTable dataTable = new XtraPivotGridHelper.DataViewTable();

            foreach (DataColumn info in dt.Columns)
            {
                dataTable.AddColumn(info.ColumnName, info.ColumnName, info.DataType, PivotArea.RowArea, null, null);
            }

            pivotGrid.BeginUpdate();
            pivotGrid.ClearPivotGridFields();
            pivotGrid.CreatePivotGridFields(dataTable);
            pivotGrid.DataSource = dt;
            pivotGrid.EndUpdate();

            pivotGrid.BestFit();
        }
Пример #20
0
 private void FillData(XtraPivotGridHelper.DataViewTable dt)
 {
     foreach (DetailInfo info in _detailDict.Values)
     {
         foreach (KeyValuePair <DateTime, float> pair in info.QtyDict)
         {
             dt.DataTable.Rows.Add(
                 info.Layer,
                 info.StepID,
                 info.StepDesc,
                 info.Span.ToString("0.0"),
                 Convert.ToInt32(info.Total),
                 pair.Key.ToString("yyyyMMdd HH"),
                 Convert.ToInt32(pair.Value)
                 );
         }
     }
 }
Пример #21
0
        private void DrawGrid(XtraPivotGridHelper.DataViewTable dt)
        {
            this.pivotGridControl1.BeginUpdate();

            this.pivotGridControl1.ClearPivotGridFields();
            this.pivotGridControl1.CreatePivotGridFields(dt);

            this.pivotGridControl1.DataSource = dt.DataTable;

            //this.pivotGridControl1.OptionsView.ShowRowTotals = false;
            //this.pivotGridControl1.OptionsView.ShowRowGrandTotals = false;
            //this.pivotGridControl1.OptionsView.ShowColumnTotals = false;
            //this.pivotGridControl1.OptionsView.ShowColumnGrandTotals = false;

            this.pivotGridControl1.EndUpdate();

            this.pivotGridControl1.BestFitColumnArea();
        }
Пример #22
0
        private void Query()
        {
            _colorGenerator = new ColorGenerator();

            SetData();

            LoadData();

            ProcessData();

            XtraPivotGridHelper.DataViewTable dt = CreateDataViewTable();
            //_dtChart = CreateChartTable();

            FillData(dt);

            // 4. Draw Grid
            DrawGrid(dt);
        }
Пример #23
0
        private void FillData(XtraPivotGridHelper.DataViewTable dataViewTable, CompareItem item, string targetDate, CompareItem total, QtyType qtyType)
        {
            string category = qtyType.ToString();
            float  qty      = 0.0f;

            if (ShowAccumulativeQty)
            {
                qty = item.GetAccQty(targetDate, qtyType);
            }
            else
            {
                qty = item.GetQty(targetDate, qtyType);
            }

            dataViewTable.DataTable.Rows.Add(
                item.SHOP_ID,
                item.STEP_ID,
                item.PRODUCT_ID,
                item.OWNER_TYPE,
                category,
                string.Format("{0:#,##0}", item.GetTotalQty(qtyType)),
                targetDate,
                qty);

            //Total
            var infos = qtyType == QtyType.TARGET ? total.Targets : total.Plans;

            if (qtyType == QtyType.DIFF)
            {
                infos = total.Diffs;
            }

            float prevQty = 0;

            if (infos.TryGetValue(targetDate, out prevQty))
            {
                infos[targetDate] += qty;
            }
            else
            {
                infos.Add(targetDate, 0);
            }
        }
Пример #24
0
        private void DrawPivotGrid(XtraPivotGridHelper.DataViewTable dt)
        {
            this.pivotGridControl1.BeginUpdate();

            this.pivotGridControl1.ClearPivotGridFields();
            this.pivotGridControl1.CreatePivotGridFields(dt);

            this.pivotGridControl1.DataSource = dt.DataTable;

            this.pivotGridControl1.OptionsView.ShowRowTotals         = true;
            this.pivotGridControl1.OptionsView.ShowRowGrandTotals    = true;
            this.pivotGridControl1.OptionsView.ShowColumnTotals      = true;
            this.pivotGridControl1.OptionsView.ShowColumnGrandTotals = true;

            this.pivotGridControl1.Fields[EuData.UTILIZATION].CellFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            this.pivotGridControl1.Fields[EuData.UTILIZATION].CellFormat.FormatString = "###,##0.0";

            this.pivotGridControl1.EndUpdate();
        }
Пример #25
0
        private void DrawPivotGrid(XtraPivotGridHelper.DataViewTable dt)
        {
            this.pivotGridControl1.BeginUpdate();

            this.pivotGridControl1.ClearPivotGridFields();
            this.pivotGridControl1.CreatePivotGridFields(dt);

            this.pivotGridControl1.DataSource = dt.DataTable;

            ShowTotal(this.pivotGridControl1);
            //this.pivotGridControl1.Fields[SmcvData.Schema.STEP_ID].SortMode = PivotSortMode.Custom;

            pivotGridControl1.Fields[IocvData.Schema.QTY].CellFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            pivotGridControl1.Fields[IocvData.Schema.QTY].CellFormat.FormatString = "#,##0";

            //this.pivotGridControl1.BestFitColumnArea();

            this.pivotGridControl1.EndUpdate();
            this.pivotGridControl1.Refresh();
        }
Пример #26
0
        private void FillPivotData(XtraPivotGridHelper.DataViewTable dt)
        {
            foreach (IocvData.ResultPivot item in _rsltPivotDic.Values)
            {
                string prodVer = "-";
                if (item.PROD_VER != null)
                {
                    prodVer = item.PROD_VER;
                }

                dt.DataTable.Rows.Add(
                    item.SHOP_ID,
                    item.IN_OUT_FLAG,
                    item.DEPT,
                    item.PROD_ID,
                    prodVer,
                    item.TARGET_DATE,
                    item.QTY
                    );
            }
        }
Пример #27
0
        private void DrawGrid(XtraPivotGridHelper.DataViewTable dt)
        {
            this.pivotGridControl1.BeginUpdate();

            this.pivotGridControl1.ClearPivotGridFields();
            this.pivotGridControl1.CreatePivotGridFields(dt);

            this.pivotGridControl1.DataSource = dt.DataTable;

            pivotGridControl1.CustomDrawCell += this.pivotGridControl1_CustomDrawCell;

            ShowTotal(this.pivotGridControl1, false);

            pivotGridControl1.CustomFieldSort += this.pivotGridControl1_CustomFieldSort;
            this.pivotGridControl1.Fields[JobChangePlanData.LAYER].SortMode = PivotSortMode.Custom;

            //pivotGridControl1.CustomCellDisplayText += pivotGridControl1_CellDisplayText;
            this.pivotGridControl1.EndUpdate();

            this.pivotGridControl1.BestFitColumnArea();
        }
Пример #28
0
        private void DrawGrid(XtraPivotGridHelper.DataViewTable dt)
        {
            this.pivotGridControl1.BeginUpdate();

            this.pivotGridControl1.ClearPivotGridFields();
            this.pivotGridControl1.CreatePivotGridFields(dt);

            this.pivotGridControl1.DataSource = dt.DataTable;
            formatGrid();

            ShowTotal(this.pivotGridControl1, false);
            this.pivotGridControl1.Fields[BalanceTableViewData.CATEGORY].SortMode    = PivotSortMode.Custom;
            this.pivotGridControl1.Fields[BalanceTableViewData.TARGET_DATE].SortMode = PivotSortMode.Custom;

            this.pivotGridControl1.EndUpdate();

            this.pivotGridControl1.BestFit();

            pivotGridControl1.Fields[BalanceTableViewData.QTY].CellFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            pivotGridControl1.Fields[BalanceTableViewData.QTY].CellFormat.FormatString = "#,##0";
        }
Пример #29
0
        private void FillData(XtraPivotGridHelper.DataViewTable dt)
        {
            foreach (CellInfo cinfo in _resultDict.Values)
            {
                foreach (string category in cinfo.QtyDict.Keys)
                {
                    Dictionary <string, float> dict = cinfo.QtyDict[category];
                    foreach (KeyValuePair <string, float> pair in dict)
                    {
                        if (this.ShowOutBalance == false && category.Contains("Out-"))
                        {
                            continue;
                        }

                        string cellOutID = "-";

                        if (_bomDict.ContainsKey(cinfo.CellID))
                        {
                            cellOutID = _bomDict[cinfo.CellID];
                        }

                        if (_demandList.Contains(cellOutID) == false)
                        {
                            continue;
                        }

                        dt.DataTable.Rows.Add(
                            cellOutID,
                            cinfo.CellID,
                            cinfo.TFProductID + "/\n" + cinfo.CFProductID,
                            category,
                            pair.Key,
                            pair.Value
                            );
                    }
                }
            }
        }
Пример #30
0
        private XtraPivotGridHelper.DataViewTable CreateDataViewTable()
        {
            XtraPivotGridHelper.DataViewTable dt = new XtraPivotGridHelper.DataViewTable();

            dt.AddColumn(EqpArrProductAnalViewData.SHOP_ID, EqpArrProductAnalViewData.SHOP_ID, typeof(string), PivotArea.RowArea, null, null);
            dt.AddColumn(EqpArrProductAnalViewData.EQP_ID, EqpArrProductAnalViewData.EQP_ID, typeof(string), PivotArea.RowArea, null, null);
            dt.AddColumn(EqpArrProductAnalViewData.STEP_ID, EqpArrProductAnalViewData.STEP_ID, typeof(string), PivotArea.ColumnArea, null, null);
            dt.AddColumn(EqpArrProductAnalViewData.STEP_DESC, EqpArrProductAnalViewData.STEP_DESC, typeof(string), PivotArea.ColumnArea, null, null);
            dt.AddColumn(EqpArrProductAnalViewData.PROD_QTY, EqpArrProductAnalViewData.PROD_QTY, typeof(int), PivotArea.DataArea, null, null);

            dt.AddDataTablePrimaryKey(
                new DataColumn[]
            {
                dt.Columns[EqpArrProductAnalViewData.SHOP_ID],
                dt.Columns[EqpArrProductAnalViewData.EQP_ID],
                dt.Columns[EqpArrProductAnalViewData.STEP_ID],
                dt.Columns[EqpArrProductAnalViewData.STEP_DESC],
                dt.Columns[EqpArrProductAnalViewData.PROD_QTY]
            }
                );

            return(dt);
        }