Exemple #1
0
        void GanttView_BindRowAdding(object sender, GanttRowEventArgs args)
        {
            var info      = args.Item as LotGantt.GanttInfo;
            var colHeader = _gantt.ColumnHeader;

            SetRowHeaderValue(args.RowIndex, info.LotID);

            this._rowsumti    = 0; //2010.09.13 by ldw
            this._rowsumto    = 0; //2010.09.13 by ldw
            this._rowRunHours = 0;

            if (args.Node == null)
            {
                return;
            }

            var rows = args.Node.LinkedBarList;

            if (rows.Count > 1 && args.Index > 0 && args.Index < rows.Count - 1)
            {
                XtraSheetHelper.SetCellText(colHeader.GetCellInfo(args.RowIndex, ColName.LotID), info.LotID);
                //SfGridHelper.SetCellText(colHeader.GetCellInfo(args.RowIndex, ColName.LotID), info.LotID);

                PaintRowKeyedCell(args.RowIndex, _currColor);
            }
        }
Exemple #2
0
        private void SetRowHeaderValue(int rowIndex, string lotID)
        {
#if DEBUG
            if (lotID == "FAAA611A5")
            {
            }
#endif
            string curKey    = CommonHelper.CreateKey(lotID /*stepSeq*/);
            var    colHeader = _gantt.ColumnHeader;

            if (_isFirst)
            {
                this.PreLotID       = lotID;
                _preRowKey          = curKey;
                _startSameEqpRowIdx = rowIndex;
                _startSameRowKeyIdx = rowIndex;

                _isFirst = false;
            }

            if (_isFirst == false && lotID.Equals(this.PreLotID) == false)
            {
                //SfGridHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx, ColName.TITotal), _subTotalTI);
                //SfGridHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx, ColName.TOTotal), _subTotalTO);

                _startSameEqpRowIdx = rowIndex;
                _subTotalTI         = 0;
                _subTotalTO         = 0;

                this.PreLotID = lotID;
            }

            if (_isFirst == false && curKey.Equals(_preRowKey) == false)
            {
                MergeRows(_startSameRowKeyIdx, rowIndex - 1);

                Color tmp = _preColor;
                _preColor           = _currColor;
                _currColor          = tmp;
                _preRowKey          = curKey;
                _startSameRowKeyIdx = rowIndex;
            }

            PaintRowKeyedCell(rowIndex, _currColor);

            XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.LotID), lotID);
            //SfGridHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.LotID), lotID);

            colHeader.GetCellInfo(rowIndex, ColName.LotID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
            colHeader.GetCellInfo(rowIndex, ColName.LotID).Alignment.Vertical   = SpreadsheetVerticalAlignment.Center;
        }
Exemple #3
0
        void GanttView_BindRowAdding(object sender, GanttRowEventArgs args)
        {
            var worksheet = this._gantt.Worksheet;

            var info      = args.Item as ToolGantt.GanttInfo;
            var colHeader = _gantt.ColumnHeader;

            string shopID = info.ShopID;
            string eqpID  = info.EqpID;
            string toolID = info.ToolID;

            SetRowHeaderValue(args.RowIndex, shopID, eqpID, string.IsNullOrEmpty(args.Key) ? "-" : args.Key, toolID);

            this._rowsumti            = 0;
            this._rowsumto            = 0;
            this._rowsumJobChg        = 0;
            this._rowsumLoadTimeFrBar = 0;

            if (args.Node == null)
            {
                return;
            }

            var rows = args.Node.LinkedBarList;

            if (rows.Count > 1 && args.Index > 0 && args.Index < rows.Count - 1)
            {
                XtraSheetHelper.SetCellText(colHeader.GetCellInfo(args.RowIndex, ColName.ShopID), shopID);
                XtraSheetHelper.SetCellText(colHeader.GetCellInfo(args.RowIndex, ColName.MaskID), toolID);
                if (this.IsOnlyToolMode == false)
                {
                    XtraSheetHelper.SetCellText(colHeader.GetCellInfo(args.RowIndex, ColName.EqpId), eqpID);
                }

                PaintRowKeyedCell(args.RowIndex, _currColor);
            }
        }
