Exemple #1
0
        private void gridView4_RowClick(object sender, RowClickEventArgs e)
        {
            DataTable dt = new DataTable();

            dt = _RequestList.ResultsDataTable;
            //  int DSRow = gvRequests.GetDataSourceRowIndex(e.RowHandle);
            DataRow dr = gridView4.GetFocusedDataRow();

            if (dr != null)
            {
                ReplanningTypes ReplanningTypes = new ReplanningTypes();
                replanningType  theType         = ReplanningTypes.getReplanningType(Convert.ToInt32(dr["ChangeID"].ToString()));
                switch (theType)
                {
                case replanningType.rpStopWp:
                    ucRequeststatus ucr = new ucRequeststatus();

                    // ucr.Controls.Find("btnApprove", true)[0].Enabled = true;
                    //frm1.btnApprove.Enabled = true;
                    // btnApprove.Enabled = true;
                    // focusControle1.Controls.Clear();
                    ucStopWorkplace ucStopWorkplace = new ucStopWorkplace {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();

                    //frmStatus frmst = new frmStatus();
                    // frmst.panelControl1.Controls.Clear();
                    //panelControl1.Controls.Clear();
                    //  ucStopWorkplace.Parent = panelControl1;
                    ucStopWorkplace.Parent = focusControle1;
                    ucStopWorkplace.Dock   = DockStyle.Fill;
                    ucStopWorkplace.LoadDetails(Convert.ToInt32(dr["ChangeRequestID"].ToString()));
                    // frmst.ShowDialog();
                    break;

                case replanningType.rpCrewChnages:
                    // ucRequeststatus ucr2 = new ucRequeststatus();
                    // ucr2.Controls["btnApprove"].Enabled = true;
                    //  frmPrePlanningMain frm1 = new frmPrePlanningMain();
                    //  frm1.Controls["btnApprove"].Enabled = true;
                    //ucr2.Controls.Find("btnApprove", true)[0].Enabled = true;
                    //  btnApprove.Enabled = true;
                    //focusControle1.Controls.Clear();
                    ucCrewMinerChange ucCrewMinerChange = new ucCrewMinerChange {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    //frmStatus frmst1 = new frmStatus();
                    //frmst1.panelControl1.Controls.Clear();
                    // panelControl1.Controls.Clear();
                    // ucCrewMinerChange.Parent = panelControl1;
                    ucCrewMinerChange.Parent = focusControle1;
                    ucCrewMinerChange.Dock   = DockStyle.Fill;
                    ucCrewMinerChange.LoadDetails(Convert.ToInt32(dr["ChangeRequestID"].ToString()));
                    // frmst1.ShowDialog();
                    break;

                case replanningType.rpNewWP:
                    // ucRequeststatus ucr3 = new ucRequeststatus();
                    // ucr3.Controls.Find("btnApprove", true)[0].Enabled = true;
                    //  frmPrePlanningMain frm2 = new frmPrePlanningMain();
                    //   frm2.Controls["btnApprove"].Enabled = true;
                    //  btnApprove.Enabled = true;
                    //frm1.btnApprove.Enabled = true;
                    // focusControle1.Controls.Clear();
                    ucAddWorkplace ucAddWorkplace = new ucAddWorkplace {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    //frmStatus frmst3 = new frmStatus();
                    //frmst3.panelControl1.Controls.Clear();
                    // panelControl1.Controls.Clear();
                    // ucAddWorkplace.Parent = panelControl1;
                    ucAddWorkplace.Parent = focusControle1;
                    ucAddWorkplace.Dock   = DockStyle.Fill;
                    ucAddWorkplace.LoadDetails(Convert.ToInt32(dr["ChangeRequestID"].ToString()));
                    // frmst3.ShowDialog();
                    break;

                case replanningType.rpCallCahnges:

                    // ucRequeststatus ucr4 = new ucRequeststatus();
                    //ucr4.Controls.Find("btnApprove", true)[0].Enabled  = true;
                    ucPrePlanningMain frm3 = new ucPrePlanningMain {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    // frm3.rpReplanningStatus.Ribbon.Controls["btnApprove"].Enabled = true;
                    //frm3.btnApprove.Enabled = true;
                    //   frm1.btnApprove.Enabled = true;

                    // frm3.Controls["btnApprove"].Enabled = true;
                    // btnApprove.Enabled = true;
                    // focusControle1.Controls.Clear();
                    ucPlanningValueChanges ucPlanningValueChanges = new ucPlanningValueChanges {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    //frmStatus frmst2 = new frmStatus();
                    //frmst2.panelControl1.Controls.Clear();
                    //panelControl1.Controls.Clear();
                    // ucPlanningValueChanges.Parent = panelControl1;
                    ucPlanningValueChanges.Parent = focusControle1;
                    ucPlanningValueChanges.Dock   = DockStyle.Fill;
                    ucPlanningValueChanges.LoadDetails(Convert.ToInt32(dr["ChangeRequestID"].ToString()));
                    //frm3.btnEnabled();
                    // frmst2.ShowDialog();
                    break;

                case replanningType.rpMoveWP:
                    //ucPrePlanningMain frm31 = new ucPrePlanningMain();

                    MoveBookings ucMoveBookings = new MoveBookings {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    ucMoveBookings.Parent = focusControle1;
                    ucMoveBookings.Dock   = DockStyle.Fill;
                    ucMoveBookings.LoadDetails(Convert.ToInt32(dr["ChangeRequestID"].ToString()));
                    // frm31.btnEnabled();
                    break;

                case replanningType.rpStartWP:
                    //ucPrePlanningMain frm311 = new ucPrePlanningMain();

                    StartWorkplace ucStartWP = new StartWorkplace {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    ucStartWP.Parent = focusControle1;
                    ucStartWP.Dock   = DockStyle.Fill;
                    ucStartWP.LoadDetails(Convert.ToInt32(dr["ChangeRequestID"].ToString()));
                    // frm311.btnEnabled();
                    break;

                case replanningType.rpMiningMethodChange:
                    ucPrePlanningMain frm3111 = new ucPrePlanningMain();

                    ucMiningMethodChange ucMMChange = new ucMiningMethodChange {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    ucMMChange.Parent = focusControle1;
                    ucMMChange.Dock   = DockStyle.Fill;
                    ucMMChange.LoadDetails(Convert.ToInt32(dr["ChangeRequestID"].ToString()));
                    // frm311.btnEnabled();
                    break;

                case replanningType.rpDrillRig:
                    //ucPrePlanningMain frm31111 = new ucPrePlanningMain();

                    ucDrillRiggChanges ucDRChange = new ucDrillRiggChanges {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    ucDRChange.Parent = focusControle1;
                    ucDRChange.Dock   = DockStyle.Fill;
                    ucDRChange.LoadDetails(Convert.ToInt32(dr["ChangeRequestID"].ToString()));
                    // frm311.btnEnabled();
                    break;

                case replanningType.rpDeleteWorkplace:
                    //ucPrePlanningMain frm311111 = new ucPrePlanningMain();

                    ucDeleteWorkplace ucDelete = new ucDeleteWorkplace {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    ucDelete.Parent = focusControle1;
                    ucDelete.Dock   = DockStyle.Fill;
                    ucDelete.LoadDetails(Convert.ToInt32(dr["ChangeRequestID"].ToString()));
                    // frm311.btnEnabled();
                    break;
                }
            }
            else
            {
                focusControle1.Controls.Clear();
                gcRequestList.Visible  = false;
                focusControle1.Visible = false;
                labelControl2.Visible  = false;
                Visible = false;
            }
        }
Exemple #2
0
        private void gvRequests_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)

        {
            _RequestList.ResultsDataTable.AcceptChanges();
            int DSRow = gvRequests.GetDataSourceRowIndex(e.RowHandle);

            if (DSRow >= 0)
            {
                focusControle.Controls.Clear();
                ReplanningTypes ReplanningTypes = new ReplanningTypes();
                replanningType  theType         = ReplanningTypes.getReplanningType(Convert.ToInt32(_RequestList.ResultsDataTable.Rows[DSRow]["ChangeID"].ToString()));
                switch (theType)
                {
                case replanningType.rpStopWp:
                    btnApprove.Enabled = true;
                    ucStopWorkplace ucStopWorkplace = new ucStopWorkplace();
                    focusControle.Controls.Clear();
                    ucStopWorkplace.Parent = focusControle;
                    ucStopWorkplace.Dock   = DockStyle.Fill;
                    ucStopWorkplace.LoadDetails(Convert.ToInt32(_RequestList.ResultsDataTable.Rows[DSRow]["ChangeRequestID"].ToString()));
                    break;

                case replanningType.rpCrewChnages:
                    btnApprove.Enabled = true;
                    ucCrewMinerChange ucCrewMinerChange = new ucCrewMinerChange();
                    focusControle.Controls.Clear();
                    ucCrewMinerChange.Parent = focusControle;
                    ucCrewMinerChange.Dock   = DockStyle.Fill;
                    ucCrewMinerChange.LoadDetails(Convert.ToInt32(_RequestList.ResultsDataTable.Rows[DSRow]["ChangeRequestID"].ToString()));
                    break;

                case replanningType.rpNewWP:
                    btnApprove.Enabled = true;
                    ucAddWorkplace ucAddWorkplace = new ucAddWorkplace();
                    focusControle.Controls.Clear();
                    ucAddWorkplace.Parent = focusControle;
                    ucAddWorkplace.Dock   = DockStyle.Fill;
                    ucAddWorkplace.LoadDetails(Convert.ToInt32(_RequestList.ResultsDataTable.Rows[DSRow]["ChangeRequestID"].ToString()));
                    break;

                case replanningType.rpCallCahnges:
                    btnApprove.Enabled = true;
                    ucPlanningValueChanges ucPlanningValueChanges = new ucPlanningValueChanges();
                    focusControle.Controls.Clear();
                    ucPlanningValueChanges.Parent = focusControle;
                    ucPlanningValueChanges.Dock   = DockStyle.Fill;
                    ucPlanningValueChanges.LoadDetails(Convert.ToInt32(_RequestList.ResultsDataTable.Rows[DSRow]["ChangeRequestID"].ToString()));
                    break;

                case replanningType.rpMoveWP:
                    btnApprove.Enabled = true;
                    MoveBookings ucMoveBookings = new MoveBookings();
                    focusControle.Controls.Clear();
                    ucMoveBookings.Parent = focusControle;
                    ucMoveBookings.Dock   = DockStyle.Fill;
                    ucMoveBookings.LoadDetails(Convert.ToInt32(_RequestList.ResultsDataTable.Rows[DSRow]["ChangeRequestID"].ToString()));
                    break;

                case replanningType.rpStartWP:
                    btnApprove.Enabled = true;
                    StartWorkplace StartWP = new StartWorkplace();
                    focusControle.Controls.Clear();
                    StartWP.Parent = focusControle;
                    StartWP.Dock   = DockStyle.Fill;
                    StartWP.LoadDetails(Convert.ToInt32(_RequestList.ResultsDataTable.Rows[DSRow]["ChangeRequestID"].ToString()));
                    break;
                }
            }
            else
            {
                focusControle.Controls.Clear();
                Visible = false;
            }
        }
Exemple #3
0
        public void gvRequests1_RowClick_1(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            //focusControle1.Controls.Clear();
            _RequestList1.ResultsDataTable.AcceptChanges();
            gcRequestList.DataSource = _RequestList1.ResultsDataTable;

            gvRequests.RefreshData();
            //  focusControle1.Focus();

            int DSRow = gvRequests.GetDataSourceRowIndex(e.RowHandle);

            if (DSRow >= 0)
            {
                //focusControle1.Controls.Clear();

                ReplanningTypes ReplanningTypes = new ReplanningTypes();
                replanningType  theType         = ReplanningTypes.getReplanningType(Convert.ToInt32(_RequestList1.ResultsDataTable.Rows[DSRow]["ChangeID"].ToString()));
                switch (theType)
                {
                case replanningType.rpStopWp:
                    ucRequeststatus ucr = new ucRequeststatus();

                    // ucr.Controls.Find("btnApprove", true)[0].Enabled = true;
                    //frm1.btnApprove.Enabled = true;
                    // btnApprove.Enabled = true;
                    ucStopWorkplace ucStopWorkplace = new ucStopWorkplace {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    ucStopWorkplace.Parent = focusControle1;
                    ucStopWorkplace.Dock   = DockStyle.Fill;
                    ucStopWorkplace.LoadDetails(Convert.ToInt32(_RequestList1.ResultsDataTable.Rows[DSRow]["ChangeRequestID1"].ToString()));
                    break;

                case replanningType.rpCrewChnages:
                    // ucRequeststatus ucr2 = new ucRequeststatus();
                    // ucr2.Controls["btnApprove"].Enabled = true;
                    //  frmPrePlanningMain frm1 = new frmPrePlanningMain();
                    //  frm1.Controls["btnApprove"].Enabled = true;
                    //ucr2.Controls.Find("btnApprove", true)[0].Enabled = true;
                    //  btnApprove.Enabled = true;
                    ucCrewMinerChange ucCrewMinerChange = new ucCrewMinerChange {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };

                    focusControle1.Controls.Clear();
                    ucCrewMinerChange.Parent = focusControle1;
                    ucCrewMinerChange.Dock   = DockStyle.Fill;
                    ucCrewMinerChange.LoadDetails(Convert.ToInt32(_RequestList1.ResultsDataTable.Rows[DSRow]["ChangeRequestID1"].ToString()));
                    break;

                case replanningType.rpNewWP:
                    // ucRequeststatus ucr3 = new ucRequeststatus();
                    // ucr3.Controls.Find("btnApprove", true)[0].Enabled = true;
                    //  frmPrePlanningMain frm2 = new frmPrePlanningMain();
                    //   frm2.Controls["btnApprove"].Enabled = true;
                    //  btnApprove.Enabled = true;
                    //frm1.btnApprove.Enabled = true;
                    ucAddWorkplace ucAddWorkplace = new ucAddWorkplace {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    ucAddWorkplace.Parent = focusControle1;
                    ucAddWorkplace.Dock   = DockStyle.Fill;
                    ucAddWorkplace.LoadDetails(Convert.ToInt32(_RequestList1.ResultsDataTable.Rows[DSRow]["ChangeRequestID1"].ToString()));
                    break;

                case replanningType.rpCallCahnges:

                    // ucRequeststatus ucr4 = new ucRequeststatus();
                    //ucr4.Controls.Find("btnApprove", true)[0].Enabled  = true;
                    ucPrePlanningMain frm3 = new ucPrePlanningMain();
                    // frm3.rpReplanningStatus.Ribbon.Controls["btnApprove"].Enabled = true;
                    //frm3.btnApprove.Enabled = true;
                    //   frm1.btnApprove.Enabled = true;

                    // frm3.Controls["btnApprove"].Enabled = true;
                    // btnApprove.Enabled = true;
                    ucPlanningValueChanges ucPlanningValueChanges = new ucPlanningValueChanges {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    ucPlanningValueChanges.Parent = focusControle1;
                    ucPlanningValueChanges.Dock   = DockStyle.Fill;
                    ucPlanningValueChanges.LoadDetails(Convert.ToInt32(_RequestList1.ResultsDataTable.Rows[DSRow]["ChangeRequestID1"].ToString()));
                    frm3.btnEnabled();
                    break;

                case replanningType.rpMoveWP:
                    ucPrePlanningMain frm31 = new ucPrePlanningMain();

                    MoveBookings ucMoveBookings = new MoveBookings {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    ucMoveBookings.Parent = focusControle1;
                    ucMoveBookings.Dock   = DockStyle.Fill;
                    ucMoveBookings.LoadDetails(Convert.ToInt32(_RequestList1.ResultsDataTable.Rows[DSRow]["ChangeRequestID1"].ToString()));
                    frm31.btnEnabled();
                    break;

                case replanningType.rpStartWP:
                    ucPrePlanningMain frm32 = new ucPrePlanningMain();

                    StartWorkplace StartWP = new StartWorkplace {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    StartWP.Parent = focusControle1;
                    StartWP.Dock   = DockStyle.Fill;
                    StartWP.LoadDetails(Convert.ToInt32(_RequestList1.ResultsDataTable.Rows[DSRow]["ChangeRequestID1"].ToString()));
                    frm32.btnEnabled();
                    break;

                case replanningType.rpMiningMethodChange:
                    ucPrePlanningMain frm3111 = new ucPrePlanningMain();

                    ucMiningMethodChange ucMMChange = new ucMiningMethodChange {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    ucMMChange.Parent = focusControle1;
                    ucMMChange.Dock   = DockStyle.Fill;
                    ucMMChange.LoadDetails(Convert.ToInt32(_RequestList1.ResultsDataTable.Rows[DSRow]["ChangeRequestID1"].ToString()));
                    // frm311.btnEnabled();
                    break;


                case replanningType.rpDrillRig:
                    ucPrePlanningMain frm31111 = new ucPrePlanningMain();

                    ucDrillRiggChanges ucDRChange = new ucDrillRiggChanges {
                        theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
                    };
                    focusControle1.Controls.Clear();
                    ucDRChange.Parent = focusControle1;
                    ucDRChange.Dock   = DockStyle.Fill;
                    ucDRChange.LoadDetails(Convert.ToInt32(_RequestList1.ResultsDataTable.Rows[DSRow]["ChangeRequestID1"].ToString()));
                    // frm311.btnEnabled();
                    break;
                }
            }
            else
            {
                focusControle1.Controls.Clear();
                gcRequestList.Visible  = false;
                focusControle1.Visible = false;
                labelControl2.Visible  = false;
                Visible = false;
            }
        }