示例#1
0
        private void dlgSelectBase_Load(object sender, EventArgs e)
        {
            lsMineVal = new List <string>(); lsMineID = new List <int>();
            lsTravVal = new List <string>(); lsTravID = new List <int>();
            lsLPVal   = new List <string>(); lsLPID = new List <int>();

            bs = new DataClass.Base2();
            sf = new DataClass.Base2();

            p1 = new DataClass.PegYXZ();
            p2 = new DataClass.PegYXZ();
            p3 = new DataClass.PegYXZ();

            Clear_Base_BS(bs);
            Clear_Base_SF(sf);
            Clear_Peg1(p1);
            Clear_Peg2(p2);
            Clear_Peg3(p3);

            dmMain.LoadPegTypes(lsLPID, lsLPVal);
            cboLP.DataSource    = lsLPVal;
            cboLP.SelectedIndex = 0;

            dmMain.load_LookUpVal("Mine", "MineID", "Descr", lsMineID, lsMineVal, false);
            cboMine.DataSource = lsMineVal;
            if (cboMine.Items.Count > 0)
            {
                loadTrav(lsMineID[0]);
            }
            else
            {
                MessageBox.Show("No Mines Found", "Load Mines", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
        private void Clear_Base_SF(DataClass.Base2 b) // stn to fs
        {
            lblBaseSF.ForeColor = Color.Green;
            lblBaseSF.Text      = "STN to FS Not Found";
            lblBearSF.Text      = "";
            lblBear180SF.Text   = "";
            lblHDSF.Text        = "";
            lblEDSF.Text        = "";
            lblBearErrSF.Text   = "";
            lblLPSF.Text        = "no";
            lblESF.Text         = "";
            lblCSF.Text         = "";

            b.clear();
        }
示例#3
0
        private void Clear_Base_BS(DataClass.Base2 b) // bs to stn
        {
            lblBaseBS.ForeColor = Color.Red;
            lblBaseBS.Text      = "BS to STN Not Found";
            lblBearBS.Text      = "";
            lblBear180BS.Text   = "";
            lblHDBS.Text        = "";
            lblEDBS.Text        = "";
            lblBearErrBS.Text   = "";
            lblLPBS.Text        = "no";
            lblEBS.Text         = "";
            lblCBS.Text         = "";

            b.clear();
        }
示例#4
0
        private void cmdAdd_Click(object sender, EventArgs e)
        {
            DataClass.Base2  base2  = new DataClass.Base2();
            DataClass.PegYXZ pegxyz = new DataClass.PegYXZ();
            string           BS     = cboBS.Text;
            string           ST     = cboST.Text;
            string           FS     = txtFS.Text;
            string           C      = cboClass.Text;
            int CID  = lsClassID[lsClassVal.IndexOf(C)];
            int CCID = 5; //traverse peg
            int LP   = cboLP.SelectedIndex;

            base2.BaseID = -1;
            base2.BCID   = -1;
            base2.BFWID  = -1;
            base2.ST     = BS;
            base2.FS     = ST;
            base2.CCID   = CCID;
            base2.CID    = CID;
            base2.LP     = LP;
            int MaxBinID = tBase.Rows.Count + 1;


            if (txtFS.Text.Trim() == "")
            {
                MessageBox.Show("No Foresight Peg Name ", "New Peg", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (CheckIfPegExit())
            {
                MessageBox.Show("Peg Name Exist in current calculation", "New Peg", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (!dmMain.Find_Bin_BSSTN_Base(BS, ST, MaxBinID, tBase, base2))
            {
                MessageBox.Show("Could not Find Base(" + BS + " --> " + ST + ")", "New Peg", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            //Check if Peg exist in main database

            pegxyz.pcid   = -1;
            pegxyz.PegID  = -1;
            pegxyz.Peg    = FS;
            pegxyz.CCID   = CCID;
            pegxyz.CID    = CID;
            pegxyz.AUID   = GlobalLogon.AUID;
            pegxyz.LP     = LP;
            pegxyz.Mine   = base2.Mine;
            pegxyz.MineID = base2.MineID;
            pegxyz.Trav   = base2.Trav;
            pegxyz.TravID = base2.TravID;
            pegxyz.MTID   = base2.MTID;

            ParentForm.add_bcid(base2.binID, base2, pegxyz);

            MessageBox.Show("Add New Base(" + BS + " -> " + ST + " -> " + FS + ")");

            this.DialogResult = DialogResult.OK;
            this.Close();
        }