/// <summary>
        /// Used to skip DashboardItemClick processing if the Expand/Collapse button is pressed
        /// </summary>
        void OnPivotGridControlMouseDown(object sender, MouseEventArgs e)
        {
            PivotGridControl pivot = sender as PivotGridControl;
            PivotGridHitInfo hi    = pivot.CalcHitInfo(e.Location);

            skipFiltering = (hi.ValueInfo != null && hi.ValueInfo.ValueHitTest == PivotGridValueHitTest.ExpandButton);
        }
Example #2
0
 private void targetPivot_MouseMove(object sender, MouseEventArgs e)
 {
     if (!onDrag)
     {
         if (e.Button == System.Windows.Forms.MouseButtons.Left)
         {
             PivotGridHitInfo hi = targetPivot.CalcHitInfo(e.Location);
             if (hi.HitTest == PivotGridHitTest.Value)
             {
                 if ((AllowDragRow && hi.ValueInfo.Field.Area == PivotArea.RowArea) || (AllowDragColumn && hi.ValueInfo.Field.Area == PivotArea.ColumnArea))
                 {
                     dragInfo = hi;
                     onDrag   = true;
                     targetPivot.FindForm().Cursor = Cursors.Hand;
                 }
             }
         }
     }
     else
     {
         DragDropEffects allowedEffect = GetDragEffect(e.Location);
         if (allowedEffect == DragDropEffects.None)
         {
             targetPivot.FindForm().Cursor = Cursors.No;
         }
         else
         {
             targetPivot.FindForm().Cursor = Cursors.Hand;
         }
     }
 }
Example #3
0
        private void pvgSICCleaned_MouseMove(object sender, MouseEventArgs e)
        {
            PivotGridControl Pivot = sender as PivotGridControl;
            PivotGridHitInfo hInfo = Pivot.CalcHitInfo(e.Location);

            if (hInfo == null || hInfo.CellInfo == null)
            {
                return;
            }
            if (hInfo.CellInfo.RowIndex <= Pivot.Cells.RowCount)
            {
                try
                {
                    TheSelectedShiftNo   = Pivot.Cells.GetCellInfo(hInfo.CellInfo.ColumnIndex, hInfo.CellInfo.RowIndex).GetFieldValue(colc_ShiftNo).ToString();
                    TheSelectedWorkplace = Pivot.Cells.GetCellInfo(hInfo.CellInfo.ColumnIndex, hInfo.CellInfo.RowIndex).GetFieldValue(colc_WP).ToString();
                    TheSelectedName      = Pivot.Cells.GetCellInfo(hInfo.CellInfo.ColumnIndex, hInfo.CellInfo.RowIndex).GetFieldValue(colc_Name).ToString();

                    TheSelectedType        = Pivot.Cells.GetCellInfo(hInfo.CellInfo.ColumnIndex, hInfo.CellInfo.RowIndex).GetFieldValue(colc_Type).ToString();
                    TheSelectedActivity    = Pivot.Cells.GetCellInfo(hInfo.CellInfo.ColumnIndex, hInfo.CellInfo.RowIndex).GetFieldValue(colc_Activity).ToString();
                    TheSelectedDate        = Pivot.Cells.GetCellInfo(hInfo.CellInfo.ColumnIndex, hInfo.CellInfo.RowIndex).GetFieldValue(colc_CalendarDate).ToString();
                    TheSelectedProblemCode = Pivot.Cells.GetCellInfo(hInfo.CellInfo.ColumnIndex, hInfo.CellInfo.RowIndex).GetFieldValue(colc_TheValue).ToString();
                }
                catch (NullReferenceException ex)
                {
                }
            }
        }
Example #4
0
        private void pivotGridControl1_MouseMove(object sender, MouseEventArgs e)
        {
            mousePos = Point.Empty;
            PivotGridHitInfo info = pivotGridControl1.CalcHitInfo(e.Location);

            if (info.HitTest == PivotGridHitTest.Value)
            {
                mousePos = e.Location;
                BaseViewInfo newVI = info.ValueInfo.Data.ViewInfo.GetViewInfoAtPoint(e.Location);
                if (!object.ReferenceEquals(newVI, viewInfo))
                {
                    pivotGridControl1.Invalidate(newVI.PaintBounds);
                    if (viewInfo != null)
                    {
                        pivotGridControl1.Invalidate(viewInfo.PaintBounds);
                    }
                    viewInfo = newVI;
                }
            }
            else
            {
                if (viewInfo != null)
                {
                    pivotGridControl1.Invalidate(viewInfo.PaintBounds);
                }
                viewInfo = null;
            }
        }
