private void button2_Click(object sender, EventArgs e) { //new Script().CheckEmpWorking(txt_emp_id, lb_emp_name); if (txt_emp_id.Text != "" && txt_bag.Text != "" && txt_cabinet.Text != "" && txt_money.Text != "" && txt_cabinet.Text != "00" && txt_cabinet.Text != "" && lb_emp_name.Text != "ไม่พบข้อมูลพนักงาน") { if (!scriptCode.DuplicateBag(txt_bag.Text, scriptCode.GetAroundInt())) { MessageBox.Show("ถุงเงินซ้ำ", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); txt_bag.Clear(); } else { if (txt_bag.Text.Length > 3) { ConfirmMoneyBag cfMoneyBag = new ConfirmMoneyBag(mainForm, this, txt_bag.Text, txt_emp_id.Text, txt_cabinet.Text, txt_money.Text, cpoint_id); cfMoneyBag.ShowDialog(); } else { MessageBox.Show("กรุณาป้อนถุงเงิน 4 หลัก", "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } else { MessageBox.Show("กรุณาป้อนข้อมูลให้ครบถ้วน ถูกต้อง", "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void txt_bag_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter && lb_emp_name.Text != "ไม่พบข้อมูลพนักงาน") { if (txt_emp_id.Text != "" && txt_bag.Text != "" && txt_cabinet.Text != "" && txt_money.Text != "") { ConfirmMoneyBag cfMoneyBag = new ConfirmMoneyBag(mainForm, this, txt_bag.Text, txt_emp_id.Text, txt_cabinet.Text, txt_money.Text, cpoint_id); cfMoneyBag.Show(); } else { MessageBox.Show("กรุณาป้อนข้อมูลให้ครบถ้วน", "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }