Exemplo n.º 1
0
        private void pivotGridControl1_CellDoubleClick(object sender, PivotCellEventArgs e)
        {
            //string eqpId = e.;// [e.RowIndex, e.ColumnIndex].CellValue.ToString();
            //string stepSeq = this.pivotGridControl1[e.RowIndex, e.ColIndex + 1].CellValue.ToString();

            string shopID   = this.shopIdComboBox.SelectedItem.ToString();
            string eqpID    = string.Empty;
            string stepDesc = string.Empty;

            string key = string.Empty;

            if (e.ColumnField.FieldName == EqpArrProductAnalViewData.EQP_ID ||
                e.RowField.FieldName == EqpArrProductAnalViewData.EQP_ID)
            {
                eqpID = e.ColumnField.FieldName == EqpArrProductAnalViewData.EQP_ID ?
                        this.pivotGridControl1.GetFieldValue(e.ColumnField, e.ColumnIndex).ToString()
                    : this.pivotGridControl1.GetFieldValue(e.RowField, e.RowFieldIndex).ToString();
            }

            if (e.ColumnField.FieldName == EqpArrProductAnalViewData.STEP_DESC ||
                e.RowField.FieldName == EqpArrProductAnalViewData.STEP_DESC)
            {
                stepDesc = e.RowField.FieldName == EqpArrProductAnalViewData.STEP_DESC ?
                           this.pivotGridControl1.GetFieldValue(e.RowField, e.RowFieldIndex).ToString()
                    : this.pivotGridControl1.GetFieldValue(e.ColumnField, e.ColumnIndex).ToString();
            }


            key = CommonHelper.CreateKey(eqpID, stepDesc);

            EqpArrProductAnalViewData.EqpArrAnalResult resultInfo;
            if (_resultDic.TryGetValue(key, out resultInfo) == false)
            {
                return;
            }

            DataTable dt = new DataTable();

            dt.Columns.Add(EqpArrProductAnalViewData.SHOP_ID);
            dt.Columns.Add(EqpArrProductAnalViewData.EQP_ID);
            dt.Columns.Add(EqpArrProductAnalViewData.STEP_DESC);
            dt.Columns.Add(EqpArrProductAnalViewData.PRODUCT_ID);
            dt.Columns.Add(EqpArrProductAnalViewData.PRODUCT_VERSION);

            var prodDic = resultInfo.PROD_DIC.OrderBy(x => x.Key);

            foreach (var dic in prodDic)
            {
                dic.Value.Sort();

                foreach (string prodVer in dic.Value)
                {
                    DataRow dRow = dt.NewRow();
                    dRow[EqpArrProductAnalViewData.SHOP_ID]         = shopID;
                    dRow[EqpArrProductAnalViewData.EQP_ID]          = eqpID;
                    dRow[EqpArrProductAnalViewData.STEP_DESC]       = stepDesc;
                    dRow[EqpArrProductAnalViewData.PRODUCT_ID]      = dic.Key;
                    dRow[EqpArrProductAnalViewData.PRODUCT_VERSION] = prodVer;

                    dt.Rows.Add(dRow);
                }
            }

            SimpleGridPopUp simpleGrid = new SimpleGridPopUp("EqpArrange/Product", dt);

            simpleGrid.SetFormSize(700, 530);
            simpleGrid.SetFooter(true);

            simpleGrid.Show();
            simpleGrid.Focus();
        }