Example #5
0
        private void pivotGridControl1_MouseClick(object sender, MouseEventArgs e)
        {
            PivotGridHitInfo hi = pivotGridControl1.CalcHitInfo(e.Location);

            if (hi.HitTest == PivotGridHitTest.Value && hi.ValueInfo.IsColumn)
            {
                ApplySortByValue(hi.ValueInfo);
            }
        }
        private void pivotGridControl1_MouseClick(object sender, MouseEventArgs e)
        {
            PivotGridHitInfo hitInfo = pivotGridControl1.CalcHitInfo(e.Location);

            if (hitInfo.HitTest == PivotGridHitTest.Value && hitInfo.ValueInfo != null)
            {
                dataGridView1.DataSource = hitInfo.ValueInfo.CreateDrillDownDataSource();
            }
        }
        private void pivotGridControl1_MouseClick(object sender, MouseEventArgs e)
        {
            PivotGridHitInfo hInfo = pivotGridControl1.CalcHitInfo(e.Location);

            if (hInfo.HitTest == PivotGridHitTest.Value)
            {
                HandleValueMouseClick(hInfo.ValueInfo);
            }
        }
        private void pivotGridControl1_MouseDown(object sender, MouseEventArgs e)
        {
            PivotGridHitInfo hi = pivotGridControl1.CalcHitInfo(e.Location);

            if (hi.HitTest == PivotGridHitTest.HeadersArea && hi.HeaderField != null && hi.HeadersAreaInfo.HeaderHitTest == PivotGridHeaderHitTest.Filter && hi.HeaderField.Area != PivotArea.DataArea)
            {
                (e as DXMouseEventArgs).Handled = true;
                customFieldFilterControl1.Field = hi.HeaderField;
                popupControlContainer1.ShowPopup((sender as PivotGridControl).PointToScreen(e.Location));
            }
        }
 private void GuardaPosicaoCursor(PivotGridHitInfo info)
 {
     try
     {
         this.pvtGrdVisualizacoes.ContextMenuStrip = null;
         if (info != null && info.CellInfo != null)
         {
             this.pvtGrdVisualizacoes.ContextMenuStrip = this.ctxtMnStrpVisao;
             this.ctxtMnStrpVisao.Tag = info.CellInfo.DataField;
         }
     }
     catch (Exception)
     {
     }
 }
Example #10
0
        private void OnGridViewDragObjectDrop(object sender, DragObjectDropEventArgs e)
        {
            Point location = MousePosition;

            if (!(e.DragObject is GridColumn))
            {
                return;
            }
            PivotGridHitInfo hitInfo = pivot.CalcHitInfo(pivot.PointToClient(location));

            if (null == hitInfo.HeadersAreaInfo)
            {
                return;
            }
            pivot.Fields.Add(((GridColumn)e.DragObject).FieldName, hitInfo.HeadersAreaInfo.Area);
        }
Example #11
0
        private void showToolTipForParameterNameField(PivotGridHitInfo hi, ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            var field = hi.ValueInfo.Field;

            if (field != _pivotGrid.ParameterField)
            {
                return;
            }

            var ds = hi.ValueInfo.CreateDrillDownDataSource();
            var parameterDisplayName = ds.StringValue(PKSimConstants.PKAnalysis.ParameterDisplayName);
            var description          = ds.StringValue(PKSimConstants.PKAnalysis.Description);
            var warning      = ds.StringValue(PKSimConstants.PKAnalysis.Warning);
            var superToolTip = _toolTipCreator.ToolTipForPKAnalysis(parameterDisplayName, description, warning);

            e.Info = _toolTipCreator.ToolTipControlInfoFor(parameterDisplayName, superToolTip);
        }
Example #12
0
        private void pivotGridControl1_MouseMove(object sender, MouseEventArgs e)
        {
            PivotGridControl pivot   = (PivotGridControl)sender;
            PivotGridHitInfo hitInfo = pivot.CalcHitInfo(e.Location);

            if (hitInfo.HitTest != PivotGridHitTest.HeadersArea)
            {
                return;
            }
            if (hitInfo.HeaderField != null && hitInfo.HeaderField.Area == PivotArea.DataArea && hitInfo.HeaderField.Options.AllowRunTimeSummaryChange)
            {
                PropertyInfo             pInfo           = typeof(PivotGridHeadersAreaHitInfo).GetProperty("HeadersViewInfo", BindingFlags.Instance | BindingFlags.NonPublic);
                PivotHeadersViewInfoBase headersViewInfo = pInfo.GetValue(hitInfo.HeadersAreaInfo, null) as PivotHeadersViewInfoBase;
                PivotHeaderViewInfo      headerViewInfo  = headersViewInfo[GetFieldItem(pivot, hitInfo.HeaderField)] as PivotHeaderViewInfo;

                MethodInfo mInfo = typeof(PivotHeaderViewInfo).GetMethod("ShowSummariesMenu", BindingFlags.NonPublic | BindingFlags.Instance);
                mInfo.Invoke(headerViewInfo, new object[] { });
            }
        }
        private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            if (e.SelectedControl != pivotGridControl1)
            {
                return;
            }
            PivotGridHitInfo hitInfo = pivotGridControl1.CalcHitInfo(e.ControlMousePosition);

            if (hitInfo.CellInfo != null)
            {
                PivotGridStyleFormatCondition condition = GetStyleFormatByValue(hitInfo.CellInfo.Item, pivotGridControl1);
                if (condition != null)
                {
                    object o             = hitInfo.CellInfo.DataField.ToString() + hitInfo.CellInfo.ColumnIndex + hitInfo.CellInfo.RowIndex;
                    string toolTipString = Convert.ToString(condition.Tag);
                    e.Info = new ToolTipControlInfo(o, toolTipString);
                }
            }
        }
