コード例 #1
0
        private void LoadCalendarType()
        {
            MWDataManager.clsDataAccess _dbMan = new MWDataManager.clsDataAccess();
            _dbMan.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);

            _dbMan.SqlStatement = "select * from tbl_Calendar_Code order by calendarcode " +
                                  " ";
            _dbMan.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _dbMan.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _dbMan.ExecuteInstruction();
            //DataTable SubA = _dbMan.ResultsDataTable;


            DataTable dt = _dbMan.ResultsDataTable;
            DataSet   ds = new DataSet();

            if (ds.Tables.Count > 0)
            {
                ds.Tables.Clear();
            }
            ds.Tables.Add(dt);
            //Grd3Mnth.Visible = true;
            CalTypeGrd.DataSource = ds.Tables[0];
            colCalType.FieldName  = "CalendarCode";
        }
        private DataTable getUserList(string excludeUserID, int TemplateID)
        {
            MWDataManager.clsDataAccess _UserList = new MWDataManager.clsDataAccess();

            _UserList.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            //_UserList.SqlStatement = "SELECT '' AS USERID, '' AS NAME " +
            //                            "UNION ALL SELECT dept.DepartmentID ,dept.Description FROM dbo.PlanProt_Template PPT " +
            //                         "INNER JOIN dbo.PlanProt_ProfileAccess PPPA ON " +
            //                         "PPT.TemplateID = PPPA.TemplateID " +
            //                         "INNER JOIN tblDepartments dept on " +
            //                         "dept.DepartmentID= PPPA.DepartmentID " +
            //                         "WHERE PPT.TemplateID = " + TemplateID.ToString() + " AND " +
            //                         "PPPA.AccessLevel = 1 AND " +
            //                         "dept.DepartmentID <> '" + excludeUserID + "'" ;

            _UserList.SqlStatement = "SELECT '' AS USERID, '' AS NAME " +
                                     "UNION ALL SELECT dept.USERID ,dept.NAME + ' ' + dept.LastName NAME FROM dbo.PlanProt_Template PPT " +
                                     "INNER JOIN dbo.PlanProt_ProfileAccess PPPA ON " +
                                     "PPT.TemplateID = PPPA.TemplateID " +
                                     "INNER JOIN tblUsers dept on " +
                                     "dept.DepartmentID= PPPA.DepartmentID " +
                                     "WHERE PPT.TemplateID = " + TemplateID.ToString() + " AND " +
                                     "PPPA.AccessLevel = 1 AND " +
                                     "dept.USERID <> '" + excludeUserID + "'";
            _UserList.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _UserList.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _UserList.ExecuteInstruction();
            //"INNER JOIN dbo.USERS USERS ON " +
            //"USERS.USERPROFILEID = PPPA.ProfileName " +

            return(_UserList.ResultsDataTable);
        }
コード例 #3
0
        void LoadGrid()
        {
            string Section = procs.ExtractBeforeColon(SecCmb.Text);

            MWDataManager.clsDataAccess _dbManVampWP = new MWDataManager.clsDataAccess();
            if (Section == "Total Mine" || Section == "")
            {
                _dbManVampWP.ConnectionString = TConnections.GetConnectionString(_theSystemDBTag, _UserCurrentInfoConnection);
                _dbManVampWP.SqlStatement     = "  \r\n" +
                                                " select so.ReportToSectionid SectionID,ca.WorkplaceID,w.Description WPName,ca.ChecklistID , f.Name, 'Y' Selected, ''Supervisor, ca.UniqueID        \r\n" +
                                                " from tbl_OCR_CheclistsAdded ca, tbl_OCR_Forms f , Workplace w ,(SELECT SectionID,ReportToSectionid FROM SECTION GROUP BY SectionID,ReportToSectionid UNION ALL SELECT SectionID,ReportToSectionid FROM SECTIONOTHER GROUP BY SectionID,ReportToSectionid) so \r\n" +
                                                " where calendardate = '" + DateEdit1.EditValue + "'  \r\n" +
                                                " and ca.ChecklistID = f.FormsID  \r\n" +
                                                " and w.WorkplaceID = ca.WorkplaceID" +
                                                "  AND LEFT(ca.SectionID,5) = so.SectionID" +
                                                " ";
                _dbManVampWP.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
                _dbManVampWP.queryReturnType    = MWDataManager.ReturnType.DataTable;
                _dbManVampWP.ExecuteInstruction();
            }
            else
            {
                _dbManVampWP.ConnectionString = TConnections.GetConnectionString(_theSystemDBTag, _UserCurrentInfoConnection);
                _dbManVampWP.SqlStatement     = "  \r\n" +
                                                "  select '" + Section + "' SectionID,ca.WorkplaceID,w.Description WPName,ca.ChecklistID , f.Name, 'Y' Selected, ''Supervisor, ca.UniqueID   \r\n" +
                                                " from tbl_OCR_CheclistsAdded ca, tbl_OCR_Forms f, Workplace w  \r\n" +
                                                " where calendardate = '" + DateEdit1.EditValue + "' \r\n" +
                                                " and ca.ChecklistID = f.FormsID  \r\n" +
                                                " and ca.SectionID like '" + Section + "%' " +
                                                " and w.WorkplaceID = ca.WorkplaceID" +
                                                " ";
                _dbManVampWP.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
                _dbManVampWP.queryReturnType    = MWDataManager.ReturnType.DataTable;
                _dbManVampWP.ExecuteInstruction();
            }


            DataTable dt1 = _dbManVampWP.ResultsDataTable;

            DataSet ds1 = new DataSet();

            if (ds1.Tables.Count > 0)
            {
                ds1.Tables.Clear();
            }

            ds1.Tables.Add(dt1);
            gcWorkPlaces.DataSource = ds1.Tables[0];


            gcolWPID.FieldName        = "WorkplaceID";
            gcolDESCRIPTION.FieldName = "WPName";
            gcolSelect.FieldName      = "Selected";

            gcolChecklistID.FieldName   = "ChecklistID";
            gcolChecklistName.FieldName = "Name";
            gcolSuperviser.FieldName    = "Supervisor";

            gcolUniqueID.FieldName = "UniqueID";
        }
