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();
        }
        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
        }
Exemplo n.º 3
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;
            }
        }
Exemplo n.º 4
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();
                }
            }
        }
Exemplo n.º 5
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();
        }
Exemplo n.º 6
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";
        }
Exemplo n.º 7
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (this.Text == "Add Pump Station")
            {
                MWDataManager.clsDataAccess _dbManSave7 = new MWDataManager.clsDataAccess();
                _dbManSave7.ConnectionString = _theConnection;
                _dbManSave7.SqlStatement     = "";
                _dbManSave7.SqlStatement     = _dbManSave7.SqlStatement + " insert into tbl_PumpStations  \r\n";
                _dbManSave7.SqlStatement     = _dbManSave7.SqlStatement + " Values('" + DescTxt.Text + "', '" + SecCmb.SelectedText.ToString() + "')  \r\n ";
                _dbManSave7.SqlStatement     = _dbManSave7.SqlStatement + "   \r\n ";


                _dbManSave7.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
                _dbManSave7.queryReturnType    = MWDataManager.ReturnType.DataTable;
                _dbManSave7.ExecuteInstruction();
            }
            else
            {
                MWDataManager.clsDataAccess _dbManSave7 = new MWDataManager.clsDataAccess();
                _dbManSave7.ConnectionString = _theConnection;
                _dbManSave7.SqlStatement     = "";
                _dbManSave7.SqlStatement     = _dbManSave7.SqlStatement + " update tbl_PumpStations  \r\n";
                _dbManSave7.SqlStatement     = _dbManSave7.SqlStatement + " set section =  '" + SecCmb.SelectedText.ToString() + "' \r\n ";
                _dbManSave7.SqlStatement     = _dbManSave7.SqlStatement + " where Description = '" + PumpLbl.Text + "'  \r\n ";


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

            this.Close();

            toastNotificationsManager1.ShowNotification(toastNotificationsManager1.Notifications[0]);
        }
Exemplo n.º 8
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            LB1.Focus();

            MWDataManager.clsDataAccess _dbManSaveBudget = new MWDataManager.clsDataAccess();
            _dbManSaveBudget.ConnectionString = _theConnection;
            _dbManSaveBudget.SqlStatement     = "";

            _dbManSaveBudget.SqlStatement = _dbManSaveBudget.SqlStatement + "  BEGIN TRY insert into  [tbl_BookingsDailyProblemsPump] values ( '" + DateLbl.Text + "', \r\n";
            _dbManSaveBudget.SqlStatement = _dbManSaveBudget.SqlStatement + " '" + SectionLbl.Text + "', \r\n";
            _dbManSaveBudget.SqlStatement = _dbManSaveBudget.SqlStatement + "  '" + ExtractBeforeColon(ProbLbl.Text) + "', \r\n ";
            _dbManSaveBudget.SqlStatement = _dbManSaveBudget.SqlStatement + " '" + StartTime.EditValue.ToString() + "', '" + EndTime.EditValue.ToString() + "', '" + CommentsTxt.Text + "') END TRY \r\n ";
            _dbManSaveBudget.SqlStatement = _dbManSaveBudget.SqlStatement + "  \r\n";

            _dbManSaveBudget.SqlStatement = _dbManSaveBudget.SqlStatement + "  BEGIN CATCH update [tbl_BookingsDailyProblemsPump] set \r\n";
            _dbManSaveBudget.SqlStatement = _dbManSaveBudget.SqlStatement + "  ProbID = '" + ExtractBeforeColon(ProbLbl.Text) + "', \r\n";
            _dbManSaveBudget.SqlStatement = _dbManSaveBudget.SqlStatement + "  StartTime = '" + StartTime.EditValue.ToString() + "', \r\n";
            _dbManSaveBudget.SqlStatement = _dbManSaveBudget.SqlStatement + "  EndTime = '" + EndTime.EditValue.ToString() + "', \r\n";
            _dbManSaveBudget.SqlStatement = _dbManSaveBudget.SqlStatement + "  Comments = '" + CommentsTxt.Text + "' \r\n";
            _dbManSaveBudget.SqlStatement = _dbManSaveBudget.SqlStatement + " where Calendardate = '" + DateLbl.Text + "' \r\n ";
            _dbManSaveBudget.SqlStatement = _dbManSaveBudget.SqlStatement + " and Section = '" + SectionLbl.Text + "'   \r\n";
            _dbManSaveBudget.SqlStatement = _dbManSaveBudget.SqlStatement + " END CATCH\r\n";

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

            //toastNotificationsManager1.ShowNotification(toastNotificationsManager1.Notifications[0]);

            this.Close();
        }
        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;
        }
Exemplo n.º 10
0
        public void LoadLvls()
        {
            MWDataManager.clsDataAccess _dbMan = new MWDataManager.clsDataAccess();
            _dbMan.ConnectionString   = _connection;
            _dbMan.SqlStatement       = " ";
            _dbMan.SqlStatement       = _dbMan.SqlStatement + " Select * from (SELECT convert(decimal(18,0),substring(level,6,6)) order1,* ";
            _dbMan.SqlStatement       = _dbMan.SqlStatement + " FROM [Mineware].[dbo].[tbl_BCS_Tramming_Levels] ";
            _dbMan.SqlStatement       = _dbMan.SqlStatement + " where yearmonth = '" + ProductionAmplatsGlobal.ProductionAmplatsGlobal.ProdMonthAsString(Convert.ToDateTime(editProdmonth.EditValue)) + "') a  order by order1, orgunit ";
            _dbMan.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _dbMan.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _dbMan.ExecuteInstruction();

            DataTable dtMain = _dbMan.ResultsDataTable;

            DataSet ds = new DataSet();

            ds.Tables.Add(dtMain);

            BookGrid.DataSource = ds.Tables[0];

            colLevel.FieldName = "Level";
            ColOrg.FieldName   = "OrgUnit";
            ColShift.FieldName = "Shift";
            ColMO.FieldName    = "Section";
        }