Example #14
0
        DragDropEffects GetDragEffect(Point point)
        {
            PivotGridHitInfo hi       = targetPivot.CalcHitInfo(point);
            PivotArea        dragArea = dragInfo.ValueInfo.Field.Area;

            if (hi.HitTest != PivotGridHitTest.Value || hi.ValueInfo.Field == null || hi.ValueInfo.Field.Area != dragArea)
            {
                TargetInfo = null;
                return(DragDropEffects.None);
            }
            if ((dragArea == PivotArea.ColumnArea && !AllowDragColumn) || (dragArea == PivotArea.RowArea && !AllowDragRow))
            {
                TargetInfo = null;
                return(DragDropEffects.None);
            }
            //for the same group
            if (IsSameGroup(dragInfo.ValueInfo, hi.ValueInfo))
            {
                if (dragInfo.ValueInfo.Field != hi.ValueInfo.Field || dragInfo.ValueInfo.Value.Equals(hi.ValueInfo.Value))
                {
                    TargetInfo = null;
                    return(DragDropEffects.None);
                }
                else
                {
                    TargetInfo = hi;
                    return(DragDropEffects.Move);
                }
            }
            else //for different groups
            {
                if ((dragArea == PivotArea.RowArea && AllowChangeRowGroup) || (dragArea == PivotArea.ColumnArea && AllowChangeColumnGroup))
                {
                    TargetInfo = hi;
                    return(DragDropEffects.Move);
                }
                else
                {
                    TargetInfo = null;
                    return(DragDropEffects.None);
                }
            }
        }
Example #15
0
        /// <summary>
        /// Used to get underlying data and display the DetailData dialog
        /// </summary>
        void DashboardItemClick(object sender, DashboardItemMouseActionEventArgs e)
        {
            if (IsDetailsEnabled(e.DashboardItemName))
            {
                PivotGridControl pivot = dashboardDesigner.GetUnderlyingControl(e.DashboardItemName) as PivotGridControl;
                PivotGridHitInfo hi    = pivot.CalcHitInfo(pivot.PointToClient(Cursor.Position));

                bool doNotShowDataForThisArea =
                    (hi.HitTest == PivotGridHitTest.Value && hi.ValueInfo.ValueHitTest == PivotGridValueHitTest.ExpandButton) ||
                    (hi.HitTest == PivotGridHitTest.None);
                if (!doNotShowDataForThisArea)
                {
                    using (DetailData detailForm = new DetailData(e.GetUnderlyingData()))
                    {
                        detailForm.ShowDialog();
                    }
                }
            }
        }
Example #16
0
        private void pvgSICCapture_MouseMove(object sender, MouseEventArgs e)
        {
            PivotGridControl Pivot = sender as PivotGridControl;
            PivotGridHitInfo hInfo = Pivot.CalcHitInfo(e.Location);

            if (hInfo == null || hInfo.CellInfo == null)
            {
                return;
            }
            if (hInfo.CellInfo.RowIndex <= Pivot.Cells.RowCount)
            {
                try
                {
                    TheSelectedShiftNo = Pivot.Cells.GetCellInfo(hInfo.CellInfo.ColumnIndex, hInfo.CellInfo.RowIndex).GetFieldValue(col_ShiftNo).ToString();
                    TheSelectedSICKey  = Pivot.Cells.GetCellInfo(hInfo.CellInfo.ColumnIndex, hInfo.CellInfo.RowIndex).GetFieldValue(col_SICKey).ToString();
                }
                catch (NullReferenceException ex)
                {
                }
            }
        }
Example #17
0
        private void pvgSICCapture_MouseUp(object sender, MouseEventArgs e)
        {
            PivotGridControl Pivot = sender as PivotGridControl;
            PivotGridHitInfo hInfo = Pivot.CalcHitInfo(e.Location);

            if (hInfo == null || hInfo.CellInfo == null)
            {
                return;
            }

            if (hInfo.CellInfo.ColumnIndex >= 0)
            {
                if (e.Button == MouseButtons.Right)
                {
                    if (Pivot.GetFieldValue(col_CalendarDate, hInfo.CellInfo.RowIndex).ToString() != "")
                    {
                        popupRow.ShowPopup(MousePosition);
                    }
                }
            }
        }
Example #18
0
        private void targetPivot_MouseUp(object sender, MouseEventArgs e)
        {
            if (onDrag)
            {
                if (GetDragEffect(e.Location) == DragDropEffects.Move)
                {
                    PivotGridHitInfo hi = targetPivot.CalcHitInfo(e.Location);
                    if (hi.ValueInfo.Field == dragInfo.ValueInfo.Field)
                    {
                        (dragInfo.ValueInfo.Field.Tag as IList).Remove(dragInfo.ValueInfo.Value);
                        (dragInfo.ValueInfo.Field.Tag as IList).Insert((dragInfo.ValueInfo.Field.Tag as IList).IndexOf(hi.ValueInfo.Value), dragInfo.ValueInfo.Value);
                        //updateMemos();
                    }
                    if ((dragInfo.ValueInfo.Field.Area == PivotArea.RowArea && AllowChangeRowGroup) || (dragInfo.ValueInfo.Field.Area == PivotArea.ColumnArea && AllowChangeColumnGroup))
                    {
                        PivotDrillDownDataSource ds = null;
                        for (int i = 0; i < dragInfo.ValueInfo.Field.AreaIndex && i <= hi.ValueInfo.Field.AreaIndex; i++)
                        {
                            object targetFieldValue = hi.ValueInfo.GetFieldValue(targetPivot.GetFieldByArea(dragInfo.ValueInfo.Field.Area, i), hi.ValueInfo.MinIndex);
                            object dragFieldValue   = dragInfo.ValueInfo.GetFieldValue(targetPivot.GetFieldByArea(dragInfo.ValueInfo.Field.Area, i), dragInfo.ValueInfo.MinIndex);
                            if (targetFieldValue != dragFieldValue)
                            {
                                if (ds == null)
                                {
                                    ds = dragInfo.ValueInfo.CreateDrillDownDataSource();
                                }
                                foreach (PivotDrillDownDataRow row in ds)
                                {
                                    ds.SetValue(row.Index, targetPivot.GetFieldByArea(dragInfo.ValueInfo.Field.Area, i), targetFieldValue);
                                }
                            }
                        }
                    }
                    targetPivot.RefreshData();
                }

                onDrag = false;
                targetPivot.FindForm().Cursor = Cursors.Default;
            }
        }
Example #19
0
        private void showToolTipForParameterValueField(PivotGridHitInfo hi, ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            var field = hi.CellInfo.DataField;

            if (field != _pivotGrid.ValueField)
            {
                return;
            }

            var ds      = hi.CellInfo.CreateDrillDownDataSource();
            var warning = ds.StringValue(PKSimConstants.PKAnalysis.Warning);

            if (string.IsNullOrEmpty(warning))
            {
                return;
            }

            var parameterDisplayName = ds.StringValue(PKSimConstants.PKAnalysis.ParameterDisplayName);
            var superToolTip         = _toolTipCreator.WarningToolTip(warning);

            e.Info = _toolTipCreator.ToolTipControlInfoFor(parameterDisplayName, superToolTip);
        }