コード例 #4
0
        /// <summary>
        /// Gets all the fields from the SYSSET table
        /// </summary>
        /// <param name="theSystemDBTag"></param>
        /// <param name="UserCurrentInfo"></param>
        public static void GetSysSettings(string theSystemDBTag, TUserCurrentInfo UserCurrentInfo)
        {
            MWDataManager.clsDataAccess _dbMan = new MWDataManager.clsDataAccess();
            _dbMan.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);// ConfigurationSettings.AppSettings["SQLConnectionStr"];

            _dbMan.SqlStatement       = "SELECT * FROM [dbo].[tbl_SysSet]";
            _dbMan.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _dbMan.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _dbMan.ExecuteInstruction();
            DataTable SubB = _dbMan.ResultsDataTable;


            ProdMonth    = Convert.ToInt32(SubB.Rows[0]["currentproductionmonth"].ToString());
            MillMonth    = Convert.ToInt32(SubB.Rows[0]["currentmillmonth"].ToString());
            Banner       = SubB.Rows[0]["Banner"].ToString();
            StdAdv       = Convert.ToDecimal(SubB.Rows[0]["stpadv"].ToString());
            CheckMeas    = SubB.Rows[0]["CheckMeas"].ToString();
            PlanType     = SubB.Rows[0]["PlanType"].ToString();
            CleanShift   = SubB.Rows[0]["CleanShift"].ToString();
            AdjBook      = SubB.Rows[0]["AdjBook"].ToString();
            BlastQual    = Convert.ToInt32(Math.Round(Convert.ToDecimal(SubB.Rows[0]["percblastqualification"].ToString()), 0));
            DSOrg        = SubB.Rows[0]["dsorg"].ToString();
            CHkMeasLevel = SubB.Rows[0]["checkmeaslvl"].ToString();
            PlanNotes    = SubB.Rows[0]["PlanNotes"].ToString();
            CylePlan     = "Y";
            RepDir       = SubB.Rows[0]["RepDir"].ToString();
            HGrade       = Convert.ToDecimal(SubB.Rows[0]["stopingpaylimit"].ToString());
            ServDir      = SubB.Rows[0]["ServerPath"].ToString();
            Vampsqm      = Convert.ToInt32(Math.Round(Convert.ToDecimal(SubB.Rows[0]["vampsqm"].ToString()), 0));
            FatFreeShift = Convert.ToInt32(Math.Round(Convert.ToDecimal(SubB.Rows[0]["FatFreeShift"].ToString()), 0));
            RepDirImage  = SubB.Rows[0]["RepDir"].ToString();
        }
        private void btnEdit_Click(object sender, EventArgs e)
        {
            FieldID = Convert.ToInt32(tableGrid.Rows[viewFields.FocusedRowHandle]["FieldID"].ToString());
            frmFieldSetup fieldSetup = new frmFieldSetup {
                theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
            };

            fieldSetup.formAction1 = currentAction.caEdit;
            fieldSetup.TempId      = TempID;
            fieldSetup.FieldID     = FieldID;
            MWDataManager.clsDataAccess _dbManGrid = new MWDataManager.clsDataAccess();
            _dbManGrid.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _dbManGrid.SqlStatement     = "select Distinct pf.FieldID [FieldID],pf.FieldName [Field Name],ppf.fieldDescription [Field Type],pf2.FieldName[Parent]  from PlanProt_Fields pf " +
                                          "left outer join " +
                                          "PlanProt_FieldTypes ppf " +
                                          "on pf.FieldType = ppf.fieldTypeID " +
                                          "left outer join " +
                                          "PlanProt_Fields pf2 " +
                                          "on pf.ParentID = pf2.FieldID " +
                                          " where pf.TemplateID = '" + TempID + "'";
            _dbManGrid.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _dbManGrid.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _dbManGrid.ExecuteInstruction();


            gridOutput.DataSource = _dbManGrid.ResultsDataTable;
            fieldSetup.ShowDialog();
        }
