public UCXuLyKho(Data.Transit transit) { InitializeComponent(); mTransit = transit; dtpThoiGian.SelectedDate = DateTime.Now; BOXuLyKho = new Data.BOXuLyKho(transit); }
private void lvData_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (lvData.SelectedItems.Count > 0) { mItem = (Data.BOXuLyKho)lvData.SelectedItems[0]; } }
public WindowXyLyKho(Data.Transit transit, Data.BOXuLyKho bOXuLyKho) { InitializeComponent(); mTransit = transit; //BOQuanLyKho = new Data.BOQuanLyKho(transit); BOXuLyKhoChiTiet = new Data.BOXuLyKhoChiTiet(transit); lsLoaiBan = Data.BOLoaiBan.GetAllNoTracking(mTransit).ToList(); BOXuLyKho = bOXuLyKho; }
private void btnXoa_Click(object sender, RoutedEventArgs e) { if (lvData.SelectedItems.Count > 0) { mItem = (Data.BOXuLyKho)lvData.SelectedItems[0]; if (lsArrayDeleted == null) { lsArrayDeleted = new List<Data.BOXuLyKho>(); } if (mItem.XuLyKho.ChinhKhoID > 0) lsArrayDeleted.Add(mItem); lvData.Items.Remove(lvData.SelectedItems[0]); if (lvData.Items.Count > 0) { lvData.SelectedIndex = 0; } } }
private void btnSua_Click(object sender, RoutedEventArgs e) { if (lvData.SelectedItems.Count > 0) { ListViewItem li = (ListViewItem)lvData.SelectedItems[0]; mItem = (Data.BOXuLyKho)li.Tag; UserControlLibrary.WindowXyLyKho win = new UserControlLibrary.WindowXyLyKho(mTransit, BOXuLyKho); win._Item = mItem; if (win.ShowDialog() == true) { win._Item.XuLyKho.Edit = true; li.Tag = win._Item; li.Content = win._Item; lvData.Items.Refresh(); } } }
private void btnXoa_Click(object sender, RoutedEventArgs e) { if (lvData.SelectedItems.Count > 0) { mItem = (Data.BOXuLyKho)lvData.SelectedItems[0]; if (lsArrayDeleted == null) { lsArrayDeleted = new List <Data.BOXuLyKho>(); } if (mItem.XuLyKho.ChinhKhoID > 0) { lsArrayDeleted.Add(mItem); } lvData.Items.Remove(lvData.SelectedItems[0]); if (lvData.Items.Count > 0) { lvData.SelectedIndex = 0; } } }
private void btnLuu_Click(object sender, RoutedEventArgs e) { List <Data.BOXuLyKho> lsArray = null; foreach (ListViewItem li in lvData.Items) { mItem = (Data.BOXuLyKho)li.Tag; if (mItem.XuLyKho.ChinhKhoID == 0 || mItem.XuLyKho.Edit == true) { if (lsArray == null) { lsArray = new List <Data.BOXuLyKho>(); } lsArray.Add(mItem); } } BOXuLyKho.Luu(lsArray, lsArrayDeleted, mTransit); LoadDanhSach(); UserControlLibrary.WindowMessageBox messageBox = new UserControlLibrary.WindowMessageBox(mTransit.StringButton.LuuThanhCong); messageBox.ShowDialog(); }
private void btnLuu_Click(object sender, RoutedEventArgs e) { if (lsArray != null && lsArray.Count > 0) { if (CheckValues()) { if (_Item == null) { _Item = new Data.BOXuLyKho(); _Item.XuLyKho.Visual = true; _Item.XuLyKho.Deleted = false; _Item.XuLyKho.Edit = false; _Item.XuLyKho.NhanVienID = mTransit.NhanVien.NhanVienID; } GetValues(); BOXuLyKho.Them(_Item, lsArray, mTransit); //BOQuanLyKho.NhapKho(lsArray, mTransit); UserControlLibrary.WindowMessageBox.ShowDialog(lbTieuDe.Text + " thành công"); DialogResult = true; } } }
private void btnLuu_Click(object sender, RoutedEventArgs e) { List<Data.BOXuLyKho> lsArray = null; foreach (ListViewItem li in lvData.Items) { mItem = (Data.BOXuLyKho)li.Tag; if (mItem.XuLyKho.ChinhKhoID == 0 || mItem.XuLyKho.Edit == true) { if (lsArray == null) lsArray = new List<Data.BOXuLyKho>(); lsArray.Add(mItem); } } BOXuLyKho.Luu(lsArray, lsArrayDeleted, mTransit); LoadDanhSach(); UserControlLibrary.WindowMessageBox messageBox = new UserControlLibrary.WindowMessageBox(mTransit.StringButton.LuuThanhCong); messageBox.ShowDialog(); }
private void btnDanhSach_Click(object sender, RoutedEventArgs e) { mItem = null; lsArrayDeleted = null; LoadDanhSach(); }