public UCKhachHang(Data.Transit transit) { InitializeComponent(); mTransit = transit; BOKhachHang = new Data.BOKhachHang(transit); PhanQuyen(); }
public WindowThemKhachHang(Data.Transit transit, Data.BOKhachHang bOKhachHang) { InitializeComponent(); BOKhachHang = bOKhachHang; mTransit = transit; _TenKhachHang = ""; _SoDienThoai = ""; }
private void AddList(Data.BOKhachHang item) { ListViewItem li = new ListViewItem(); li.Content = item; li.Tag = item; lvData.Items.Add(li); }
private void btnChon_Click(object sender, RoutedEventArgs e) { if (lvData.SelectedItem != null) { ListViewItem lv = (ListViewItem)lvData.SelectedItem; Data.BOKhachHang kh = (Data.BOKhachHang)lv.Tag; _KhachHang = kh; this.DialogResult = true; } }
private void btnXoa_Click(object sender, RoutedEventArgs e) { if (lvData.SelectedItems.Count > 0) { Data.BOKhachHang item = (Data.BOKhachHang)lvData.SelectedItems[0]; if (item.KhachHang.KhachHangID > 0) { item.KhachHang.Deleted = true; } lsArray.Remove(item); lvData.Items.Refresh(); } }
private void btnLuu_Click(object sender, RoutedEventArgs e) { if (CheckValues()) { if (_Item == null) { _Item = new Data.BOKhachHang(); _Item.KhachHang.Visual = true; _Item.KhachHang.Deleted = false; _Item.KhachHang.Edit = false; } GetValues(); DialogResult = true; } }
private void ThemMoi() { UserControlLibrary.WindowThemKhachHang win = new UserControlLibrary.WindowThemKhachHang(mTranSit, null); win._TenKhachHang = txtTenKhachHang.Text; win._SoDienThoai = txtSoDienThoai.Text; if (win.ShowDialog() == true) { //AddList(win._Item); if (win._Item.KhachHang.KhachHangID == 0) { mBOKhachHang.Them(win._Item); } mBOKhachHang.Commit(); _KhachHang = win._Item; this.DialogResult = true; } }
private void ThemMoi() { UserControlLibrary.WindowThemKhachHang win = new UserControlLibrary.WindowThemKhachHang(mTranSit, null); win._TenKhachHang = txtTenKhachHang.Text; win._SoDienThoai = txtSoDienThoai.Text; if (win.ShowDialog() == true) { //AddList(win._Item); if (win._Item.KhachHang.KhachHangID==0) { mBOKhachHang.Them(win._Item); } mBOKhachHang.Commit(); _KhachHang = win._Item; this.DialogResult = true; } }
public WindowTimKhachHang(Data.Transit transit) { mTranSit = transit; mBOKhachHang = new Data.BOKhachHang(mTranSit); InitializeComponent(); }