コード例 #6
0
        public void LoadVampingSec()
        {
            MWDataManager.clsDataAccess _dbMan = new MWDataManager.clsDataAccess();
            _dbMan.ConnectionString = TConnections.GetConnectionString(_theSystemDBTag, _UserCurrentInfoConnection);

            _dbMan.SqlStatement = " select s1.sectionid sec, s1.name nn,s1.sectionid+':'+s1.name Description   from  section s, section s1, workplace w,  " +
                                  "PLANNING_Vamping pm,SecCal sc where pm.sectionid = s.sectionid and pm.prodmonth = s.prodmonth " +
                                                                                          // "  and pm.Activity = 'VMP' " +
                                  "and s.reporttosectionid = s1.sectionid and s.prodmonth = s1.prodmonth and pm.workplaceid = w.workplaceid " +
                                  " and s1.reporttosectionid = '" + MOLbl.Text + "'   " + //and pm.activity = 'VMP'
                                  "and sc.Sectionid like '" + MOLbl.Text + "%' and sc.BeginDate <= '" + String.Format("{0:yyyy-MM-dd}", OtherBookDate.Value) + "' and sc.EndDate >= '" + String.Format("{0:yyyy-MM-dd}", OtherBookDate.Value) + "' " +
                                  "and pm.Prodmonth = sc.Prodmonth group by s1.sectionid , s1.name order by s1.sectionid , s1.name ";

            _dbMan.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _dbMan.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _dbMan.ExecuteInstruction();

            Neil = _dbMan.ResultsDataTable;

            lbxMiners.Items.Clear();

            foreach (DataRow dr in Neil.Rows)
            {
                lbxMiners.Items.Add(dr["sec"].ToString() + ":" + dr["nn"].ToString());
            }
        }
コード例 #7
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            string SectionID = "";
            string WPID      = "";

            for (int i = 0; i < viewWorkplaces.DataRowCount; i++)
            {
                SectionID = viewWorkplaces.GetRowCellValue(i, "SectionID").ToString();
                WPID      = viewWorkplaces.GetRowCellValue(i, "WorkplaceID").ToString();

                if (SectionID != "")
                {
                    MWDataManager.clsDataAccess _dbManWPSTDetail = new MWDataManager.clsDataAccess();
                    _dbManWPSTDetail.ConnectionString = TConnections.GetConnectionString(_theSystemDBTag, _UserCurrentInfoConnection);
                    _dbManWPSTDetail.SqlStatement     = " Exec [sp_OCR_AddNewWorkplace]  '" + _Month + "','" + SectionID + "','" + WPID + "' \r\n" +
                                                        "  \r\n" +
                                                        "    ";

                    _dbManWPSTDetail.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
                    _dbManWPSTDetail.queryReturnType    = MWDataManager.ReturnType.DataTable;
                    _dbManWPSTDetail.ExecuteInstruction();

                    Mineware.Systems.Global.sysNotification.TsysNotification.showNotification("Data Saved", "saved", Color.CornflowerBlue);

                    this.Close();
                }
            }
        }
コード例 #8
0
        /// <summary>
        /// Run when importing data from previous month
        /// </summary>
        private void ImportPreviousMonthData()
        {
            MWDataManager.clsDataAccess _PrePlanningData = new MWDataManager.clsDataAccess();
            _PrePlanningData.ConnectionString = TConnections.GetConnectionString(systemDBTag,
                                                                                 UserCurrentInfo.Connection);
            _PrePlanningData.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;
            _PrePlanningData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _PrePlanningData.SqlStatement       = "sp_preplanning_save_previus_month";

            SqlParameter[] _paramCollection =
            {
                _PrePlanningData.CreateParameter("@ProdMonth",
                                                 SqlDbType.Int,
                                                 0,
                                                 Convert.ToInt32(planningSettings.ProdMonth)),
                _PrePlanningData.CreateParameter("@Sectionid_2",
                                                 SqlDbType.VarChar,
                                                 20,
                                                 planningSettings.MOSectionID),
                _PrePlanningData.CreateParameter("@Activity",                                 SqlDbType.Int,0, planningSettings.ActivityID),
            };


            _PrePlanningData.ParamCollection = _paramCollection;
            var result = _PrePlanningData.ExecuteInstruction();
        }
コード例 #9
0
        public void AddCyclePlan(string workplaceID, string sectionid, string sectionidMO, string ProdMonth, int Activity, double FL)
        {
            MWDataManager.clsDataAccess _NewCyclePlan = new MWDataManager.clsDataAccess();
            _NewCyclePlan.ConnectionString = TConnections.GetConnectionString(systemDBTag, UserCurrentInfo.Connection);

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


            SqlParameter[] _paramCollection =
            {
                _NewCyclePlan.CreateParameter("@workplaceID", SqlDbType.VarChar,  12, workplaceID),
                _NewCyclePlan.CreateParameter("@sectionid",   SqlDbType.VarChar,  20, sectionid),
                _NewCyclePlan.CreateParameter("@sectionidMO", SqlDbType.VarChar, 100, sectionidMO),
                _NewCyclePlan.CreateParameter("@ProdMonth",   SqlDbType.Int,       0, ProdMonth),
                _NewCyclePlan.CreateParameter("@Activity",    SqlDbType.Int,       0, Activity),
                _NewCyclePlan.CreateParameter("@FL",          SqlDbType.Int,       0, FL),
            };

            _NewCyclePlan.ParamCollection = _paramCollection;

            clsDataResult exr = _NewCyclePlan.ExecuteInstruction();

            if (exr.success)
            {
                planningCycle.LoadPlanningCycleData(_NewCyclePlan.ResultsDataTable);
            }
        }
