Пример #1
0
        private void BtnDel_MouseUp(object sender, MouseEventArgs e)
        {
            if (CheckDataAndSelect() == false)
            {
                return;
            }

            if (dgvCar.CurrentRow.Selected == true)
            {
                DaoPartNumber CarPN = (DaoPartNumber)dgvCar.Rows[dgvCar.CurrentCell.RowIndex].DataBoundItem;

                DialogResult Ret = MessageBoxEx.Show(this, string.Format("確定要刪除件號 {0} ?", CarPN.件號), "訊息", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (Ret == DialogResult.Yes)
                {
                    DaoErrMsg Msg = DaoSQL.Instance.DeletePN(CarPN);
                    if (Msg.isError == false)
                    {
                        MessageBoxEx.Show(this, string.Format("件號 {0} 已刪除。", CarPN.件號), "訊息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Setup();
                    }
                    else
                    {
                        MessageBoxEx.Show(this, string.Format("無法刪除件號 {0} 。", CarPN.件號), "訊息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Пример #2
0
        /// <summary>
        /// PN欄位植有更動事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TbPN_TextChanged(object sender, EventArgs e)
        {
            SetTestIcon(eTestIconState.eTEST_NULL);

            if (tbPN.Text.Length <= 0 ||
                tbPN.Text == m_InputPnInfo)
            {
                tbCarName.Text = "";
                tbCode.Text    = "";
                tbSerial.Text  = "";
                return;
            }

            //搜尋件號資訊;//
            m_PN = DaoSQL.Instance.GetPartNumber(tbPN.Text);
            if (m_PN != null)
            {
                tbPN.ForeColor      = Color.Black;
                tbCarName.ForeColor = Color.Black;
                tbCarName.Text      = m_PN.車型;
                tbCode.Text         = m_PN.簡碼;
                m_isInputPn         = true;

                //顯示測試中圖示;//
                SetTestIcon(eTestIconState.eTEST_WAITING);
            }
            else
            {
                tbCarName.ForeColor = Color.Red;
                tbCarName.Text      = "查無此件號";
                tbCode.Text         = "";
                tbSerial.Text       = "";
            }
        }
Пример #3
0
        public FormSettingCars(DaoPartNumber PN)
        {
            InitializeComponent();

            tbPN.ReadOnly = true;
            tbPN.Text     = PN.件號;

            tbCar.Text = PN.車型;

            tbCode.Text = PN.簡碼;

            btnAdd.Text = "更  新";

            m_isEditMode = true;
        }
Пример #4
0
        public void PrintLabel(string Serial, DaoMachine Machine, DaoPartNumber PN, string Result, DateTime TestTime)
        {
            if (OpenPrinter() == 0)
            {
                return;
            }

            string ResultSerial = string.Format("{0}{1}{2}", Machine.機台代碼, PN.簡碼, Serial);

            TSCLIB_DLL.setup("18", "12", "2", "12", "1", "3", "0");
            TSCLIB_DLL.clearbuffer();
            TSCLIB_DLL.sendcommand(string.Format("QRCODE 12,8,L,2,A,0,M2,S7,\"UCC,{0},{1}\"", ResultSerial, TestTime.ToString("yyyy/MM/dd")));
            TSCLIB_DLL.windowsfont(76, 11, 30, 0, 2, 0, "新細明體", Result);
            TSCLIB_DLL.windowsfont(66, 40, 20, 0, 0, 0, "新細明體", TestTime.ToString("yy/MM/dd"));
            TSCLIB_DLL.windowsfont(5, 62, 20, 0, 0, 0, "新細明體", PN.車型);
            TSCLIB_DLL.printlabel("1", "1");

            TSCLIB_DLL.closeport();
        }
Пример #5
0
        private void BtnEdit_MouseUp(object sender, MouseEventArgs e)
        {
            if (CheckDataAndSelect() == false)
            {
                return;
            }

            if (dgvCar.CurrentRow.Selected == true)
            {
                DaoPartNumber PN = (DaoPartNumber)dgvCar.Rows[dgvCar.CurrentCell.RowIndex].DataBoundItem;

                FormSettingCars fCar = new FormSettingCars(PN);

                DialogResult Ret = fCar.ShowDialog();

                if (Ret == DialogResult.Yes)
                {
                    Setup();
                }

                fCar.Close();
                fCar.Dispose();
            }
        }