Exemplo n.º 2
0
        private void popUpDataBtn_Click(object sender, EventArgs e)
        {
            SetResultData();

            DataTable dt = new DataTable();

            dt.Columns.Add(PrvData.Schema.SHOP_ID, typeof(string));
            dt.Columns.Add(PrvData.Schema.TARGET_DATE, typeof(string));
            dt.Columns.Add(PrvData.Schema.PRODUCT_ID, typeof(string));
            dt.Columns.Add(PrvData.Schema.PROCESS_ID, typeof(string));
            dt.Columns.Add(PrvData.Schema.STEP_ID, typeof(string));
            dt.Columns.Add(PrvData.Schema.STEP_DESC, typeof(string));
            dt.Columns.Add(PrvData.Schema.STD_STEP_SEQ, typeof(int));
            dt.Columns.Add(PrvData.Schema.LAYER, typeof(string));
            dt.Columns.Add(PrvData.Schema.IS_RUN, typeof(string));
            dt.Columns.Add(PrvData.Schema.QTY, typeof(int));
            dt.Columns.Add(PrvData.Schema.PROG_RATE, typeof(double));
            dt.Columns.Add(PrvData.Schema.RANGE, typeof(string));
            dt.Columns.Add(PrvData.Schema.WAIT_TAT, typeof(double));
            dt.Columns.Add(PrvData.Schema.RUN_TAT, typeof(double));
            dt.Columns.Add(PrvData.Schema.TAT, typeof(double));
            dt.Columns.Add(PrvData.Schema.CUM_TAT, typeof(double));
            dt.Columns.Add(PrvData.Schema.TOTAL_TAT, typeof(double));

            var rsltAll = _resultDataDic.Values//.Where(x => x.ProgressRateWait * x.ProgressRateRun > 0)
                          .OrderBy(x => x.ShopID).ThenBy(x => x.TargetDate)
                          .ThenBy(x => x.ProdID + x.ProcID).ThenBy(x => x.StdStepSeq)
                          .ThenBy(x => x.ProgressRateWait).ThenBy(x => x.ProgressRateRun);

            foreach (PrvData.ResultData rsltData in rsltAll)
            {
                if (rsltData.ProgressRateWait > 0)
                {
                    DataRow waitDrow = dt.NewRow();

                    waitDrow[PrvData.Schema.SHOP_ID]      = rsltData.ShopID;
                    waitDrow[PrvData.Schema.TARGET_DATE]  = rsltData.TargetDate.ToString("yyyy-MM-dd HH:mm:ss");
                    waitDrow[PrvData.Schema.PRODUCT_ID]   = rsltData.ProdID;
                    waitDrow[PrvData.Schema.PROCESS_ID]   = rsltData.ProcID;
                    waitDrow[PrvData.Schema.STEP_ID]      = rsltData.StepID;
                    waitDrow[PrvData.Schema.STEP_DESC]    = rsltData.StepDesc;
                    waitDrow[PrvData.Schema.STD_STEP_SEQ] = rsltData.StdStepSeq;
                    waitDrow[PrvData.Schema.LAYER]        = rsltData.Layer;
                    waitDrow[PrvData.Schema.IS_RUN]       = string.Empty;
                    waitDrow[PrvData.Schema.QTY]          = rsltData.WaitQty;
                    waitDrow[PrvData.Schema.PROG_RATE]    = Math.Round(rsltData.ProgressRateWait, 4);
                    waitDrow[PrvData.Schema.RANGE]        = rsltData.RangeOfWait;
                    waitDrow[PrvData.Schema.WAIT_TAT]     = Math.Round(rsltData.WaitTat, 2);
                    waitDrow[PrvData.Schema.RUN_TAT]      = Math.Round(rsltData.RunTat, 2);
                    waitDrow[PrvData.Schema.TAT]          = Math.Round(rsltData.Tat, 2);
                    waitDrow[PrvData.Schema.CUM_TAT]      = Math.Round(rsltData.CumTat, 2);
                    waitDrow[PrvData.Schema.TOTAL_TAT]    = Math.Round(rsltData.TotalTat, 2);

                    dt.Rows.Add(waitDrow);
                }

                if (rsltData.ProgressRateRun > 0)
                {
                    DataRow runDrow = dt.NewRow();

                    runDrow[PrvData.Schema.SHOP_ID]      = rsltData.ShopID;
                    runDrow[PrvData.Schema.TARGET_DATE]  = rsltData.TargetDate.ToString("yyyy-MM-dd HH:mm:ss");
                    runDrow[PrvData.Schema.PRODUCT_ID]   = rsltData.ProdID;
                    runDrow[PrvData.Schema.PROCESS_ID]   = rsltData.ProcID;
                    runDrow[PrvData.Schema.STEP_ID]      = rsltData.StepID;
                    runDrow[PrvData.Schema.STEP_DESC]    = rsltData.StepDesc;
                    runDrow[PrvData.Schema.STD_STEP_SEQ] = rsltData.StdStepSeq;
                    runDrow[PrvData.Schema.LAYER]        = rsltData.Layer;
                    runDrow[PrvData.Schema.IS_RUN]       = "Y";
                    runDrow[PrvData.Schema.QTY]          = rsltData.RunQty;
                    runDrow[PrvData.Schema.PROG_RATE]    = Math.Round(rsltData.ProgressRateRun, 4);
                    runDrow[PrvData.Schema.RANGE]        = rsltData.RangeOfRun;
                    runDrow[PrvData.Schema.WAIT_TAT]     = Math.Round(rsltData.WaitTat, 2);
                    runDrow[PrvData.Schema.RUN_TAT]      = Math.Round(rsltData.RunTat, 2);
                    runDrow[PrvData.Schema.TAT]          = Math.Round(rsltData.Tat, 2);
                    runDrow[PrvData.Schema.CUM_TAT]      = Math.Round(rsltData.CumTat, 2);
                    runDrow[PrvData.Schema.TOTAL_TAT]    = Math.Round(rsltData.TotalTat, 2);

                    dt.Rows.Add(runDrow);
                }
            }

            SimpleGridPopUp simpleGrid = new SimpleGridPopUp("Progress Rate", dt);

            simpleGrid.SetFormSize(1300, 900);
            simpleGrid.SetFooter(true);
            //simpleGrid.SetColumnDisplayFormat(PrvData.Schema.TARGET_DATE, DevExpress.Utils.FormatType.DateTime, "yyyy-MM-dd HH:mm:ss");

            simpleGrid.Show();
            simpleGrid.Focus();
        }