コード例 #10
0
        public void LoadVampWP()
        {
            MWDataManager.clsDataAccess _dbManVampWP = new MWDataManager.clsDataAccess();
            _dbManVampWP.ConnectionString = TConnections.GetConnectionString(_theSystemDBTag, _UserCurrentInfoConnection);
            _dbManVampWP.SqlStatement     = " select Description from WORKPLACE_Total " +

                                            "where Description not in (select Description from WORKPLACE) " +
                                            " and ((Activity = 1 and EndTypeID <> '') or (Activity <> 1)) " +
                                            "order by Description ";
            _dbManVampWP.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _dbManVampWP.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _dbManVampWP.ExecuteInstruction();

            DataTable dtVampWp = new DataTable();

            dtVampWp = _dbManVampWP.ResultsDataTable;

            BindingSource bswp = new BindingSource();

            bswp.DataSource = dtVampWp;

            VampwplistBox.Items.Clear();
            VampwplistBox.DataSource    = bswp;
            VampwplistBox.DisplayMember = "Description";
        }
コード例 #11
0
        private void GetPlanningData()
        {
            MWDataManager.clsDataAccess _PrePlanningData = new MWDataManager.clsDataAccess();
            _PrePlanningData.ConnectionString = TConnections.GetConnectionString(systemDBTag,
                                                                                 UserCurrentInfo.Connection);
            _PrePlanningData.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;
            _PrePlanningData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _PrePlanningData.SqlStatement       = "sp_Load_Planning";

            SqlParameter[] _paramCollection =
            {
                _PrePlanningData.CreateParameter("@ProdMonth",
                                                 SqlDbType.Int,
                                                 0,
                                                 Convert.ToInt32(planningSettings.ProdMonth)),
                _PrePlanningData.CreateParameter("@Sectionid_2",
                                                 SqlDbType.VarChar,
                                                 20,
                                                 planningSettings.MOSectionID),
                _PrePlanningData.CreateParameter("@Activity",                                 SqlDbType.Int,0, planningSettings.ActivityID),
            };


            _PrePlanningData.ParamCollection = _paramCollection;
            var result = _PrePlanningData.ExecuteInstruction();

            _PrePlanningData.ResultsDataTable.Columns["OrgUnitNight"].DataType = typeof(string);
            tblPlanningData = _PrePlanningData.ResultsDataTable.Copy();
            _PrePlanningData.Dispose();
            _PrePlanningData = null;
        }
コード例 #12
0
        public void LoadDetails(int ChangeRequestID)
        {
            MWDataManager.clsDataAccess _WPData = new MWDataManager.clsDataAccess();
            _WPData.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);

            _WPData.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;
            _WPData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _WPData.SqlStatement       = "[sp_prePlanning_data]";

            SqlParameter[] _paramCollectionS =
            {
                _WPData.CreateParameter("@ChangeRequestID", SqlDbType.Int, 0, Convert.ToString(ChangeRequestID))
            };
            _WPData.ParamCollection = _paramCollectionS;
            _WPData.ExecuteInstruction();

            foreach (DataRow r in _WPData.ResultsDataTable.Rows)
            {
                editFL.Text = r["FL"].ToString();
                editMiningMethod.Properties.NullText = r["Description"].ToString();

                editSection.Text = r["Name_2"].ToString();

                textEdit2.Text = r["ProdMonth"].ToString();

                editToWorkplace.Properties.NullText = r["WPDesc"].ToString();

                memoEdit1.Text = r["Comments"].ToString();


                loadManageValues(r["OldWorkplaceID"].ToString(), Convert.ToInt32(r["ProdMonth"].ToString()), r["SectionID"].ToString(), r["SectionID_2"].ToString(), true);
            }
        }
コード例 #13
0
        public DataTable getWorkplaceList()
        {
            string theType = "";

            switch (theActivity)
            {
            case 0:
                theType = "0";
                break;

            case 1:
                theType = "1";
                break;
            }
            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 distinct w.WORKPLACEID, w.DESCRIPTION from WORKPLACE w " +
                                   "Where (w.Activity in ('" + theType + "')) " +
                                   "AND ((w.Inactive <> 'Y') OR (w.Inactive IS NULL)) " +
                                   "AND w.Workplaceid not in (Select pre.Workplaceid from PLANMONTH pre where Prodmonth = " + theProdmonth.ToString() + "  and ISNULL(AutoUnPlan,'') = '') ";

            _WPData.ExecuteInstruction();

            return(_WPData.ResultsDataTable);
        }
コード例 #14
0
        public void LoadMOName(string _activity)
        {
            MWDataManager.clsDataAccess _MONameData = new MWDataManager.clsDataAccess();

            _MONameData.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _MONameData.SqlStatement     =
                " Select Distinct PeerName_3 Shaft \r\n " +
                " from PLanmonth a \r\n " +
                " inner join Section_Complete b on \n" +
                "   a.Prodmonth = b.Prodmonth and \n" +
                "   a.sectionid = b.Sectionid \n" +
                " where a.Prodmonth = (Select currentproductionmonth from Sysset) and \n" +
                "       Activity = '" + _activity + "' and PLancode = 'MP'";

            _MONameData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _MONameData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _MONameData.ExecuteInstruction();
            dtMOName = _MONameData.ResultsDataTable;

            if (dtMOName.Rows.Count != 0)
            {
                rpMOName.DataSource    = dtMOName;
                rpMOName.DisplayMember = "Shaft";
                rpMOName.ValueMember   = "Shaft";
            }
            //reportSettings.Shaft = dtMOName.Rows[0]["Shaft"].ToString();
        }