Example #20
0
        private void PivotGridControl_MouseClick(object sender, MouseEventArgs e)
        {
            PivotGridControl pivot = sender as PivotGridControl;
            PivotGridHitInfo info  = pivot.CalcHitInfo(e.Location);

            if (info.HitTest != PivotGridHitTest.Value)
            {
                return;
            }

            if (info.ValueInfo.Value == null)
            {
                return;
            }

            int    fieldIdx   = info.ValueInfo.Field.Index;
            int    maxIdx     = info.ValueInfo.MaxIndex;
            string fieldname  = info.ValueInfo.Field.ToString();
            string fieldvalue = info.ValueInfo.Value.ToString();

            BindingList <ResultItem> chartResult = pivot.DataSource as BindingList <ResultItem>;
            string lineID   = string.Empty;
            string designID = string.Empty;
            string prodID   = string.Empty;
            string procID   = string.Empty;
            string stepID   = string.Empty;

            /* 차트 도입부 */
            if (fieldname == "LINE_ID")
            {
                chartResult = chartResult.Where(x => x.LineID == fieldvalue).ToBindingList();
            }

            else if (fieldname == "DESIGN_ID")
            {
                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 1], maxIdx) != null)
                {
                    lineID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 1], maxIdx).ToString();
                }

                BindingList <ResultItem> list = new BindingList <ResultItem>();
                foreach (var item in chartResult)
                {
                    if (string.IsNullOrEmpty(lineID) == false && item.LineID != lineID)
                    {
                        continue;
                    }

                    if (item.DesignID != fieldvalue)
                    {
                        continue;
                    }

                    list.Add(item);
                }

                chartResult = list;
            }
            else if (fieldname == "PRODUCT_ID")
            {
                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 2], maxIdx) != null)
                {
                    lineID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 2], maxIdx).ToString();
                }

                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 1], maxIdx) != null)
                {
                    designID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 1], maxIdx).ToString();
                }

                BindingList <ResultItem> list = new BindingList <ResultItem>();
                foreach (var item in chartResult)
                {
                    if (string.IsNullOrEmpty(lineID) == false && item.LineID != lineID)
                    {
                        continue;
                    }

                    if (string.IsNullOrEmpty(designID) == false && item.DesignID != designID)
                    {
                        continue;
                    }

                    if (item.ProductID != fieldvalue)
                    {
                        continue;
                    }

                    list.Add(item);
                }

                chartResult = list;
            }
            else if (fieldname == "PROCESS_ID")
            {
                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 3], maxIdx) != null)
                {
                    lineID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 3], maxIdx).ToString();
                }

                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 2], maxIdx) != null)
                {
                    designID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 2], maxIdx).ToString();
                }

                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 1], maxIdx) != null)
                {
                    prodID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 1], maxIdx).ToString();
                }

                BindingList <ResultItem> list = new BindingList <ResultItem>();
                foreach (var item in chartResult)
                {
                    if (string.IsNullOrEmpty(lineID) == false && item.LineID != lineID)
                    {
                        continue;
                    }

                    if (string.IsNullOrEmpty(designID) == false && item.DesignID != designID)
                    {
                        continue;
                    }

                    if (string.IsNullOrEmpty(prodID) == false && item.ProductID != prodID)
                    {
                        continue;
                    }

                    if (item.ProcessID != fieldvalue)
                    {
                        continue;
                    }

                    list.Add(item);
                }

                chartResult = list;
            }
            else if (fieldname == "STEP_ID")
            {
                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 4], maxIdx) != null)
                {
                    lineID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 4], maxIdx).ToString();
                }

                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 3], maxIdx) != null)
                {
                    designID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 3], maxIdx).ToString();
                }

                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 2], maxIdx) != null)
                {
                    prodID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 2], maxIdx).ToString();
                }

                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 1], maxIdx) != null)
                {
                    procID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 1], maxIdx).ToString();
                }

                BindingList <ResultItem> list = new BindingList <ResultItem>();
                foreach (var item in chartResult)
                {
                    if (string.IsNullOrEmpty(lineID) == false && item.LineID != lineID)
                    {
                        continue;
                    }

                    if (string.IsNullOrEmpty(designID) == false && item.DesignID != designID)
                    {
                        continue;
                    }

                    if (string.IsNullOrEmpty(prodID) == false && item.ProductID != prodID)
                    {
                        continue;
                    }

                    if (string.IsNullOrEmpty(procID) == false && item.ProcessID != procID)
                    {
                        continue;
                    }

                    if (item.StepID != fieldvalue)
                    {
                        continue;
                    }

                    list.Add(item);
                }

                chartResult = list;
            }
            else if (fieldname == "SEQUENCE")
            {
                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 5], maxIdx) != null)
                {
                    lineID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 5], maxIdx).ToString();
                }

                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 4], maxIdx) != null)
                {
                    designID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 4], maxIdx).ToString();
                }

                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 3], maxIdx) != null)
                {
                    prodID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 3], maxIdx).ToString();
                }

                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 2], maxIdx) != null)
                {
                    procID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 2], maxIdx).ToString();
                }

                if (pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 1], maxIdx) != null)
                {
                    stepID = pivot.GetFieldValue(info.ValueInfo.Data.Fields[fieldIdx - 1], maxIdx).ToString();
                }

                BindingList <ResultItem> list = new BindingList <ResultItem>();
                foreach (var item in chartResult)
                {
                    if (string.IsNullOrEmpty(lineID) == false && item.LineID != lineID)
                    {
                        continue;
                    }

                    if (string.IsNullOrEmpty(designID) == false && item.DesignID != designID)
                    {
                        continue;
                    }

                    if (string.IsNullOrEmpty(prodID) == false && item.ProductID != prodID)
                    {
                        continue;
                    }

                    if (string.IsNullOrEmpty(procID) == false && item.ProcessID != procID)
                    {
                        continue;
                    }

                    if (string.IsNullOrEmpty(stepID) == false && item.StepID != stepID)
                    {
                        continue;
                    }

                    if (item.Sequence != Convert.ToDecimal(fieldvalue))
                    {
                        continue;
                    }

                    list.Add(item);
                }

                chartResult = list;
            }

            DataTable chartTable = new DataTable();

            chartTable.Columns.Add("PRODUCT_ID", typeof(string));
            chartTable.Columns.Add("DATE", typeof(string));
            chartTable.Columns.Add("MOVE", typeof(int));
            chartTable.Columns.Add("TARGET", typeof(int));

            chartTable.PrimaryKey = new DataColumn[]
            {
                chartTable.Columns["PRODUCT_ID"], chartTable.Columns["DATE"]
            };

            List <string> SelProds = new List <string>();

            foreach (var row in chartResult)
            {
                DataRow eRow = chartTable.Rows.Find(new object[] { row.ProductID, row.Date });
                if (eRow != null)
                {
                    eRow["MOVE"]   = Convert.ToInt32(eRow["MOVE"]) + row.PlanQty;
                    eRow["TARGET"] = Convert.ToInt32(eRow["TARGET"]) + row.TargetQty;
                }
                else
                {
                    DataRow drow = chartTable.NewRow();
                    drow["PRODUCT_ID"] = row.ProductID;
                    drow["DATE"]       = row.Date;
                    drow["MOVE"]       = row.PlanQty;
                    drow["TARGET"]     = row.TargetQty;
                    chartTable.Rows.Add(drow);
                }

                if (SelProds.Contains(row.ProductID) == false)
                {
                    SelProds.Add(row.ProductID);
                }
            }

            DrawChart(chartTable, SelProds);
        }
