Exemplo n.º 1
0
        private void bSpread1_ButtonClicked(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
        {
            if (e.Column != (int)enumMultiDataConditionPopup.SELECT)
            {
                return;
            }

            BSpread bsprData = sender as BSpread;

            if ((bool)bsprData.GetCellValue(e.Row, 0) == true)
            {
                for (int i = 0; i < bsprData.ActiveSheet.RowCount; i++)
                {
                    if (i == e.Row)
                    {
                        continue;
                    }
                    bsprData.ActiveSheet.Cells[i, 0].Value = 0;
                }
            }
        }
Exemplo n.º 2
0
        public void bSpreadModelList_ButtonClicked(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
        {
            if (e.Column != (int)SPCChartConditionContext.SELECT)
            {
                return;
            }
            BSpread bsprData = sender as BSpread;

            if ((bool)bsprData.GetCellValue(e.Row, (int)SPCChartConditionContext.SELECT) == true)
            {
                for (int i = 0; i < bsprData.ActiveSheet.RowCount; i++)
                {
                    if (i == e.Row)
                    {
                        continue;
                    }
                    bsprData.ActiveSheet.Cells[i, (int)SPCChartConditionContext.SELECT].Value = 0;
                }

                ArrayList alCheckRowIndex = this._bspreadutility.GetCheckedRowIndex(bsprData, 0);
                if (alCheckRowIndex.Count > 0)
                {
                    string sMainYN = bsprData.ActiveSheet.Cells[(int)alCheckRowIndex[0], (int)SPCChartConditionContext.MAIN_YN].Text;
                    this.mModelConfigRawID = bsprData.ActiveSheet.Cells[(int)alCheckRowIndex[0], (int)SPCChartConditionContext.MODEL_CONFIG_RAWID].Text;
                    if (sMainYN.Equals("Y"))
                    {
                        this.PROC_MainModelContext((int)alCheckRowIndex[0]);
                    }
                    else
                    {
                        for (int j = 1; j < this.bTabControl1.TabPages.Count; j++)
                        {
                            this.bTabControl1.TabPages.RemoveAt(j);
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void bSpreadContext_ButtonClicked(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
        {
            if (e.Column != (int)SPCChartConditionContext.SELECT)
            {
                return;
            }
            BSpread bsprData = sender as BSpread;

            if ((bool)bsprData.GetCellValue(e.Row, (int)SPCChartConditionContext.SELECT) == true)
            {
                string    sValue          = bsprData.ActiveSheet.Cells[e.Row, 1].Text;
                ArrayList alCheckRowIndex = this._bspreadutility.GetCheckedRowIndex(bsprData, 0);
                if (sValue == Definition.VARIABLE.STAR)
                {
                    for (int j = 0; j < alCheckRowIndex.Count; j++)
                    {
                        string sTarget = bsprData.ActiveSheet.Cells[(int)alCheckRowIndex[j], 1].Text;
                        if (sTarget != sValue)
                        {
                            bsprData.ActiveSheet.Cells[(int)alCheckRowIndex[j], (int)SPCChartConditionContext.SELECT].Value = 0;
                        }
                    }
                }
                else
                {
                    for (int j = 0; j < alCheckRowIndex.Count; j++)
                    {
                        string sTarget = bsprData.ActiveSheet.Cells[(int)alCheckRowIndex[j], 1].Text;
                        if (sTarget == Definition.VARIABLE.STAR)
                        {
                            bsprData.ActiveSheet.Cells[(int)alCheckRowIndex[j], (int)SPCChartConditionContext.SELECT].Value = 0;
                        }
                    }
                }
            }
        }
Exemplo n.º 4
0
        private void bSpread_ButtonClicked(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
        {
            BSpread bsprData = sender as BSpread;

            ///
            DataSet ds = (DataSet)bsprData.DataSource;

            if (ds.Tables[0].Columns.Contains(Definition.STEP_DATAMAPPING.BASE))
            {
                if (e.Column == (int)enumMultiDataConditionPopup.BASE && (bool)bsprData.GetCellValue(e.Row, (int)enumMultiDataConditionPopup.BASE) == true)
                {
                    for (int i = 0; i < bsprData.ActiveSheet.RowCount; i++)
                    {
                        if (i == e.Row)
                        {
                            continue;
                        }
                        bsprData.ActiveSheet.Cells[i, (int)enumMultiDataConditionPopup.BASE].Value = false;
                    }
                }
            }

            ///

            if (e.Column != (int)enumMultiDataConditionPopup.SELECT)
            {
                return;
            }

            if ((bool)bsprData.GetCellValue(e.Row, (int)enumMultiDataConditionPopup.SELECT) == true)
            {
                if (bsprData.Name == this.bSpreadStepMet.Name ||
                    (bsprData.Name == this.bSpreadItem.Name && !this.bProbe))
                {
                    for (int i = 0; i < bsprData.ActiveSheet.RowCount; i++)
                    {
                        if (i == e.Row)
                        {
                            continue;
                        }
                        bsprData.ActiveSheet.Cells[i, (int)enumMultiDataConditionPopup.SELECT].Value = 0;
                    }
                }

                ArrayList alCheckRowIndex = this._bspreadutility.GetCheckedRowIndex(bsprData, (int)enumMultiDataConditionPopup.SELECT);
                if (alCheckRowIndex.Count > 0)
                {
                    if (bsprData.Name == this.bSpreadStepMet.Name)
                    {
                        if (alCheckRowIndex.Count > 1)
                        {
                            MSGHandler.DisplayMessage(MSGType.Warning, MSGHandler.GetMessage("FDC_ALLOW_SINGLE_SELECTED_ROW"));
                            return;
                        }

                        this._sOperation     = bsprData.ActiveSheet.Cells[(int)alCheckRowIndex[0], 1].Text;
                        this._sOperationDesc = bsprData.ActiveSheet.Cells[(int)alCheckRowIndex[0], 2].Text;

                        this.PROC_BindItem();
                        //if(this.bProbe)
                        this.PROC_BindSubData();
                    }
                    else if (bsprData.Name == this.bSpreadItem.Name)
                    {
                        if (!this.bProbe)
                        {
                            if (alCheckRowIndex.Count > 1)
                            {
                                MSGHandler.DisplayMessage(MSGType.Warning, MSGHandler.GetMessage("FDC_ALLOW_SINGLE_SELECTED_ROW"));
                                return;
                            }

                            this._sParamItem = bsprData.ActiveSheet.Cells[(int)alCheckRowIndex[0], 1].Text;
                            this.PROC_BindSubData();
                        }
                    }
                    else if (bsprData.Name == this.bSpreadSelect.Name)
                    {
                        //this.PROC_BindSubItem(this.SPC_PARAM_TYPE_EVS, bsprData.ActiveSheet.Cells[(int)alCheckRowIndex[0], 1].Text);
                    }
                }
            }
            else
            {
                if (bsprData.Name == this.bSpreadStepMet.Name)
                {
                    this._sOperation = string.Empty;
                    this.PROC_BindItem();
                }
            }
        }