コード例 #15
0
        private void ucSurveyDevProp_Load(object sender, EventArgs e)
        {
            _clsSurvey.theData.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _prodmonth = String.Format("{0:yyyyMM}", DateTime.Now);

            dtSysset = _clsSurvey.get_Sysset();
            if (dtSysset.Rows.Count > 0)
            {
                _prodmonth = dtSysset.Rows[0]["CurrentProductionMonth"].ToString();
            }
            lblProdMonth.Text     = _prodmonth;
            lblWorkplaceID.Text   = WorkplaceID;
            lblWorkplaceName.Text = Workplace;
            lblContractor.Text    = TheSection;
            Load_Contractor();
            Load_MineMethod();
            Load_Indicators();
            Load_Crews();
            Load_PegNumbers();
            Load_CubicTypes();
            Load_CleanTypes();// Added - Shaista Anjum Load Clean Types for Survey Development - 13/FEB/2013
            Load_Entries();
            Load_Destination();
            Load_SurveyDevelopment();
            Load_Density();
            CheckLockedStatus();
        }
コード例 #16
0
        private void FrmNotesGeology_Load(object sender, EventArgs e)
        {
            MWDataManager.clsDataAccess _dbManWPST3 = new MWDataManager.clsDataAccess();
            _dbManWPST3.ConnectionString = TConnections.GetConnectionString(_theSystemDBTag, _UserCurrentInfoConnection);
            _dbManWPST3.SqlStatement     = "  select Nodeid from dbo.tbl_GeoScience_PlanLongTerm " +

                                           " where Workplace = '" + WPlabel2.Text + "' " +
                                           "  and HoleNo = '" + BHLbl2.Text + "' " +
                                           "  " +
                                           "  ";

            _dbManWPST3.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _dbManWPST3.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _dbManWPST3.ResultsTableName   = "Table5";
            _dbManWPST3.ExecuteInstruction();


            DataTable dt = _dbManWPST3.ResultsDataTable;

            //NodeID.Text = "";

            if (dt.Rows.Count > 0)
            {
                NodeID.Text = dt.Rows[0]["Nodeid"].ToString();
            }
        }
コード例 #17
0
        void LoadGrid()
        {
            ///Load Problems
            ///
            MWDataManager.clsDataAccess _dbMan = new MWDataManager.clsDataAccess();
            _dbMan.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);

            _dbMan.SqlStatement = "select a.*, b.ProbCatDesc from (\r\n " +
                                  " select * from tbl_Problems )a  \r\n" +
                                  " left outer join(  \r\n" +
                                  " select * from tbl_ProbCatagories)b \r\n" +
                                  " on a.ProbCatID = b.ProbCatID  order by problem";

            _dbMan.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _dbMan.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _dbMan.ExecuteInstruction();

            DataTable dt = _dbMan.ResultsDataTable;
            DataSet   ds = new DataSet();

            if (ds.Tables.Count > 0)
            {
                ds.Tables.Clear();
            }
            ds.Tables.Add(dt);
            //Grd3Mnth.Visible = true;
            ProblemGrid.DataSource = ds.Tables[0];
            gcProbID.FieldName     = "ProbID";
            gcProbCode.FieldName   = "ProbCode";
            gcProblem.FieldName    = "Problem";
            gcProbCat.FieldName    = "ProbCatDesc";
        }
コード例 #18
0
        private void ParamLbl_TextChanged(object sender, EventArgs e)
        {
            if (ParamLbl.Text == ParamLbl1.Text)
            {
                //MessageBox.Show("Please enter the Problem Id", "Insufficient information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                ParamLbl1.Text = ParamLbl.Text;

                if (ParamLbl.Text != "")
                {
                    measure.MLPMLbl.Text  = TProductionGlobal.ProdMonthAsString(reportSettings.Prodmonth);
                    measure.MLACTLbl.Text = ParamLbl.Text.Substring(0, 1);
                    measure.MLWPLbl.Text  = procs.ExtractAfterColon(ParamLbl.Text + "                                  ".Substring(2, 30)).Trim();
                    measure.MLSecLbl.Text = procs.ExtractBeforeColon(ParamLbl.Text).Trim();
                    measure.MLSecLbl.Text = measure.MLSecLbl.Text + "                  ";
                    measure.MLSecLbl.Text = measure.MLSecLbl.Text.Substring(1, 10);
                    measure.MLSecLbl.Text = measure.MLSecLbl.Text.Trim();
                    measure.Connection    = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
                    measure.ShowDialog();

                    //MsgFrm.Text = "Record Inserted";
                    //Procedures.MsgText = "Problem Group Added";
                    //MsgFrm.Show();

                    //   showBtn_Click(null, null);
                }
            }
        }