Example #21
0
        private void pivotGridControl1_CellClick(object sender, PivotCellEventArgs e)
        {
            //Employee_24_7_Production_user_id = userid.ToString();
            SplashScreenManager.ShowForm(this, typeof(Ordermanagement_01.Masters.WaitForm1), true, true, false);
            try
            {
                PivotGridHitInfo hi = pivotGridControl1.CalcHitInfo(pivotGridControl1.PointToClient(MousePosition));
                if (hi.HitTest == PivotGridHitTest.Cell)
                {
                    string V_Data = "";
                    string Column_Name = "";
                    string Row_Value_Type = ""; string Column_Value_Type = "";
                    string User_Name = ""; string Branch_Name = "";
                    string V_UserName = ""; string V_Date = "";
                    string V_BranchName = "";

                    Row_Value_Type    = hi.CellInfo.RowValueType.ToString();
                    Column_Value_Type = hi.CellInfo.ColumnValueType.ToString();

                    // MessageBox.Show("Row_value_Type"+Row_Value_Type + " Column_Value_Type:" + Column_Value_Type);
                    Column_Name = hi.CellInfo.DataField.FieldName.ToString();
                    //Row_Name = hi.CellInfo.RowField.FieldName.ToString();


                    foreach (var field in pivotGridControl1.GetFieldsByArea(PivotArea.ColumnArea))
                    {
                        if (Column_Name == "No_Of_Errors")
                        {
                            V_Data = e.GetFieldValue(pivotGridField2).ToString();
                        }
                        if (Column_Name == "No_of_Completed_orders")
                        {
                            V_Data = e.GetFieldValue(pivotGridField3).ToString();
                        }
                        if (Column_Name == "Accuracy")
                        {
                            V_Data = e.GetFieldValue(pivotGridField4).ToString();
                        }
                    }

                    int    month_id = 0; int year_id = 0;
                    object obj        = lookUpEdit_Accuracy_Month.EditValue;
                    string month_name = lookUpEdit_Accuracy_Month.Text;
                    if (obj.ToString() != "0")
                    {
                        month_id = (int)obj;
                    }

                    object obj_year = lookUpEdit_Accuracy_Year.EditValue;
                    string year     = lookUpEdit_Accuracy_Year.Text;
                    if (obj_year.ToString() != "0")
                    {
                        year_id = (int)obj_year;
                    }
                    // get First and last day of the Month and Year

                    first = new DateTime(year_id, month_id, 1);
                    last  = first.AddMonths(1).AddSeconds(-1);

                    string Fromdate = first.ToString();
                    string Todate   = last.ToString();
                    //foreach (var field in pivotGridControl1.GetFieldsByArea(PivotArea.RowArea))
                    //{

                    //    V_UserName = e.GetFieldValue(pivotGridField5).ToString();
                    //    User_Name = V_UserName;
                    //}
                    //foreach (var field in pivotGridControl1.GetFieldsByArea(PivotArea.ColumnArea))
                    //{

                    //    V_Date = e.GetFieldValue(pivotGridField1).ToString();

                    //    //Production_Date = V_Date;
                    //}
                    //foreach (var field in pivotGridControl1.GetFieldsByArea(PivotArea.RowArea))
                    //{

                    //    V_BranchName = e.GetFieldValue(pivotGridField12).ToString();

                    //    Branch_Name = V_BranchName;
                    //}



                    if (V_Data != "" && V_Data != "0")
                    {
                        if (Row_Value_Type == "Value" && Column_Value_Type == "Value")// This is for Non Summary Click Event
                        {
                            foreach (var field in pivotGridControl1.GetFieldsByArea(PivotArea.ColumnArea))
                            {
                                V_Date = e.GetFieldValue(pivotGridField1).ToString();
                            }
                            foreach (var field in pivotGridControl1.GetFieldsByArea(PivotArea.RowArea))
                            {
                                V_UserName = e.GetFieldValue(pivotGridField5).ToString();
                                User_Name  = V_UserName;
                            }
                            foreach (var field in pivotGridControl1.GetFieldsByArea(PivotArea.RowArea))
                            {
                                V_BranchName = e.GetFieldValue(pivotGridField12).ToString();
                                Branch_Name  = V_BranchName;
                            }

                            //if (V_Data != "" && V_Data != "0")
                            //{

                            Hashtable             ht_get_grid = new Hashtable();
                            System.Data.DataTable dt_get_grid = new System.Data.DataTable();
                            ht_get_grid.Clear();
                            dt_get_grid.Clear();
                            ht_get_grid.Add("@Trans", "GET_USER_ID");
                            ht_get_grid.Add("@Emp_Name", User_Name);
                            dt_get_grid = dataaccess.ExecuteSP("Sp_Daily_Status_Top_Efficiency_Calculation", ht_get_grid);

                            //
                            Hashtable             ht_insert = new Hashtable();
                            System.Data.DataTable dt_insert = new System.Data.DataTable();
                            //ht_insert.Clear();
                            //dt_insert.Clear();

                            ht_insert.Add("@Trans", "INSERT_INTO_TEMP_USER_NEW_USER_WISE");
                            ht_insert.Add("@User_Id", dt_get_grid.Rows[0]["User_id"].ToString());
                            ht_insert.Add("@Production_Date", V_Date.ToString());
                            dt_insert = dataaccess.ExecuteSP("Sp_Employee_Production_Score_Board", ht_insert);

                            Ordermanagement_01.Reports.Accuracy_Detail_Section TargeDashboard
                                = new Ordermanagement_01.Reports.Accuracy_Detail_Section(int.Parse(dt_get_grid.Rows[0]["User_id"].ToString()), User_Role_Id, V_Date.ToString(), int.Parse(dt_get_grid.Rows[0]["Branch_ID"].ToString()), "", "");
                            TargeDashboard.Show();

                            //}
                            //else
                            //{
                            //    SplashScreenManager.CloseForm(false);
                            //}
                        }
                        //2

                        else if (Row_Value_Type == "Value" && Column_Value_Type == "Total")// this is For Column Grand Total // this is for Single user & All Date
                        {
                            //if (V_Data != "" && V_Data != "0")
                            //{

                            Hashtable             ht_get_grid = new Hashtable();
                            System.Data.DataTable dt_get_grid = new System.Data.DataTable();
                            ht_get_grid.Clear();
                            dt_get_grid.Clear();
                            ht_get_grid.Add("@Trans", "GET_USER_ID");
                            ht_get_grid.Add("@Emp_Name", User_Name);
                            // ht_get_grid.Add("@Branch_Name", Branch_Name);
                            dt_get_grid = dataaccess.ExecuteSP("Sp_Daily_Status_Top_Efficiency_Calculation", ht_get_grid);

                            //Hashtable htinsert = new Hashtable();
                            //System.Data.DataTable dtinsert = new System.Data.DataTable();

                            //htinsert.Add("@Trans", "INSERT_INTO_TEMP_USER");
                            //htinsert.Add("@Production_Date", V_Date.ToString());
                            //htinsert.Add("@User_Id", int.Parse(dt_get_grid.Rows[0]["User_id"].ToString()));
                            //dtinsert = dataaccess.ExecuteSP("Sp_Employee_Production_Score_Board", htinsert);

                            //Hashtable htinsert = new Hashtable();
                            //System.Data.DataTable dtinsert = new System.Data.DataTable();

                            //htinsert.Add("@Trans", "INSERT_INTO_TEMP_USER_1");
                            //htinsert.Add("@From_Date", Fromdate.ToString());
                            //htinsert.Add("@To_Date", Todate.ToString());
                            //dtinsert = dataaccess.ExecuteSP("Sp_Employee_Production_Score_Board", htinsert);


                            Ordermanagement_01.Reports.Accuracy_Detail_Section TargeDashboard
                                = new Ordermanagement_01.Reports.Accuracy_Detail_Section(int.Parse(dt_get_grid.Rows[0]["User_id"].ToString()), User_Role_Id, V_Date.ToString(), int.Parse(dt_get_grid.Rows[0]["Branch_ID"].ToString()), "", "");
                            TargeDashboard.Show();

                            //}
                            //else
                            //{
                            //    SplashScreenManager.CloseForm(false);
                            //}
                        }
                        //3
                        else if (Row_Value_Type == "Value" && Column_Value_Type == "GrandTotal")// this is For Column Grand Total // this is for Single user & All Date
                        {
                            foreach (var field in pivotGridControl1.GetFieldsByArea(PivotArea.RowArea))
                            {
                                V_UserName = e.GetFieldValue(pivotGridField5).ToString();
                                User_Name  = V_UserName;
                            }


                            //if (V_Data != "" && V_Data != "0")
                            //{
                            Hashtable             ht_get_grid = new Hashtable();
                            System.Data.DataTable dt_get_grid = new System.Data.DataTable();
                            ht_get_grid.Clear();
                            dt_get_grid.Clear();
                            ht_get_grid.Add("@Trans", "GET_USER_ID");
                            ht_get_grid.Add("@Emp_Name", User_Name);
                            // ht_get_grid.Add("@Branch_Name", Branch_Name);
                            dt_get_grid = dataaccess.ExecuteSP("Sp_Daily_Status_Top_Efficiency_Calculation", ht_get_grid);

                            //Hashtable htinsert = new Hashtable();
                            //System.Data.DataTable dtinsert = new System.Data.DataTable();

                            //htinsert.Add("@Trans", "INSERT_INTO_TEMP_USER");
                            //htinsert.Add("@Production_Date", V_Date.ToString());
                            //htinsert.Add("@User_Id", int.Parse(dt_get_grid.Rows[0]["User_id"].ToString()));
                            //dtinsert = dataaccess.ExecuteSP("Sp_Employee_Production_Score_Board", htinsert);


                            Ordermanagement_01.Reports.Accuracy_Detail_Section TargeDashboard
                                = new Ordermanagement_01.Reports.Accuracy_Detail_Section(int.Parse(dt_get_grid.Rows[0]["User_id"].ToString()), User_Role_Id, V_Date.ToString(), int.Parse(dt_get_grid.Rows[0]["Branch_ID"].ToString()), Fromdate, Todate);
                            TargeDashboard.Show();
                            //}
                            //else
                            //{
                            //    SplashScreenManager.CloseForm(false);
                            //}
                        }
                        //4
                        else if (Row_Value_Type == "Total" && Column_Value_Type == "Value")// this is For Row Total // this is for Single user & All Date
                        {
                            foreach (var field in pivotGridControl1.GetFieldsByArea(PivotArea.ColumnArea))
                            {
                                V_Date = e.GetFieldValue(pivotGridField1).ToString().Trim();
                            }
                            foreach (var field in pivotGridControl1.GetFieldsByArea(PivotArea.RowArea))
                            {
                                string val2 = e.GetFieldValue(pivotGridField12).ToString();
                                Branch_Name = val2;
                            }

                            //if (V_Data != "" && V_Data != "0")
                            //{
                            Hashtable             ht_get_grid = new Hashtable();
                            System.Data.DataTable dt_get_grid = new System.Data.DataTable();
                            ht_get_grid.Clear();
                            dt_get_grid.Clear();
                            ht_get_grid.Add("@Trans", "GET_BRANCH_ID");
                            ht_get_grid.Add("@Branch_Name", Branch_Name);
                            dt_get_grid = dataaccess.ExecuteSP("Sp_Daily_Status_Top_Efficiency_Calculation", ht_get_grid);

                            Ordermanagement_01.Reports.Accuracy_Detail_Section TargeDashboard = new Ordermanagement_01.Reports.Accuracy_Detail_Section(0, User_Role_Id, V_Date.ToString(), int.Parse(dt_get_grid.Rows[0]["Branch_ID"].ToString()), "", "");
                            TargeDashboard.Show();
                            //}
                            //else
                            //{
                            //    SplashScreenManager.CloseForm(false);
                            //}
                        }

                        //5
                        else if (Row_Value_Type == "GrandTotal" && Column_Value_Type == "Value")// this is For row Grand Total // this is for Single date & All Date
                        {
                            foreach (var field in pivotGridControl1.GetFieldsByArea(PivotArea.ColumnArea))
                            {
                                V_Date = e.GetFieldValue(pivotGridField1).ToString().Trim();
                            }

                            //if (V_Data != "" && V_Data != "0")
                            //{

                            Ordermanagement_01.Reports.Accuracy_Detail_Section TargeDashboard = new Ordermanagement_01.Reports.Accuracy_Detail_Section(0, User_Role_Id, V_Date.ToString(), 0, "", "");
                            TargeDashboard.Show();
                            //}
                            //else
                            //{
                            //    SplashScreenManager.CloseForm(false);
                            //}
                        }
                        //6
                        else if (Row_Value_Type == "Total" && Column_Value_Type == "GrandTotal")// this is For Row Total // this is for Single user & All Date
                        {
                            foreach (var field in pivotGridControl1.GetFieldsByArea(PivotArea.RowArea))
                            {
                                string val2 = e.GetFieldValue(pivotGridField12).ToString();
                                Branch_Name = val2;
                            }

                            //if (V_Data != "" && V_Data != "0")
                            //{

                            Hashtable             ht_get_grid = new Hashtable();
                            System.Data.DataTable dt_get_grid = new System.Data.DataTable();
                            ht_get_grid.Clear();
                            dt_get_grid.Clear();
                            ht_get_grid.Add("@Trans", "GET_BRANCH_ID");
                            ht_get_grid.Add("@Branch_Name", Branch_Name);
                            dt_get_grid = dataaccess.ExecuteSP("Sp_Daily_Status_Top_Efficiency_Calculation", ht_get_grid);


                            Ordermanagement_01.Reports.Accuracy_Detail_Section TargeDashboard = new Ordermanagement_01.Reports.Accuracy_Detail_Section(0, User_Role_Id, V_Date.ToString(), int.Parse(dt_get_grid.Rows[0]["Branch_ID"].ToString()), Fromdate, Todate);
                            TargeDashboard.Show();
                            //}
                            //else
                            //{
                            //       SplashScreenManager.CloseForm(false);
                            //}
                        }

                        //7
                        else if (Row_Value_Type == "GrandTotal" && Column_Value_Type == "GrandTotal")// this is For Row Total // this is for Single user & All Date
                        {
                            //if (V_Data != "" && V_Data != "0")
                            //{

                            Ordermanagement_01.Reports.Accuracy_Detail_Section TargeDashboard = new Ordermanagement_01.Reports.Accuracy_Detail_Section(0, User_Role_Id, "", 0, Fromdate, Todate);
                            TargeDashboard.Show();

                            //}
                            //else
                            //{
                            //    SplashScreenManager.CloseForm(false);
                            //}
                        }
                    }
                    else
                    {
                        SplashScreenManager.CloseForm(false);
                    }
                }
                else
                {
                    SplashScreenManager.CloseForm(false);
                    MessageBox.Show("Error Occured Please Check With Administrator");
                }
            }
            catch (Exception ex)
            {
                //Close Wait Form
                SplashScreenManager.CloseForm(false);
                MessageBox.Show("Error Occured Please Check With Administrator");
            }
            finally
            {
                //Close Wait Form
                SplashScreenManager.CloseForm(false);
            }
        }