private void frmPlanProtCpature_Load(object sender, EventArgs e)
        {
            updateSecurity();
            barCaptureOptions.EditValue = "1";
            captureOption          = "1";
            barProdMonth.EditValue = TProductionGlobal.ProdMonthAsDate(TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).CurrentProductionMonth.ToString());

            btnUnlockData.Enabled = true;



            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL.SetsystemDBTag     = this.theSystemDBTag;
            BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;
            if (BMEBL.get_ReviseActivity() == true)
            {
                editActitivity.DataSource    = BMEBL.ResultsDataTable;
                editActitivity.DisplayMember = "Desc";
                editActitivity.ValueMember   = "Code";
            }


            LoadSections();
        }
 public void LoadMiningMethod()
 {
     CPMBusinessLayer.clsBusinessLayer bl = new CPMBusinessLayer.clsBusinessLayer();
     bl.SetsystemDBTag     = this.systemDBTag;
     bl.SetUserCurrentInfo = this.UserCurrentInfo;
     tblMiningMethods      = bl.getMiningMethods(Activity);
 }
        private void frmResavePlanningProtocol_Load(object sender, EventArgs e)
        {
            //string ThePath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData);
            //string path = string.Format(@"{0}\{1}_{2}.txt", ThePath, r["Prodmonth"], r["WorkPlaceID"]);

            //MessageBox.Show(ThePath);

            mwProdmonthEdit1.EditValue = TProductionGlobal.ProdMonthAsDate(TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).CurrentProductionMonth.ToString());

            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType = CPMBusinessLayer.ReturnType.DataTable;

            BMEBL.SetsystemDBTag     = this.theSystemDBTag;
            BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;
            if (BMEBL.get_Activity() == true)
            {
                //  this.tscbShaft.Items.Add("MINE");
                editActivity.Properties.DataSource    = BMEBL.ResultsDataTable;
                editActivity.Properties.DisplayMember = "Desc";
                editActivity.Properties.ValueMember   = "Code";
                editActivity.ItemIndex = 0;
            }

            updateSections(TProductionGlobal.ProdMonthAsString(Convert.ToDateTime(mwProdmonthEdit1.EditValue)), editActivity.EditValue.ToString());
            DataStructure();
        }
        private void ucGradeReport_Load(object sender, EventArgs e)
        {
            reportSettings.ReportDate       = DateTime.Now;
            reportSettings.Paylimit         = 1330;
            reportSettings.ShiftsNo         = 2;
            reportSettings.CutOffGrade      = 860;
            reportSettings.useShiftsDefault = true;
            reportSettings.useShifts        = false;
            reportSettings.TopPanels        = "Gold";

            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType = CPMBusinessLayer.ReturnType.DataTable;

            BMEBL.SetsystemDBTag     = this.theSystemDBTag;
            BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;

            DataTable dtActivityData = BMEBL.GetActivity();

            rpActivity.DataSource    = dtActivityData;
            rpActivity.DisplayMember = "Description";
            rpActivity.ValueMember   = "Activity";

            setScreenSelection();

            pgGradeReport.SelectedObject = reportSettings;
        }
        public void StopWorkplace(String WorkplaceID, int ProdMonth, string SectionID, string SectionID_2)
        {
            txtWorkplaceID.Text = WorkplaceID;
            txtProdMonth.Text   = Convert.ToString(ProdMonth);
            theSectionID        = SectionID;
            theSectionID_2      = SectionID_2;
            _clChnageOfPlanData.SetProdMonth(Convert.ToInt32(ProdMonth));
            _clChnageOfPlanData.SetWorkplaceID(WorkplaceID);
            _clChnageOfPlanData.SetSectionID(SectionID);
            _clChnageOfPlanData.SetSectionID_2(SectionID_2);
            _clChnageOfPlanData.SetRequestType((int)replanningType.rpStartWP);

            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL.SetsystemDBTag     = this.theSystemDBTag;
            BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;
            DataTable theDates = new DataTable();

            if (BMEBL.get_BeginEndDates(SectionID_2, ProdMonth.ToString()) == true)
            {
                theDates = BMEBL.ResultsDataTable;
            }

            DateTime theBeginDate = new DateTime();
            DateTime theEndDate   = new DateTime();

            foreach (DataRow r in theDates.Rows)
            {
                theBeginDate = Convert.ToDateTime(r["StartDate"].ToString());
                theEndDate   = Convert.ToDateTime(r["EndDate"].ToString());
            }


            dateStart.Properties.MaxValue = theEndDate;
            dateStart.Properties.MinValue = theBeginDate;

            MWDataManager.clsDataAccess _WPData = new MWDataManager.clsDataAccess();
            _WPData.ConnectionString   = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _WPData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _WPData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _WPData.SqlStatement       = "SELECT * FROM WORKPLACE WHERE WORKPLACEID = '" + WorkplaceID + "'";
            _WPData.ExecuteInstruction();

            foreach (DataRow r in _WPData.ResultsDataTable.Rows)
            {
                txtWorkplaceName.Text = r["DESCRIPTION"].ToString();
            }

            _WPData.SqlStatement = "SELECT DISTINCT Name_2  FROM dbo.SECTION_COMPLETE WHERE PRODMONTH = '" + Convert.ToString(ProdMonth) + "' AND SECTIONID_2 = '" + SectionID_2 + "'";
            _WPData.ExecuteInstruction();

            foreach (DataRow r in _WPData.ResultsDataTable.Rows)
            {
                txtSection.Text = r["Name_2"].ToString();
                // _clChnageOfPlanData.SetSectionID(Convert.ToInt32(txtSection.EditValue));
            }

            loadCurrentValues(WorkplaceID, ProdMonth, SectionID, SectionID_2, false);
        }
 private void LoadSundryMiningDescription()
 {
     CPMBusinessLayer.clsBusinessLayer bl = new CPMBusinessLayer.clsBusinessLayer();
     bl.SetsystemDBTag          = this.theSystemDBTag;
     bl.SetUserCurrentInfo      = this.UserCurrentInfo;
     SundryMining.DataSource    = bl.getSundryMiningActivity(2);
     SundryMining.DisplayMember = "SMDescription";
     SundryMining.ValueMember   = "SMDescription";
 }
 private void LoadMiningMethod()
 {
     CPMBusinessLayer.clsBusinessLayer bl = new CPMBusinessLayer.clsBusinessLayer();
     bl.SetsystemDBTag        = this.theSystemDBTag;
     bl.SetUserCurrentInfo    = this.UserCurrentInfo;
     reActivity.DataSource    = bl.getMiningMethods(2);
     reActivity.DisplayMember = "Description";
     reActivity.ValueMember   = "TargetID";
 }
        private void ucPlannedVsBooked_Load(object sender, EventArgs e)
        {
            try
            {
                reportSettings.Type      = "Tons";
                reportSettings.ShowType  = "Both";
                reportSettings.CastType  = "Both";
                reportSettings.MSType    = "All";
                reportSettings.WhatMonth = "Production Month";
                CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
                BMEBL._queryReturnType = CPMBusinessLayer.ReturnType.DataTable;

                BMEBL.SetsystemDBTag     = this.theSystemDBTag;
                BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;

                DataTable dtActivityData = BMEBL.GetActivityReports();

                rpActivity.DataSource    = dtActivityData;
                rpActivity.DisplayMember = "Desc";
                rpActivity.ValueMember   = "Code";

                reportSettings.UserCurrentInfo = this.UserCurrentInfo;
                reportSettings.systemDBTag     = this.theSystemDBTag;

                reportSettings.pmonth = TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).CurrentProductionMonth.ToString();
                int      theYear  = Convert.ToInt32(reportSettings.pmonth.Substring(0, 4));
                int      theMonth = Convert.ToInt32(reportSettings.pmonth.Substring(4, 2));
                DateTime theDate  = new DateTime(theYear, theMonth, 1);
                reportSettings.Prodmonth = theDate.Date;

                reportSettings.UpdateSumOnRequest += reportSettings_UpdateSumOnRequest;
                reportSettings.Showuntil           = DateTime.Now;
                iShowuntil.Properties.Value        = reportSettings.Showuntil;

                reportSettings.Desc         = "0";
                iProdmonth.Properties.Value = reportSettings.Prodmonth.ToString();

                DataTable dtSectionData = new DataTable();

                if (BMEBL.GetPlanSectionsAndNameADO(reportSettings.pmonth) == true)
                {
                    dtSectionData             = BMEBL.ResultsDataTable;
                    rpSectionid.DataSource    = BMEBL.ResultsDataTable;
                    rpSectionid.DisplayMember = "NAME";
                    rpSectionid.ValueMember   = "NAME";
                }
                reportSettings.NAME = dtSectionData.Rows[0]["NAME"].ToString();
                pgPlanVsBookSettings.SelectedObject = reportSettings;
            }
            catch (Exception)
            {
                throw;
            }
        }
        private void ucRevisedPlanningAuditReport_Load(object sender, EventArgs e)
        {
            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType       = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL.SetsystemDBTag         = this.theSystemDBTag;
            BMEBL.SetUserCurrentInfo     = this.UserCurrentInfo;
            reportSettings.FromProdmonth = TProductionGlobal.ProdMonthAsDate(TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).CurrentProductionMonth.ToString());
            reportSettings.ToProdmonth   = TProductionGlobal.ProdMonthAsDate(TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).CurrentProductionMonth.ToString());

            DataTable section = new DataTable();

            if (BMEBL.GetPlanSectionsAndNameADO(TProductionGlobal.ProdMonthAsString(reportSettings.FromProdmonth)) == true)
            {
                section = BMEBL.ResultsDataTable;
                rpSection.DataSource    = BMEBL.ResultsDataTable;
                rpSection.DisplayMember = "NAME";
                rpSection.ValueMember   = "sectionid";
            }
            reportSettings.sectionid           = section.Rows[0]["sectionid"].ToString();
            reportSettings.RevisedPlanningType = "All";

            MWDataManager.clsDataAccess _RevisedOptions = new MWDataManager.clsDataAccess();

            _RevisedOptions.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _RevisedOptions.SqlStatement     = "SELECT 0 Code, 'All' [RevisedPlanningType] " +
                                               "UNION " +
                                               "SELECT 1 Code, 'Stop Workplace' [RevisedPlanningType] " +
                                               "union " +
                                               "select 2 Code, 'New Workplace' [RevisedPlanningType] " +
                                               "union " +
                                               "select 3 Code, 'Crew Miner Changes' [RevisedPlanningType] " +
                                               "union " +
                                               "select 4 Code, 'Call Changes' [RevisedPlanningType] " +
                                               "union " +
                                               "select 5 Code, 'Move Planning' [RevisedPlanningType] " +
                                               "union " +
                                               "select 6 Code, 'Start Workplace' [RevisedPlanningType] " +
                                               "union " +
                                               "select 7 Code, 'Mining Method Change' [RevisedPlanningType] " +
                                               "union " +
                                               "select 8 Code, 'Drill Rig Change' [RevisedPlanningType] " +
                                               "union " +
                                               "select 9 Code, 'Delete Planning' [RevisedPlanningType] ";

            _RevisedOptions.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;

            _RevisedOptions.queryReturnType = MWDataManager.ReturnType.DataTable;
            _RevisedOptions.ExecuteInstruction();
            rpRevisedPlanningType.DataSource      = _RevisedOptions.ResultsDataTable;
            rpRevisedPlanningType.DisplayMember   = "RevisedPlanningType";
            rpRevisedPlanningType.ValueMember     = "RevisedPlanningType";
            pgRevisedPlanningAudit.SelectedObject = reportSettings;
        }
 public void updateSections(string prodMonth, string activity)
 {
     CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
     BMEBL._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
     BMEBL.SetsystemDBTag     = this.theSystemDBTag;
     BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;
     if (BMEBL.get_SectionsReportsNotSaved(prodMonth, activity) == true)
     {
         //  this.tscbShaft.Items.Add("MINE");
         lcSections.DataSource    = BMEBL.ResultsDataTable;
         lcSections.DisplayMember = "NAME";
         lcSections.ValueMember   = "SECTIONID";
     }
 }
        private void setSections()
        {
            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL.SetsystemDBTag     = this.theSystemDBTag;
            BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;

            if (BMEBL.get_Sections(Convert.ToString(prodmonth1.EditValue), TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).MOHierarchicalID.ToString()) == true)
            {
                editSection.DataSource    = BMEBL.ResultsDataTable;
                editSection.DisplayMember = "Name";
                editSection.ValueMember   = "SectionID";
            }
        }
        public void updateSections(int prodMonth)
        {
            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL.SetsystemDBTag     = this.theSystemDBTag;
            BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;

            if (BMEBL.get_Sections(Convert.ToString(prodMonth), TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).MOHierarchicalID.ToString()) == true)
            {
                editMineoverseer1.DataSource    = BMEBL.ResultsDataTable;
                editMineoverseer1.DisplayMember = "Name";
                editMineoverseer1.ValueMember   = "Name";
            }
        }
        private void AddWorkplace(string WPDesc)
        {
            MWDataManager.clsDataAccess _NewWorkPlace = new MWDataManager.clsDataAccess();
            _NewWorkPlace.ConnectionString = TConnections.GetConnectionString(systemDBTag, UserCurrentInfo.Connection);

            _NewWorkPlace.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;
            _NewWorkPlace.queryReturnType    = MWDataManager.ReturnType.DataTable;
            // _NewWorkPlace.SqlStatement = "spAddPrePlanningWorkPlace";
            _NewWorkPlace.SqlStatement = "sp_PrePlanning_AddWorkplace";


            SqlParameter[] _paramCollection =
            {
                _NewWorkPlace.CreateParameter("@Prodmonth",     SqlDbType.Int,       0, Convert.ToInt32(PlanningSettings.ProdMonth)),
                _NewWorkPlace.CreateParameter("@Sectionid_2",   SqlDbType.VarChar,  20, PlanningSettings.MOSectionID),
                _NewWorkPlace.CreateParameter("@WPDESCRIPTION", SqlDbType.VarChar, 100, WPDesc),
                _NewWorkPlace.CreateParameter("@ActivityCode",  SqlDbType.Int,       0, PlanningSettings.ActivityID),
            };

            _NewWorkPlace.ParamCollection = _paramCollection;
            clsDataResult exr = _NewWorkPlace.ExecuteInstruction();

            if (exr.success == false)
            {
                MessageBox.Show(exr.Message);
            }

            if (_NewWorkPlace.ResultsDataTable.Rows.Count != 0)
            {
                CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
                BMEBL._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
                BMEBL.SetsystemDBTag     = systemDBTag;
                BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;

                //  DataTable theDates = new DataTable();
                if (BMEBL.get_BeginEndDates(PlanningSettings.MOSectionID, PlanningSettings.ProdMonth) == true)
                {
                    theDates = BMEBL.ResultsDataTable;
                }

                if (_NewWorkPlace.ResultsDataTable.Rows.Count > 0)
                {
                    foreach (DataRow r in _NewWorkPlace.ResultsDataTable.Rows)
                    {
                        tblPlanningData.ImportRow(r);
                    }
                }
            }
        }
        private void ucProblemAnalysisReport_Load(object sender, EventArgs e)
        {
            ActiveReport.UserCurrentInfo = this.UserCurrentInfo;
            reportSettings.FromProdmonth = TProductionGlobal.ProdMonthAsDate(TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).CurrentProductionMonth.ToString());
            reportSettings.ToProdmonth   = TProductionGlobal.ProdMonthAsDate(TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).CurrentProductionMonth.ToString());
            reportSettings.FromDate      = TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).Rundate;
            reportSettings.ToDate        = TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).Rundate;

            reportSettings.Period    = "Prodmonth";
            reportSettings.Sections  = "Single";
            reportSettings.Activity  = "Stoping";
            reportSettings.Type      = "ProbDesc";
            reportSettings.GraphInfo = "Potential";

            reportSettings.Available = GetAvailableList();

            reportSettings.Details      = false;
            reportSettings.DetailsGraph = false;
            reportSettings.TrendGraph   = false;
            reportSettings.PerShaft     = false;
            reportSettings.LostBlasts   = false;
            iFromProdmonth.Visible      = true;
            iToProdmonth.Visible        = true;
            iToDate.Visible             = false;
            iFromDate.Visible           = false;

            iSectionSelect.Enabled = false;

            GetAvailableData();

            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL.SetsystemDBTag     = this.theSystemDBTag;
            BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;

            _pmonth = TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).CurrentProductionMonth.ToString();

            DataTable section = new DataTable();

            if (BMEBL.GetPlanSectionsAndNameADO(_pmonth) == true)
            {
                section = BMEBL.ResultsDataTable;
                riSectionSingle.DataSource    = BMEBL.ResultsDataTable;
                riSectionSingle.DisplayMember = "NAME";
                riSectionSingle.ValueMember   = "NAME";
            }
            reportSettings.NAME = section.Rows[0]["NAME"].ToString();
            pgProblemAnalysis.SelectedObject = reportSettings;
        }
        public void DeleteWorkplace(string WorkplaceID, int ProdMonth, string SectionID, string SectionID_2, int activity)
        {
            theActivity         = activity;
            txtWorkplaceID.Text = WorkplaceID;
            txtProdMonth.Text   = Convert.ToString(ProdMonth);
            theSectionID        = SectionID;
            theSectionID_2      = SectionID_2;
            _clChnageOfPlanData.SetSectionID(SectionID);
            _clChnageOfPlanData.SetSectionID_2(SectionID_2);
            _clChnageOfPlanData.SetProdMonth(Convert.ToInt32(txtProdMonth.Text));
            _clChnageOfPlanData.SetWorkplaceID(txtWorkplaceID.Text);
            _clChnageOfPlanData.SetRequestType((int)replanningType.rpDeleteWorkplace);

            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType = CPMBusinessLayer.ReturnType.DataTable;
            DataTable theDates = new DataTable();

            BMEBL.SetsystemDBTag     = theSystemDBTag;
            BMEBL.SetUserCurrentInfo = UserCurrentInfo;

            MWDataManager.clsDataAccess _WPData = new MWDataManager.clsDataAccess();
            _WPData.ConnectionString   = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _WPData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _WPData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _WPData.SqlStatement       = "SELECT * FROM WORKPLACE WHERE WORKPLACEID = '" + WorkplaceID + "'";
            _WPData.ExecuteInstruction();

            foreach (DataRow r in _WPData.ResultsDataTable.Rows)
            {
                txtWorkplaceName.Text = r["DESCRIPTION"].ToString();
            }

            _WPData.SqlStatement = "SELECT DISTINCT Name_2  FROM dbo.SECTION_COMPLETE WHERE PRODMONTH = '" + Convert.ToString(ProdMonth) + "' AND SECTIONID_2 = '" + SectionID_2 + "'";
            _WPData.ExecuteInstruction();

            foreach (DataRow r in _WPData.ResultsDataTable.Rows)
            {
                txtSection.Text = r["Name_2"].ToString();
            }


            CPMBusinessLayer.clsBusinessLayer BMEBL1 = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL1._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL1.SetsystemDBTag     = this.theSystemDBTag;
            BMEBL1.SetUserCurrentInfo = this.UserCurrentInfo;

            loadCurrentValues(WorkplaceID, ProdMonth, SectionID, SectionID_2, false);
        }