コード例 #19
0
        private void loadData(int TargetID)
        {
            MWDataManager.clsDataAccess _theAvalibalData = new MWDataManager.clsDataAccess();
            _theAvalibalData.ConnectionString   = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _theAvalibalData.SqlStatement       = "sp_HR_Designations";
            _theAvalibalData.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;
            _theAvalibalData.queryReturnType    = MWDataManager.ReturnType.DataTable;

            SqlParameter[] _paramCollection =
            {
                _theAvalibalData.CreateParameter("@TargetID", SqlDbType.VarChar, 10, TargetID.ToString()),
            };

            _theAvalibalData.ParamCollection = _paramCollection;

            _theAvalibalData.ExecuteInstruction();
            theAvalibalData = _theAvalibalData.ResultsDataTable.Copy();

            gcAvalibalData.DataSource = theAvalibalData;

            MWDataManager.clsDataAccess _theSelectedData = new MWDataManager.clsDataAccess();
            _theSelectedData.ConnectionString   = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _theSelectedData.SqlStatement       = "SELECT Designation FROM HRSTDNORMDESIGNATION WHERE TargetID = " + TargetID.ToString();
            _theSelectedData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _theSelectedData.queryReturnType    = MWDataManager.ReturnType.DataTable;

            gcSelectedData.DataSource = _theSelectedData.ResultsDataTable;

            _theSelectedData.ExecuteInstruction();
            theSelectedData = _theSelectedData.ResultsDataTable.Copy();

            gcSelectedData.DataSource = theSelectedData;
        }
コード例 #20
0
        private void FrmNotes_Load(object sender, EventArgs e)
        {
            MWDataManager.clsDataAccess _dbManDate = new MWDataManager.clsDataAccess();
            _dbManDate.ConnectionString = TConnections.GetConnectionString(_theSystemDBTag, _UserCurrentInfoConnection);
            _dbManDate.SqlStatement     = " select  max(CalendarDate) dd from PLANNING where CalendarDate < GETDATE() " +
                                          "and  datename(dw,calendardate) = 'Sunday' ";
            _dbManDate.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _dbManDate.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _dbManDate.ResultsTableName   = "Table3";
            _dbManDate.ExecuteInstruction();

            DataTable dtdd = _dbManDate.ResultsDataTable;


            dateTimePicker1.Value = Convert.ToDateTime(dtdd.Rows[0]["dd"].ToString());
            dateTimePicker1.Value = dateTimePicker1.Value.AddDays(+5);

            dateTimePicker2.Value = dateTimePicker1.Value.AddDays(+7);


            dateTimePicker3.Value = dateTimePicker1.Value;



            LoadNoteInfo();

            radioGroup2.SelectedIndex = 1;


            openfrm = "Y";
        }
コード例 #21
0
        public void LoadMinerList(string prodMonth, string sectionidMO)
        {
            MWDataManager.clsDataAccess _MinerData = new MWDataManager.clsDataAccess();
            _MinerData.ConnectionString   = TConnections.GetConnectionString(_theSystemDBTag, _UserCurrentInfoConnection);
            _MinerData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _MinerData.queryReturnType    = MWDataManager.ReturnType.DataTable;


            _MinerData.SqlStatement = "   Select SectionID,  Name from Section  \r\n" +
                                      " where Hierarchicalid = '5'  \r\n" +
                                      " and prodmonth = '" + _Month + "'  \r\n" +
                                      " and SectionID like '" + procs.ExtractBeforeColon(_SectionMO) + "%'  \r\n" +
                                      "  union  \r\n" +

                                      " Select SectionID, Name from SectionOther  \r\n" +
                                      "  where Hierarchicalid = '3'  \r\n" +
                                      " and prodmonth = '" + _Month + "'  \r\n" +
                                      " and SectionID like '" + procs.ExtractBeforeColon(_SectionMO) + "%'  \r\n" +
                                      "order by SectionID ";
            _MinerData.ExecuteInstruction();
            SecLookUp.DataSource    = _MinerData.ResultsDataTable;
            SecLookUp.DisplayMember = "Name";
            SecLookUp.ValueMember   = "SectionID";

            SecLookUp.PopupFilterMode = DevExpress.XtraEditors.PopupFilterMode.Contains;
        }