Exemple #4
0
        private void SetRowHeaderValue(int rowIndex, string shopID, string eqpId, string stepSeq, string toolID)
        {
            if (IsOnlyToolMode)
            {
                string curKey    = toolID;
                var    colHeader = _gantt.ColumnHeader;

                if (_isFirst)
                {
                    _preShopID          = shopID;
                    _preToolID          = toolID;
                    _preEqpID           = eqpId;
                    _preRowKey          = curKey;
                    _startSameEqpRowIdx = rowIndex;
                    _startSameRowKeyIdx = rowIndex;

                    _isFirst = false;
                }

                if (_isFirst == false && toolID.Equals(_preToolID) == false)
                {
                    MergeRows(_startSameEqpRowIdx, rowIndex - 1);
                    _startSameEqpRowIdx = rowIndex;
                }

                if (_isFirst == false && shopID.Equals(_preShopID) == false)
                {
                    MergeRows(_startSameEqpRowIdx, rowIndex - 1);
                    _startSameEqpRowIdx = rowIndex;
                }

                if (_isFirst == false && toolID.Equals(_preToolID) == false)
                {
                    if (_startSameEqpRowIdx > 1)
                    {
                        XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx - 1, ColName.TotalRun), _subTotalTO);

                        if (this.IsOnlyToolMode == false)
                        {
                            //XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx - 1, ColName.MaskChangeCnt), _subJobChg);
                        }
                    }

                    _preShopID          = shopID;
                    _preToolID          = toolID;
                    _preEqpID           = eqpId;
                    _startSameEqpRowIdx = rowIndex;
                    _subTotalTI         = 0;
                    _subTotalTO         = 0;
                    _subJobChg          = 0;
                }

                if (_isFirst == false && curKey.Equals(_preRowKey) == false)
                {
                    MergeRows(_startSameRowKeyIdx, rowIndex - 1);

                    Color tmp = _preColor;
                    _preColor  = _currColor;
                    _currColor = tmp;
                    _preRowKey = curKey;
                    //_startSameRowKeyIdx = rowIndex;
                }

                PaintRowKeyedCell(rowIndex, _currColor);

                XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.ShopID), shopID);
                XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.MaskID), toolID);

                if (this.IsOnlyToolMode == false)
                {
                    XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.EqpId), eqpId);
                }

                _gantt.Worksheet[rowIndex, colHeader.TryGetColumnIndex(ColName.ShopID)].SetCellText(shopID);
                colHeader.GetCellInfo(rowIndex, ColName.ShopID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
                colHeader.GetCellInfo(rowIndex, ColName.ShopID).Alignment.Vertical   = SpreadsheetVerticalAlignment.Center;

                _gantt.Worksheet[rowIndex, colHeader.TryGetColumnIndex(ColName.MaskID)].SetCellText(toolID);

                colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
                colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Vertical   = SpreadsheetVerticalAlignment.Center;

                if (this.IsOnlyToolMode == false)
                {
                    colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
                    colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Vertical   = SpreadsheetVerticalAlignment.Center;
                }
            }
            else
            {
                string curKey     = eqpId;
                string curToolKey = toolID;
                var    colHeader  = _gantt.ColumnHeader;

                if (_isFirst)
                {
                    _preToolID          = toolID;
                    _preEqpID           = eqpId;
                    _preRowKey          = curKey;
                    _startSameEqpRowIdx = rowIndex;
                    _startSameRowKeyIdx = rowIndex;

                    _isFirst = false;
                }

                if (SelectViewMode == ToolGantt.ViewMode.EQP)
                {
                    if (_isFirst == false && (toolID.Equals(_preToolID) == false || eqpId.Equals(_preEqpID) == false))
                    {
                        MergeRows(_startSameEqpRowIdx, rowIndex - 1);
                        _preToolID          = toolID;
                        _startSameEqpRowIdx = rowIndex;
                    }

                    if (_isFirst == false && eqpId.Equals(_preEqpID) == false)
                    {
                        if (_startSameEqpRowIdx > 1)
                        {
                            string sLoadRate = string.Empty;
                            XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx - 1, ColName.TotalRun), _subTotalTO);
                        }

                        _preToolID          = toolID;
                        _preEqpID           = eqpId;
                        _startSameEqpRowIdx = rowIndex;
                        _subTotalTI         = 0;
                        _subTotalTO         = 0;
                        _subJobChg          = 0;
                    }

                    if (_isFirst == false && curKey.Equals(_preRowKey) == false)
                    {
                        MergeRows(_startSameRowKeyIdx, rowIndex - 1);

                        Color tmp = _preColor;
                        _preColor           = _currColor;
                        _currColor          = tmp;
                        _preRowKey          = curKey;
                        _startSameRowKeyIdx = rowIndex;
                    }

                    PaintRowKeyedCell(rowIndex, _currColor);

                    XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.MaskID), toolID);
                    _gantt.Worksheet[rowIndex, colHeader.TryGetColumnIndex(ColName.MaskID)].SetCellText(toolID);

                    XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.EqpId), eqpId);
                    colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Horizontal  = SpreadsheetHorizontalAlignment.Center;
                    colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Vertical    = SpreadsheetVerticalAlignment.Center;
                    colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
                    colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Vertical   = SpreadsheetVerticalAlignment.Center;
                }

                if (SelectViewMode == ToolGantt.ViewMode.MASK)
                {
                    if (_isFirst == false && (toolID.Equals(_preToolID) == false || eqpId.Equals(_preEqpID) == false))
                    {
                        MergeRows(_startSameEqpRowIdx, rowIndex - 1, 1);
                        _preToolID          = toolID;
                        _preEqpID           = eqpId;
                        _startSameEqpRowIdx = rowIndex;
                    }

                    if (_isFirst == false && eqpId.Equals(_preToolID) == false)
                    {
                        if (_startSameEqpRowIdx > 1)
                        {
                            string sLoadRate = string.Empty;
                            XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx - 1, ColName.TotalRun), _subTotalTO);
                        }

                        _preToolID          = toolID;
                        _preEqpID           = eqpId;
                        _startSameEqpRowIdx = rowIndex;
                        _subTotalTI         = 0;
                        _subTotalTO         = 0;
                        _subJobChg          = 0;
                    }

                    if (_isFirst == false && curKey.Equals(_preRowKey) == false)
                    {
                        MergeRows(_startSameRowKeyIdx, rowIndex - 1, 1);

                        Color tmp = _preColor;
                        _preColor           = _currColor;
                        _currColor          = tmp;
                        _preRowKey          = curKey;
                        _startSameRowKeyIdx = rowIndex;
                    }

                    PaintRowKeyedCell(rowIndex, _currColor);

                    XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.MaskID), toolID);
                    _gantt.Worksheet[rowIndex, colHeader.TryGetColumnIndex(ColName.MaskID)].SetCellText(toolID);

                    XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.EqpId), eqpId);
                    colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Horizontal  = SpreadsheetHorizontalAlignment.Center;
                    colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Vertical    = SpreadsheetVerticalAlignment.Center;
                    colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
                    colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Vertical   = SpreadsheetVerticalAlignment.Center;
                }
            }
        }