Exemple #16
0
        private void editRovingCrew_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL.SetsystemDBTag = this.theSystemDBTag;
            BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;
            if (BMEBL.get_reOrgDaySelection(theProdmonth, theSectionID_2) == true)
            {

                editRovingCrew.Properties.DataSource = BMEBL.ResultsDataTable;
                editRovingCrew.Properties.DisplayMember = "Crew_Org";
                editRovingCrew.Properties.ValueMember = "Crew_Org";

            }
            editRovingCrew.Text = editRovingCrew.SelectedText;
        }
Exemple #17
0
        public void LoadSections()
        {
            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType = CPMBusinessLayer.ReturnType.DataTable;

            BMEBL.SetsystemDBTag     = this.theSystemDBTag;
            BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;

            DataTable dtSectionData = new DataTable();

            if (BMEBL.GetPlanSectionsAndNameADO(TProductionGlobal.ProdMonthAsString(reportSettings.Prodmonth)) == true)
            {
                dtSectionData           = BMEBL.ResultsDataTable;
                riSection.DataSource    = BMEBL.ResultsDataTable;
                riSection.DisplayMember = "NAME";
                riSection.ValueMember   = "sectionid";
            }
            reportSettings.NAME = dtSectionData.Rows[0]["sectionid"].ToString();
        }
        /// <summary>
        /// Updates the sections list for the selected production month
        /// </summary>
        public void updateSections()
        {
            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL.SetsystemDBTag     = systemDBTag;
            BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;

            List <string> Thelist = TProductionGlobal.getUserInfo(UserCurrentInfo.Connection).PlanBookSections;

            DataTable          _SectionResult = new DataTable();
            GetSectionsAndName theData        = new GetSectionsAndName();

            theData.theSystemDBTag  = systemDBTag;
            theData.UserCurrentInfo = UserCurrentInfo;

            List <string> sections = TProductionGlobal.getUserInfo(UserCurrentInfo.Connection).PlanBookSections;

            foreach (string item in sections)
            {
                MWDataManager.clsDataAccess temp = theData.theSectionsAndName(_prodMonth, item, TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).MOHierarchicalID);
                temp.ExecuteInstruction();
                if (temp.ResultsDataTable.Rows.Count != 0)
                {
                    if (_SectionResult.Columns.Count == 0)
                    {
                        _SectionResult = temp.ResultsDataTable.Clone();
                    }
                    _SectionResult.Merge(temp.ResultsDataTable);
                }
            }

            tblSections = _SectionResult;


            //}

            //if (BMEBL.get_Sections(Convert.ToString(_prodMonth), TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).MOHierarchicalID.ToString()) == true)
            //{
            //    tblSections = BMEBL.ResultsDataTable.Clone();
            //    tblSections = BMEBL.ResultsDataTable.Copy();
            //}
        }
        /// <summary>
        /// Gest the current sections calendar dates start and end
        /// </summary>
        public clsResults ValidateSectionCalender()
        {
            clsResults theResults = new clsResults();

            tblSectionStartEndDates = new DataTable();
            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType = CPMBusinessLayer.ReturnType.DataTable;

            BMEBL.SetsystemDBTag     = systemDBTag;
            BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;

            if (BMEBL.get_MinerSectionStartEndDates(PlanningSettings.ProdMonth, PlanningSettings.MOSectionID) == true)
            {
                tblSectionStartEndDates = BMEBL.ResultsDataTable;
            }

            if (tblSectionStartEndDates != null && tblSectionStartEndDates.Rows.Count > 0)
            {
                foreach (DataRow r in tblSectionStartEndDates.Rows)
                {
                    if (r["StartDate"].ToString() != "") // test if dates are valid
                    {
                        theBeginDate           = Convert.ToDateTime(r["StartDate"].ToString());
                        theEndDate             = Convert.ToDateTime(r["EndDate"].ToString());
                        theResults.Successfull = true;
                    }
                    else
                    {
                        theResults.Successfull = false;
                        theResults.Message.AppendLine("The calendars for the selected section is invalid");
                    }
                }
            }
            else
            {
                theResults.Successfull = false;
                theResults.Message.AppendLine("The calendars for the selected section is invalid");
            }

            return(theResults);
        }
