Пример #1
0
        private void EditCard()
        {
            int row = dataGridCards.CurrentRowIndex;

            if (row == -1)
            {
                return;
            }

            int    id     = Convert.ToInt32(dataGridCards[row, 0]);
            string sn     = dataGridCards[row, 1].ToString();
            string person = dataGridCards[row, 2].ToString();
            string team   = dataGridCards[row, 3].ToString();
            string remark = dataGridCards[row, 4].ToString();

            frmCardItem f = new frmCardItem();

            f.AdeState = ADEState.Edit;
            f.EditId   = id;
            f.CardSN   = sn;
            f.Person   = person;
            f.Remark   = remark;
            f.Team     = team;

            if (f.ShowDialog() == DialogResult.OK)
            {
                Card c = new Card(f.CardSN, f.Person, f.Remark);
                c.Tag = f.Team;
                XGDB.UpdateCard(id, c);
                LoadCardFromDB();
                XGDB.Resolve();
            }
        }
Пример #2
0
        private void btnDelete_Click(object sender, System.EventArgs e)
        {
            int id = GetSelectedId();

            if (id == -1)
            {
                return;
            }
            DialogResult dr = MsgBox.ShowQuestion(GT.TIP_DELELE_DATAGRID_ROW);

            if (dr == DialogResult.Yes)
            {
                XGDB.DeleteCard(id);
                LoadCardFromDB();
                XGDB.Resolve();
            }
        }
Пример #3
0
        private void btnDelete_Click(object sender, System.EventArgs e)
        {
            int row = dataGridXGTasK.CurrentRowIndex;

            if (row == -1)
            {
                return;
            }

            DialogResult dr = MsgBox.ShowQuestion(GT.TIP_DELELE_DATAGRID_ROW);

            if (dr == DialogResult.Yes)
            {
                int id = int.Parse(dataGridXGTasK[row, 0].ToString());
                XGDB.DeleteXGTask(id);
                LoadXGTaskFromDB();
                XGDB.Resolve();
            }
        }
Пример #4
0
        public MainClass()
        {
//            try
//            {
            if (Utilities.Diagnostics.HasPreInstance())
            {
                MsgBox.Show(GT.TEXT_PROGRAM_RUNNING,
                            GT.TEXT_TIP,
                            System.Windows.Forms.MessageBoxIcon.Exclamation);

                return;
            }

            if (InitialGlobal() == false)
            {
                return;
            }


            XGDB.Resolve();
            if (XGConfig.Default.ShowLogForm)
            {
                frmLogs.Default.Show();
            }
            btGRMain.frmMain fMain = new btGRMain.frmMain();
            fMain.UIEventHandler += new UICOMM.BTGRUIEventHandler(UIEventProcessor.Default.Process);
            CollStateDisplay collStateDis = new CollStateDisplay(fMain.GprsCollStateSbr);

            Singles.S.CollStateDisPlay = collStateDis;

            // test entry point
            //
            new Test.T();
            System.Windows.Forms.Application.Run(fMain);

//            }
//            catch(Exception ex )
//            {
//                MessageBox.Show(ex.ToString());
//            }
        }
Пример #5
0
        /// <summary>
        ///
        /// </summary>
        private void AddCard()
        {
            try
            {
                frmCardItem f = new frmCardItem();
                if (f.ShowDialog(this) == DialogResult.OK)
                {
                    Card c = new Card(f.CardSN, f.Person, f.Remark);
                    //2007.03.30 Added Team
                    //
                    c.Tag = f.Team;

                    XGDB.InsertCard(c);
                    LoadCardFromDB();
                    XGDB.Resolve();
                }
            }
            catch (Exception ex)
            {
                MsgBox.Show(ex.ToString());
            }
        }
Пример #6
0
        private void btnAdd_Click(object sender, System.EventArgs e)
        {
            frmXGTaskItem f = new frmXGTaskItem();

            if (f.ShowDialog(this) == DialogResult.OK)
            {
                string person = f.Person;
                string cardsn = f.CardSN;
                string stName = f.XgStationName;
                XGTime time   = f.XGTime;

                XGDB.InsertXGTask(stName, person, time);
                //XGStation xgstation = GetXGStation(  stName );
                //Card card = GetCard( cardsn );
                //
                //XGTask task = new XGTask( xgstation, card, time );
                //XGDB.InsertXGTask( task );

                LoadXGTaskFromDB();
                XGDB.Resolve();
            }
        }
Пример #7
0
        private void btnEdit_Click(object sender, System.EventArgs e)
        {
            int row = dataGridXGTasK.CurrentRowIndex;

            if (row == -1)
            {
                return;
            }

            int    id      = int.Parse(dataGridXGTasK[row, 0].ToString());
            string stName  = dataGridXGTasK[row, 1].ToString();
            string person  = dataGridXGTasK[row, 2].ToString();
            string cardsn  = dataGridXGTasK[row, 3].ToString();
            string beginTs = dataGridXGTasK[row, 4].ToString();
            string endTs   = dataGridXGTasK[row, 5].ToString();
            //XGTime time = new XGTime( DateTime.Parse ( DateTime.Now.Date.ToString() + " " + beginTs ),
            //    DateTime.Parse ( DateTime.Now.Date.ToString() + " " + endTs ) );
            XGTime time = new XGTime(DateTime.Parse(beginTs), DateTime.Parse(endTs));

            frmXGTaskItem f = new frmXGTaskItem();

            f.AdeState      = ADEState.Edit;
            f.EditId        = id;
            f.XgStationName = stName;
            f.Person        = person;
            f.CardSN        = cardsn;
            f.XGTime        = time;

            if (f.ShowDialog(this) == DialogResult.OK)
            {
                XGDB.UpdateXGTask(id, f.XgStationName, f.Person, f.XGTime);
                LoadXGTaskFromDB();

                // 2007.01.30 Added
                //
                XGDB.Resolve();
            }
        }