Пример #1
0
 private void SoLuongPcs_Sheet_KeyPress_1(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter)
     {
         QuetTxt.Focus();
     }
 }
Пример #2
0
        private void QuetTxt_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (txtNhap.Text.Length == QuetTxt.Text.Length)// && !string.IsNullOrEmpty(txtNhap.Text))
                {
                    if (txtNhap.Text == QuetTxt.Text)
                    {
                        int ttsl = 0;
                        int dem  = 0;
                        if (SoLuongSKU.Value <= 0)
                        {
                            return;
                        }
                        //{
                        if (SoLuongQuetTxt.Value < SoLuongSheet_Goi.Value)
                        {
                            int tsl = 0;

                            tong = tong + 1;
                            SoLuongQuetTxt.Value = tong;
                            var db = new MyDBContextDataContext();
                            var bc = db.tbBarcodeStickers.ToList();
                            foreach (var item in bc)
                            {
                                if (item.Barcode == QuetTxt.Text && item.SCD == sCDTextEdit.Text)
                                {
                                    tsl = tsl + Convert.ToInt32(item.SoLuongSheet_Goi) * Convert.ToInt32(item.SoLuongPcs_Sheet);
                                }
                            }
                            ttsl = tsl + (int)SoLuongQuetTxt.Value * (int)SoLuongPcs_Sheet.Value;
                            //if (SoLuongQuetTxt.Value == SoLuongSheet_Goi.Value && ttsl < SoLuongCanIn.Value)
                            //{
                            //    if (SoLuongCanIn.Value != SoLuongSheet_Goi.Value * SoLuongPcs_Sheet.Value)
                            //    {
                            //        MessageBox.Show("");
                            //        MoNhac(@"Audio\DuSoLuong.wav");
                            //        if (MessageBox.Show("Số lượng đạt " + SoLuongSheet_Goi.Text + " ,bạn hãy chuyển công đoạn", "Cảnh báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                            //        {
                            //            //timer1.Start();
                            //            simpleButton1_Click(sender, e);
                            //            QuetTxt.Text = string.Empty;
                            //            SoLuongQuetTxt.Text = string.Empty;
                            //            tong = 0;
                            //            dem = 1;
                            //            QuetTxt.Focus();
                            //        }
                            //    }
                            //}
                        }
                        if (SoLuongCanIn.Value == ttsl && dem == 0 && ttsl > 0)
                        {
                            MessageBox.Show("");
                            MoNhac(@"Audio\HoanThanh.wav");
                            if (MessageBox.Show("Số lượng " + ttsl + " đã đúng Đã đúng với số lượng cần in, bạn có muốn hoàn tất đơn hàng", "Cảnh báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                            {
                                //timer1.Start();
                                SoLuongSheet_Goi.Value = SoLuongQuetTxt.Value;
                                simpleButton1_Click(sender, e);
                                ttsl = 0;
                                btnLamMoi_Click(sender, e);
                                tong = 0;
                                QuetTxt.Focus();
                            }
                        }
                        if (SoLuongQuetTxt.Value > SoLuongSheet_Goi.Value || ttsl > SoLuongCanIn.Value)
                        {
                            MessageBox.Show("");
                            MoNhac(@"Audio\CanhBao.wav");
                            MessageBox.Show("Tổng số lượng quét đã vượt quá yêu cầu");
                        }
                    }

                    //}
                    //else
                    //{
                    //    MessageBox.Show("Số lượng không được nhỏ hơn hoặc bằng 0");
                    //}

                    else
                    {
                        MaLoiTxt.Text      = QuetTxt.Text;
                        MaLoiTxt.ForeColor = Color.OrangeRed;
                        MessageBox.Show("");
                        MoNhac(@"Audio\CanhBao.wav");
                        MessageBox.Show("Mã vạch không trùng khớp , vui lòng xem lại");
                    }
                }
            }
            catch (Exception)
            {
                //MessageBox.Show(ex.Message);
                //MessageBox.Show(ex.Message);
            }
        }
Пример #3
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     QuetTxt.Text = string.Empty;
     QuetTxt.Focus();
 }