Exemple #20
0
        private void MOEdit_EditValueChanged(object sender, EventArgs e)
        {
            if (theNewSectionID_2 != MOEdit.EditValue.ToString())
            {
                theNewSectionID_2 = MOEdit.EditValue.ToString();

                DataTable dt = getMinerList();
                editMiner1.Properties.DataSource    = dt;
                editMiner1.Properties.ValueMember   = "SECTIONID";
                editMiner1.Properties.DisplayMember = "Name";

                CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
                BMEBL._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
                BMEBL.SetsystemDBTag     = this.theSystemDBTag;
                BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;

                if (BMEBL.get_reOrgDaySelection(theProdmonth, theNewSectionID_2) == true)
                {
                    // editDay1.Properties.DataSource = BMEBL.ResultsDataTable;
                    dtaftercrew = BMEBL.ResultsDataTable;
                    editAfternoon1.Properties.DataSource    = dtaftercrew;
                    editAfternoon1.Properties.DisplayMember = "Crew_Org";
                    editAfternoon1.Properties.ValueMember   = "Crew_Org";

                    dtnightcrew = BMEBL.ResultsDataTable;
                    editNight1.Properties.DataSource    = dtnightcrew;
                    editNight1.Properties.DisplayMember = "Crew_Org";
                    editNight1.Properties.ValueMember   = "Crew_Org";

                    dtrovingcrew = BMEBL.ResultsDataTable;
                    editRoming1.Properties.DataSource    = dtrovingcrew;
                    editRoming1.Properties.DisplayMember = "Crew_Org";
                    editRoming1.Properties.ValueMember   = "Crew_Org";
                }

                CPMBusinessLayer.clsBusinessLayer BMEBL1 = new CPMBusinessLayer.clsBusinessLayer();
                BMEBL1._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
                BMEBL1.SetsystemDBTag     = this.theSystemDBTag;
                BMEBL1.SetUserCurrentInfo = this.UserCurrentInfo;
                if (BMEBL1.get_reOrgDaySelection(theProdmonth, theNewSectionID_2) == true)
                {
                    DataRow[] rows = BMEBL1.ResultsDataTable.Select("Crew_Org=''");
                    BMEBL1.ResultsDataTable.Rows.Remove(rows[0]);
                    //DataRow[] rows1 = BMEBL.ResultsDataTable.Select("Crew_Org='Contractor'");
                    //BMEBL.ResultsDataTable.Rows.Remove(rows1[0]);
                    dtdaycrew = BMEBL1.ResultsDataTable;
                    editDay1.Properties.DataSource    = dtdaycrew;
                    editDay1.Properties.DisplayMember = "Crew_Org";
                    editDay1.Properties.ValueMember   = "Crew_Org";
                }
                editDay1.Text       = editDay1.SelectedText;
                editNight1.Text     = editNight1.SelectedText;
                editAfternoon1.Text = editAfternoon1.SelectedText;
                editRoming1.Text    = editRoming1.SelectedText;


                editMiner1.EditValue     = dt.Rows[0][0].ToString();
                editDay1.EditValue       = null;
                editAfternoon1.EditValue = null;
                editNight1.EditValue     = null;
                editRoming1.EditValue    = null;
            }
        }
Exemple #21
0
        public void addWorkplace(String WorkplaceID, int ProdMonth, string SectionID, string SectionID_2, int Activity)
        {
            MWDataManager.clsDataAccess _WPData = new MWDataManager.clsDataAccess();
            _WPData.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _WPData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _WPData.queryReturnType = MWDataManager.ReturnType.DataTable;

            theActivity = Activity;
            theProdmonth = ProdMonth;
            theSectionID_2 = SectionID_2;
            theWorkPlaceID = WorkplaceID;
            theSectionID = SectionID;

            _clChnageOfPlanData.SetSectionID(SectionID );
            _clChnageOfPlanData.SetProdMonth(Convert.ToInt32 (ProdMonth ));
            _clChnageOfPlanData.SetSectionID_2(SectionID_2);
            _clChnageOfPlanData.SetWorkplaceID(WorkplaceID);
            _clChnageOfPlanData.SetRequestType((int)replanningType.rpNewWP);

            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL.SetsystemDBTag = this.theSystemDBTag;
            BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;
            DataTable theDates = new DataTable();
            if (BMEBL.get_BeginEndDates(SectionID_2, ProdMonth.ToString()) == true)
            {

                theDates = BMEBL.ResultsDataTable;
            }

            DateTime theBeginDate = new DateTime();
            DateTime theEndDate = new DateTime();

            foreach (DataRow r in theDates.Rows)
            {
                theBeginDate = Convert.ToDateTime(r["StartDate"].ToString());
                theEndDate = Convert.ToDateTime(r["EndDate"].ToString());

            }

            editStartDate.Properties.MaxValue = theEndDate;
            editStartDate.Properties.MinValue = theBeginDate;

            CPMBusinessLayer.clsBusinessLayer BMEBL1 = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL1._queryReturnType = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL1.SetsystemDBTag = this.theSystemDBTag;
            BMEBL1.SetUserCurrentInfo = this.UserCurrentInfo;
            editMiningMethod.Properties.DataSource = BMEBL1.getMiningMethods(theActivity);
            editMiningMethod.Properties.ValueMember = "TargetID";//TargetID
            editMiningMethod.Properties.DisplayMember = "Description";



            // theSectionIDMO = SectionIDMO;
            editWorkplace.Properties.DataSource = getWorkplaceList();
            editWorkplace.Properties.ValueMember = "WORKPLACEID";
            //editWorkplace.Properties.ValueMember = "Workplaceid";
            editWorkplace.Properties.DisplayMember = "DESCRIPTION";

            editMiner.Properties.DataSource = getMinerList();
            editMiner.Properties.ValueMember = "SECTIONID";
            editMiner.Properties.DisplayMember = "Name";




            string prodmonth = Convert.ToString(theProdmonth);
            editPeodMonth.Text = prodmonth;

            _WPData.SqlStatement = "SELECT DISTINCT Name_2 FROM dbo.SECTION_COMPLETE WHERE PRODMONTH = '" + Convert.ToString(ProdMonth) + "' AND SECTIONID_2 = '" + SectionID_2 + "'";
            _WPData.ExecuteInstruction();

            foreach (DataRow r in _WPData.ResultsDataTable.Rows)
            {
                editSection.Text = r["Name_2"].ToString();
            }

            _WPData.SqlStatement = "SELECT * FROM WORKPLACE WHERE WORKPLACEID = '" + editWorkplace .EditValue  + "'";
            _WPData.ExecuteInstruction();



            foreach (DataRow r in _WPData.ResultsDataTable.Rows)
            {
                editFaceLength.Text = r["FL"].ToString();
            }
            _clChnageOfPlanData.SetActivity(Activity);
            loadCurrentValues(ProdMonth, SectionID, SectionID_2, WorkplaceID, Activity, false);

        }
