private void btXoaToanBo_Click(object sender, EventArgs e) { Code(); XemDonHang(false); T2PhuPhi.ResetText(); NNCMT.ResetText(); NNDiaChi.ResetText(); NNSDT.ResetText(); NNTen.Clear(); NGCMT.Clear(); NGDiaChi.Clear(); NGSDT.Clear(); NGTen.Clear(); T2Cao.Clear(); T2Dai.Clear(); T2Rong.Clear(); T2Noidung.Clear(); T2TrongLuong.Clear(); T2Ghichu.Clear(); }
private void NNCMT_TextChanged(object sender, EventArgs e) { //Kiểm tra textbox if (NNCMT.Text != "" && !KiemTraSo(NNCMT.Text)) { ktNNCMT.Visible = true; btLuuDonHang.Enabled = false; } else { ktNNCMT.Visible = false; btLuuDonHang.Enabled = true; try { NGUOINHAN ng = (from a in db.NGUOINHANs where NNCMT.Text == a.CMND select a).SingleOrDefault(); if (ng == null) { NNTen.Clear(); NNDiaChi.Clear(); NNSDT.Clear(); } else { NNTen.Text = ng.HOTEN; NNDiaChi.Text = ng.DIACHI; NNSDT.Text = ng.SDT; } } catch (Exception ex) { XtraMessageBox.Show("Có lỗi trong quá trình thực hiện!", "NNCMT_TextChanged", MessageBoxButtons.OK, MessageBoxIcon.Error); log.Error(ex); } } }