Exemplo n.º 11
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";
        }
Exemplo n.º 12
0
        private void editProdmonth_EditValueChanged(object sender, EventArgs e)
        {
            LoadLvls();



            MWDataManager.clsDataAccess _dbMan = new MWDataManager.clsDataAccess();
            _dbMan.ConnectionString = _connection;
            _dbMan.SqlStatement     = " ";
            _dbMan.SqlStatement     = _dbMan.SqlStatement + "select sectionid, name from mineware.dbo.tbl_BCS_SECTION where prodmonth = '" + ProductionAmplatsGlobal.ProductionAmplatsGlobal.ProdMonthAsString(Convert.ToDateTime(editProdmonth.EditValue)) + "' ";
            _dbMan.SqlStatement     = _dbMan.SqlStatement + "and hierarchicalid = 4 order by sectionid ";

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

            DataTable dtMain = _dbMan.ResultsDataTable;

            LookUpEditSection.DataSource    = dtMain;
            LookUpEditSection.ValueMember   = "sectionid";
            LookUpEditSection.DisplayMember = "name";

            if (_dbMan.ResultsDataTable.Rows.Count > 0)
            {
                editSections.EditValue = _dbMan.ResultsDataTable.Rows[0][0].ToString();
            }
        }
        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);
            }
        }
        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);
        }
Exemplo n.º 15
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";
        }
        /// <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();
        }
Exemplo n.º 17
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (CalTypeTxt.Text == "")
            {
                MessageBox.Show("Please enter the Calendar Type.", "Insufficient information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }


            MWDataManager.clsDataAccess _dbManDelete = new MWDataManager.clsDataAccess();
            _dbManDelete.ConnectionString = _theConnection;
            _dbManDelete.SqlStatement     = " delete from tbl_Calendar_Code where calendarcode = '" + CalTypeTxt.Text + "' \r\n";
            _dbManDelete.SqlStatement     = _dbManDelete.SqlStatement + "  ";

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

            MWDataManager.clsDataAccess _dbMan = new MWDataManager.clsDataAccess();
            _dbMan.ConnectionString   = _theConnection;
            _dbMan.SqlStatement       = " insert into tbl_Calendar_Code (calendarcode, Active) ";
            _dbMan.SqlStatement       = _dbMan.SqlStatement + " VALUES ( '" + CalTypeTxt.Text + "', 'Y') ";
            _dbMan.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            _dbMan.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _dbMan.ExecuteInstruction();

            toastNotificationsManager1.ShowNotification(toastNotificationsManager1.Notifications[0]);

            Close();
        }
        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);
            }
        }
Exemplo n.º 19
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());
            }
        }
        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();
            }
        }
        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;
        }
Exemplo n.º 22
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";
        }
Exemplo n.º 23
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;
        }
Exemplo n.º 24
0
        private void AddProbFrm_Load(object sender, EventArgs e)
        {
            //this.Icon = Mineware.Systems.Minewaste.Properties.Resources.button_teal;

            ///Load Category Combo
            ///
            MWDataManager.clsDataAccess _dbMan = new MWDataManager.clsDataAccess();
            _dbMan.ConnectionString = _theConnection;

            _dbMan.SqlStatement = " select *, convert(Varchar(10),ProbCatID)+':'+ProbCatDesc ProbCat from [tbl_ProbCatagories] \r\n";
            _dbMan.SqlStatement = _dbMan.SqlStatement + " ";
            _dbMan.SqlStatement = _dbMan.SqlStatement + "  ";

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

            DataTable dt2 = _dbMan.ResultsDataTable;
            DataSet   ds2 = new DataSet();

            if (ds2.Tables.Count > 0)
            {
                ds2.Tables.Clear();
            }
            ds2.Tables.Add(dt2);
            //Grd3Mnth.Visible = true;

            foreach (DataRow dr in _dbMan.ResultsDataTable.Rows)
            {
                ProbCatCmb.Items.Add(dr["ProbCat"].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();
        }
Exemplo n.º 26
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (ProbCodeTxt.Text == "")
            {
                MessageBox.Show("Please enter a Problem Code.", "Insufficient information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (ProbDescTxt.Text == "")
            {
                MessageBox.Show("Please enter a Problem Description.", "Insufficient information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (ProbCatCmb.Text == "")
            {
                MessageBox.Show("Please select a Problem Category.", "Insufficient information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }



            MWDataManager.clsDataAccess _dbMan = new MWDataManager.clsDataAccess();
            _dbMan.ConnectionString = _theConnection;

            _dbMan.SqlStatement = " insert into tbl_Problems values ('" + ProbDescTxt.Text.ToString() + "', \r\n";
            _dbMan.SqlStatement = _dbMan.SqlStatement + " '" + Convert.ToInt32(ExtractBeforeColon(ProbCatCmb.Text.ToString())) + "', ";
            _dbMan.SqlStatement = _dbMan.SqlStatement + " '" + ProbCodeTxt.Text.ToString() + "' ) ";

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

            toastNotificationsManager1.ShowNotification(toastNotificationsManager1.Notifications[0]);
        }
        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);
        }
Exemplo n.º 28
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());
            }
        }
Exemplo n.º 29
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";
        }
Exemplo n.º 30
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";
        }