private void frmKhachDungThe_Load(object sender, System.EventArgs e) { try { if (_model != null) { txtMaThe.EditValue = _model.MaThe; _model.MaThe = txtMaThe.Text; txtMaKH.Text = _model.MaKhachHang; txtTenKH.Text = _model.TenKhachHang; txtSDT.Text = _model.SoDienThoai; deTuNgay.DateTime = _model.TuNgay; deDenNgay.DateTime = _model.DenNgay; txtDiaChi.Text = _model.DiaChi; } else { _model = new KhachHangDungThe(); txtMaThe.EditValue = _model.GetMaThe(); deDenNgay.DateTime = DateTime.Now; deTuNgay.DateTime = DateTime.Now; } } catch (Exception ex) { LogError.WriteLogError("Load Khách dùng thẻ cập nhật", ex); } }
public frmKhachDungThe(KhachHangDungThe model) { InitializeComponent(); _model = model; isEdit = true; }