Exemple #22
0
        public void changecrew(String WorkplaceID, int ProdMonth, string SectionID, string SectionID_2, int activity)
        {
            txtProdMonth.Text = Convert.ToString(ProdMonth);
            theSectionID      = SectionID;
            theWorkplaceID    = WorkplaceID;
            theProdmonth      = ProdMonth;
            theSectionID_2    = SectionID_2;
            theNewSectionID_2 = SectionID_2;

            MOEdit.Properties.DataSource    = getMOList();
            MOEdit.Properties.ValueMember   = "SectionID";
            MOEdit.Properties.DisplayMember = "MO";

            MOEdit.EditValue = theSectionID_2;
            editMiner1.Properties.DataSource    = getMinerList();
            editMiner1.Properties.ValueMember   = "SECTIONID";
            editMiner1.Properties.DisplayMember = "Name";

            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL.SetsystemDBTag     = this.theSystemDBTag;
            BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;
            if (BMEBL.get_reOrgDaySelection(theProdmonth, theNewSectionID_2) == true)
            {
                // editDay1.Properties.DataSource = BMEBL.ResultsDataTable;
                dtaftercrew = BMEBL.ResultsDataTable;
                editAfternoon1.Properties.DataSource    = dtaftercrew;
                editAfternoon1.Properties.DisplayMember = "Crew_Org";
                editAfternoon1.Properties.ValueMember   = "Crew_Org";

                dtnightcrew = BMEBL.ResultsDataTable;
                editNight1.Properties.DataSource    = dtnightcrew;
                editNight1.Properties.DisplayMember = "Crew_Org";
                editNight1.Properties.ValueMember   = "Crew_Org";

                dtrovingcrew = BMEBL.ResultsDataTable;
                editRoming1.Properties.DataSource    = dtrovingcrew;
                editRoming1.Properties.DisplayMember = "Crew_Org";
                editRoming1.Properties.ValueMember   = "Crew_Org";
            }

            CPMBusinessLayer.clsBusinessLayer BMEBL1 = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL1._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL1.SetsystemDBTag     = this.theSystemDBTag;
            BMEBL1.SetUserCurrentInfo = this.UserCurrentInfo;
            if (BMEBL1.get_reOrgDaySelection(theProdmonth, theNewSectionID_2) == true)
            {
                DataRow[] rows = BMEBL1.ResultsDataTable.Select("Crew_Org=''");
                BMEBL1.ResultsDataTable.Rows.Remove(rows[0]);
                dtdaycrew = BMEBL1.ResultsDataTable;
                editDay1.Properties.DataSource    = dtdaycrew;
                editDay1.Properties.DisplayMember = "Crew_Org";
                editDay1.Properties.ValueMember   = "Crew_Org";
            }
            editDay1.Text       = editDay1.SelectedText;
            editNight1.Text     = editNight1.SelectedText;
            editAfternoon1.Text = editAfternoon1.SelectedText;
            editRoming1.Text    = editRoming1.SelectedText;



            theActivity = activity;
            MWDataManager.clsDataAccess _WPData = new MWDataManager.clsDataAccess();
            _WPData.ConnectionString   = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _WPData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _WPData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _WPData.SqlStatement       = "SELECT * FROM WORKPLACE WHERE WORKPLACEID = '" + WorkplaceID + "'";
            _WPData.ExecuteInstruction();



            _WPData.SqlStatement = "SELECT * FROM PLANMONTH WHERE Workplaceid = '" + WorkplaceID + "' and Prodmonth='" + ProdMonth + "'";
            _WPData.ExecuteInstruction();

            foreach (DataRow r in _WPData.ResultsDataTable.Rows)
            {
                txtDay.Text       = r["OrgUnitDay"].ToString();
                txtNight.Text     = r["OrgUnitNight"].ToString();
                txtAfternoon.Text = r["OrgUnitAfternoon"].ToString();
                txtRoving.Text    = r["RomingCrew"].ToString();

                editDay1.Properties.NullText = "";
                editDay1.EditValue           = r["OrgUnitDay"].ToString();
                _clChnageOfPlanData.SetDayCrew(r["OrgUnitDay"].ToString());
                editNight1.Properties.NullText = "";
                editNight1.EditValue           = r["OrgUnitNight"].ToString();
                _clChnageOfPlanData.SetNightCrew(r["OrgUnitNight"].ToString());
                editAfternoon1.Properties.NullText = "";
                editAfternoon1.EditValue           = r["OrgUnitAfternoon"].ToString();
                _clChnageOfPlanData.SetAfternoonCrew(r["OrgUnitAfternoon"].ToString());
                editRoming1.Properties.NullText = "";
                editRoming1.EditValue           = r["RomingCrew"].ToString();
                _clChnageOfPlanData.SetRovingCrew(r["RomingCrew"].ToString());
            }

            loadCurrentValues(WorkplaceID, ProdMonth, SectionID, SectionID_2, false);
        }
        public void MoveBooking(String WorkplaceID, int ProdMonth, string SectionID, string SectionID_2, int activity)
        {
            textEdit2.Text = Convert.ToString(ProdMonth);
            textEdit2.Properties.ReadOnly = true;
            theSectionID   = SectionID;
            theWorkplaceID = WorkplaceID;
            theProdmonth   = ProdMonth;
            theSectionID_2 = SectionID_2;
            theActivity    = activity;



            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL.SetsystemDBTag     = this.theSystemDBTag;
            BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;



            CPMBusinessLayer.clsBusinessLayer BMEBL1 = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL1._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL1.SetsystemDBTag     = this.theSystemDBTag;
            BMEBL1.SetUserCurrentInfo = this.UserCurrentInfo;
            editMiningMethod.Properties.DataSource    = BMEBL1.getMiningMethods(theActivity);
            editMiningMethod.Properties.ValueMember   = "TargetID";//TargetID
            editMiningMethod.Properties.DisplayMember = "Description";



            MWDataManager.clsDataAccess _WPData = new MWDataManager.clsDataAccess();
            _WPData.ConnectionString   = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _WPData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _WPData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _WPData.SqlStatement       = "SELECT * FROM WORKPLACE WHERE WORKPLACEID = '" + WorkplaceID + "'";
            _WPData.ExecuteInstruction();


            editToWorkplace.Properties.DataSource    = getWorkplaceList();
            editToWorkplace.Properties.ValueMember   = "WORKPLACEID";
            editToWorkplace.Properties.DisplayMember = "DESCRIPTION";



            foreach (DataRow r in _WPData.ResultsDataTable.Rows)
            {
                textEdit1.Text = r["DESCRIPTION"].ToString();
                textEdit1.Properties.ReadOnly = true;
            }

            _WPData.SqlStatement = "SELECT * FROM PLANMONTH WHERE Workplaceid = '" + WorkplaceID + "' and Prodmonth='" + theProdmonth + "' and Sectionid= '" + theSectionID + "' AND PLANCODE='MP'";
            _WPData.ExecuteInstruction();

            foreach (DataRow r in _WPData.ResultsDataTable.Rows)
            {
                theActivity = Convert.ToInt32(r["Activity"].ToString());
                switch (Convert.ToInt32(r["Activity"].ToString()))
                {
                case 0:
                    layoutControlItem4.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                    break;

                case 1:
                    layoutControlItem4.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                    break;
                }

                daycrew       = r["OrgUnitDay"].ToString();;
                nightcrew     = r["OrgUnitNight"].ToString();
                afternooncrew = r["OrgUnitAfternoon"].ToString();
                roamingcrew   = r["RomingCrew"].ToString();
            }



            loadCurrentValues(WorkplaceID, ProdMonth, SectionID, SectionID_2, false);
        }
        public void DrillRig(string WorkplaceID, int ProdMonth, string SectionID, string SectionID_2, int activity)
        {
            theActivity         = activity;
            txtWorkplaceID.Text = WorkplaceID;
            txtProdMonth.Text   = Convert.ToString(ProdMonth);
            theSectionID        = SectionID;
            theSectionID_2      = SectionID_2;
            _clChnageOfPlanData.SetSectionID(SectionID);
            _clChnageOfPlanData.SetSectionID_2(SectionID_2);
            _clChnageOfPlanData.SetProdMonth(Convert.ToInt32(txtProdMonth.Text));
            _clChnageOfPlanData.SetWorkplaceID(txtWorkplaceID.Text);
            _clChnageOfPlanData.SetRequestType((int)replanningType.rpDrillRig);
            // _clChnageOfPlanData.SetRequestType((int)replanningType.rpStopWp);

            CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL._queryReturnType = CPMBusinessLayer.ReturnType.DataTable;
            DataTable theDates = new DataTable();

            BMEBL.SetsystemDBTag     = theSystemDBTag;
            BMEBL.SetUserCurrentInfo = UserCurrentInfo;

            MWDataManager.clsDataAccess _WPData = new MWDataManager.clsDataAccess();
            _WPData.ConnectionString   = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _WPData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _WPData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _WPData.SqlStatement       = "SELECT * FROM WORKPLACE WHERE WORKPLACEID = '" + WorkplaceID + "'";
            _WPData.ExecuteInstruction();

            foreach (DataRow r in _WPData.ResultsDataTable.Rows)
            {
                txtWorkplaceName.Text = r["DESCRIPTION"].ToString();
            }

            _WPData.SqlStatement = "SELECT DISTINCT Name_2  FROM dbo.SECTION_COMPLETE WHERE PRODMONTH = '" + Convert.ToString(ProdMonth) + "' AND SECTIONID_2 = '" + SectionID_2 + "'";
            _WPData.ExecuteInstruction();

            foreach (DataRow r in _WPData.ResultsDataTable.Rows)
            {
                txtSection.Text = r["Name_2"].ToString();
            }


            CPMBusinessLayer.clsBusinessLayer BMEBL1 = new CPMBusinessLayer.clsBusinessLayer();
            BMEBL1._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
            BMEBL1.SetsystemDBTag     = this.theSystemDBTag;
            BMEBL1.SetUserCurrentInfo = this.UserCurrentInfo;
            //  editMiningMethod.Properties.DataSource = BMEBL1.getMiningMethods(theActivity);

            MWDataManager.clsDataAccess _MinerData = new MWDataManager.clsDataAccess();
            _MinerData.ConnectionString   = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _MinerData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _MinerData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _MinerData.SqlStatement       = "SELECT '' DRID union " +
                                            "select distinct DRID from DRILLRIG_PROJECT  DRP " +
                                            "INNER JOIN vw_Workplace_WorkArea WPWA ON " +
                                            "DRP.Project = WPWA.Project";
            _MinerData.ExecuteInstruction();
            editDrillRigg.Properties.DataSource    = _MinerData.ResultsDataTable;
            editDrillRigg.Properties.ValueMember   = "DRID";;//TargetID
            editDrillRigg.Properties.DisplayMember = "DRID";;

            _WPData.SqlStatement = "SELECT PP.DrillRig from PLANMONTH PP " +
                                   " where PP.ProdMonth='" + ProdMonth + "' and  PP.Workplaceid='" + WorkplaceID + "' and PP.Sectionid='" + SectionID + "' and PP.Sectionid_2='" + SectionID_2 + "'";

            _WPData.ExecuteInstruction();

            foreach (DataRow r in _WPData.ResultsDataTable.Rows)
            {
                editDrillRigg.Properties.NullText = r["DrillRig"].ToString();
                editDrillRigg.EditValue           = editDrillRigg.Properties.GetKeyValueByDisplayText(r["DrillRig"].ToString());
                //  CBD = r["TargetID"].ToString();
            }

            loadCurrentValues(WorkplaceID, ProdMonth, SectionID, SectionID_2, false);
        }