コード例 #22
0
        //public void savedata(int changeid, string active, string USER, string DEPT,string SECTION)
        //{
        //    theData.SqlStatement = "select * from REVISEDPLANNING_USERSECURITY_ACTIONS where UserID='" + USER + "' and ChangeID =" + changeid + " and department='" + DEPT + "' ";
        //    theData.queryReturnType = MWDataManager.ReturnType.DataTable;
        //    theData.ExecuteInstruction();
        //    DataTable dt = new DataTable();
        //    dt = theData.ResultsDataTable;
        //    if (dt.Rows.Count == 0)
        //    {

        //        //var TheData1 = new MWDataManager.clsDataAccess();
        //        //TheData1.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
        //        //TheData1.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
        //        theData.SqlStatement = "";
        //        theData.SqlStatement = "INSERT INTO REVISEDPLANNING_USERSECURITY_ACTIONS (ChangeID, UserID, Active,Department,Section) values (" + changeid + ", '" + USER + "', " + active + ",'" + DEPT + "','" + SECTION + "') ";
        //        theData.queryReturnType = MWDataManager.ReturnType.DataTable;
        //        theData.ExecuteInstruction();
        //    }
        //    else
        //    {
        //        //var TheData1 = new MWDataManager.clsDataAccess();
        //        //TheData1.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
        //        //TheData1.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
        //        theData.SqlStatement = "";
        //        theData.SqlStatement = "update REVISEDPLANNING_USERSECURITY_ACTIONS set Active =" + active + ", Section='" + SECTION + "' where ChangeID= " + changeid + " AND UserID='" + USER + "' and Department='" + DEPT + "' ";
        //        theData.queryReturnType = MWDataManager.ReturnType.DataTable;
        //        theData.ExecuteInstruction();
        //    }
        //}

        public void savedatanew(int changeid, int active, string DEPT)
        {
            theData.ConnectionString = TConnections.GetConnectionString("DBHARMONYPAS", UserCurrentInfo.Connection);
            theData.SqlStatement     = "select * from REVISEDPLANNING_USERSECURITY_ACTIONS where ChangeID =" + changeid + " and department='" + DEPT + "' ";
            theData.queryReturnType  = MWDataManager.ReturnType.DataTable;
            theData.ExecuteInstruction();
            DataTable dt = new DataTable();

            dt = theData.ResultsDataTable;
            if (dt.Rows.Count == 0)
            {
                theData.ConnectionString = TConnections.GetConnectionString("DBHARMONYPAS", UserCurrentInfo.Connection);
                theData.SqlStatement     = "";
                theData.SqlStatement     = "INSERT INTO REVISEDPLANNING_USERSECURITY_ACTIONS (ChangeID, Active,Department) values (" + changeid + ", " + active + ",'" + DEPT + "') ";
                theData.queryReturnType  = MWDataManager.ReturnType.DataTable;
                theData.ExecuteInstruction();
            }
            else
            {
                theData.ConnectionString = TConnections.GetConnectionString("DBHARMONYPAS", UserCurrentInfo.Connection);
                theData.SqlStatement     = "";
                theData.SqlStatement     = "update REVISEDPLANNING_USERSECURITY_ACTIONS set Active =" + active + " where ChangeID= " + changeid + "  and Department='" + DEPT + "' ";
                theData.queryReturnType  = MWDataManager.ReturnType.DataTable;
                theData.ExecuteInstruction();
            }
        }
コード例 #23
0
        private void ileCourseBlank_Load(object sender, EventArgs e)
        {
            _clsQAQCData.theData.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);

            txtOutcome.Text        = "";
            txtReAssayOutcome.Text = "";
        }
コード例 #24
0
        private void ucCalndarsAssign_Load(object sender, EventArgs e)
        {
            PM1Txt.Value = (DateTime.Now.Year * 100) + DateTime.Now.Month;
            procs.ProdMonthVis(Convert.ToInt32(PM1Txt.Text));
            PMTxt.Text = procs.Prod2;


            MWDataManager.clsDataAccess _dbMan = new MWDataManager.clsDataAccess();
            _dbMan.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);

            _dbMan.SqlStatement = "select * from tbl_Calendar_Code where active = 'Y' order by calendarcode " +
                                  " ";
            _dbMan.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _dbMan.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _dbMan.ExecuteInstruction();
            //DataTable SubA = _dbMan.ResultsDataTable;


            DataTable dt = _dbMan.ResultsDataTable;

            foreach (DataRow dr in dt.Rows)
            {
                CalTypelst.Items.Add(dr["calendarcode"].ToString());
            }
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmFieldSetup setup = new frmFieldSetup()
            {
                theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo
            };

            setup.formAction1 = currentAction.caAdd;
            setup.TempId      = TempID;
            setup.ShowDialog();

            //tableGrid.Clear();

            MWDataManager.clsDataAccess _dbManGrid = new MWDataManager.clsDataAccess();
            _dbManGrid.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _dbManGrid.SqlStatement     = "select Distinct pf.FieldID [FieldID],pf.FieldName [Field Name],ppf.fieldDescription [Field Type],pf2.FieldName[Parent]  from PlanProt_Fields pf " +
                                          "left outer join " +
                                          "PlanProt_FieldTypes ppf " +
                                          "on pf.FieldType = ppf.fieldTypeID " +
                                          "left outer join " +
                                          "PlanProt_Fields pf2 " +
                                          "on pf.ParentID = pf2.FieldID " +
                                          " where pf.TemplateID = '" + TempID + "'";
            _dbManGrid.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _dbManGrid.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _dbManGrid.ExecuteInstruction();

            gridOutput.DataSource = _dbManGrid.ResultsDataTable; // Populate Grid
        }
コード例 #26
0
        private void LoadGrid()
        {
            MWDataManager.clsDataAccess _dbMan = new MWDataManager.clsDataAccess();
            _dbMan.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _dbMan.SqlStatement     = "  select  a.*, b.calendarcode, CONVERT(varchar(15),  b.begindate, 106) bb, CONVERT(varchar(15),  b.enddate, 106) cc, totalshifts from ( " +
                                      "select a.* from tbl_Section a left outer join [tbl_Section_Duration] b " +
                                      "on a.prodmonth = b.prodmonth and a.sectionid = b.sectionid where a.prodmonth = '" + PM1Txt.Text + "' and hierid in " +
                                      "(select hierid from dbo.tbl_Section_Hier where seccal = 'Y') " +
                                      ") a " +
                                      "left outer join " +
                                      "(select * from tbl_Calendar_SecCal where prodmonth = '" + PM1Txt.Text + "') b " +
                                      " on a.sectionid = b.sectionid " +
                                      "order by a.sectionid ";
            _dbMan.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _dbMan.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _dbMan.ExecuteInstruction();

            DataTable dt = _dbMan.ResultsDataTable;

            CalTypeGrd.DataSource = dt;
            colSection.FieldName  = "SectionID";
            colSecName.FieldName  = "Name";
            ColCalType.FieldName  = "calendarcode";
            colSDate.FieldName    = "bb";
            colEDate.FieldName    = "cc";
            ColDur.FieldName      = "totalshifts";
        }
コード例 #27
0
        public void Decline(int ApproveRequestID, string ChangeType, string WPName)
        {
            theApproveRequestID = ApproveRequestID;
            Text = "DECLINE";
            labelControl1.Text = ChangeType + ":  " + WPName;
            ShowDialog();
            if (canceledAction == false)
            {
                // theresult = canceledAction;
                MWDataManager.clsDataAccess _SaveData = new MWDataManager.clsDataAccess();
                _SaveData.ConnectionString   = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
                _SaveData.SqlStatement       = "[sp_RevisedPlanning_ApproveDecline]";
                _SaveData.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;

                SqlParameter[] _paramCollection =
                {
                    _SaveData.CreateParameter("@ApproveRequestID", SqlDbType.Int,       0, Convert.ToInt32(theApproveRequestID)),
                    _SaveData.CreateParameter("@RequestStauts",    SqlDbType.Int,       0, Convert.ToInt32(2)),
                    _SaveData.CreateParameter("@UserID",           SqlDbType.VarChar,  50, TUserInfo.UserID),
                    _SaveData.CreateParameter("@Comments",         SqlDbType.VarChar, 255, editComments.Text),
                };

                _SaveData.ParamCollection = _paramCollection;
                _SaveData.queryReturnType = MWDataManager.ReturnType.longNumber;
                _SaveData.ExecuteInstruction();

                //ucRequeststatus ucreq = new ucRequeststatus();
            }
            else
            {
                //theresult = canceledAction;
            }
        }
コード例 #28
0
        private void Load_Entries()
        {
            try
            {
                _clsSurvey.theData.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
                dtEntries = _clsSurvey.get_Entries("aa", "aa", "aa");

                if (dtEntries.Rows.Count != 0)
                {
                    MaxSeqNo = 0;
                    foreach (DataRow drStatus in dtEntries.Rows)
                    {
                        if (MaxSeqNo < Convert.ToInt32(drStatus["SeqNo"].ToString()))
                        {
                            MaxSeqNo = Convert.ToInt32(drStatus["SeqNo"].ToString());
                        }
                        cmbSeqNo.Items.Add(drStatus["SeqNo"].ToString());
                    }
                }
                else
                {
                    MaxSeqNo = 1;
                    cmbSeqNo.Items.Add(MaxSeqNo.ToString());
                }
                txtSeqNo.Text = MaxSeqNo.ToString();
                cmbSeqNo.Text = MaxSeqNo.ToString();
            }
            catch { }
        }
コード例 #29
0
        public void btnUpdate_Click(object sender, EventArgs e)
        {
            _clsWorkplaceCodes.theData.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            //BindingSource bs = (BindingSource)gvGridEdit.DataSource;
            DataTable gridedit = new DataTable();

            // DataTable dt = new DataTable();
            foreach (GridColumn column in gvGridEdit.VisibleColumns)
            {
                gridedit.Columns.Add(column.FieldName, column.ColumnType);
            }
            for (int i = 0; i < gvGridEdit.DataRowCount; i++)
            {
                DataRow row = gridedit.NewRow();
                foreach (GridColumn column in gvGridEdit.VisibleColumns)
                {
                    row[column.FieldName] = gvGridEdit.GetRowCellValue(i, column);
                }
                gridedit.Rows.Add(row);
            }
            _clsWorkplaceCodes.savedata(update, lkpDivision.EditValue.ToString(), txtGrid.Text, txtDescription.Text, txtCostarea.Text, gridedit);
            Mineware.Systems.Global.sysNotification.TsysNotification.showNotification("SAVED DATA", "All data was saved successfully", System.Drawing.Color.Blue);
            //_ucWorkplace_Codes.loaddata();
            result = "true";
            //this.ileGridEdit_Leave(null,null);



            //_uc.loaddata();
            //this.End();
        }
コード例 #30
0
        void loadgrid()
        {
            //Gets and sets gang mapping grid
            MWDataManager.clsDataAccess _dbMan1 = new MWDataManager.clsDataAccess();
            _dbMan1.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);

            _dbMan1.SqlStatement = "SELECT ProdMonth \r\n" +
                                   ",GangID \r\n" +
                                   ",ZGangID \r\n" +
                                   "FROM \r\n" +
                                   "Mineware.dbo.tbl_BCS_ZGangsLink \r\n" +
                                   "WHERE ProdMonth = '" + ProductionAmplatsGlobal.ProductionAmplatsGlobal.ProdMonthAsString(Convert.ToDateTime(editPM.EditValue)) + "' \r\n" +
                                   "ORDER BY ZGangID ASC ";
            _dbMan1.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _dbMan1.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _dbMan1.ExecuteInstruction();


            DataTable dtMain = _dbMan1.ResultsDataTable;
            DataSet   ds     = new DataSet();

            ds.Tables.Add(dtMain);
            gridControl1.DataSource = ds.Tables[0];
            ZGang3.FieldName        = "GangID";
            ZGang2.FieldName        = "ZGangID";
        }