/// <summary> /// Sửa dữ liệu /// </summary> private void Xem() { if (tlbView.IsEnabled == false) { return; } if (grdDangKySanPhamDS.SelectedItems.Count == 1) { DataRow dr = ((DataRowView)grdDangKySanPhamDS.SelectedItems[0]).Row; ucDangKySanPhamCT_02 ucSanPhamCT = new ucDangKySanPhamCT_02(); ucSanPhamCT.IdSanPham = Convert.ToInt32(dr["ID"]); ucSanPhamCT.OnSavingComleted += new EventHandler(ucSanPhamCT_OnSavingComleted); LoadDuLieuCT loadDuLieu = new LoadDuLieuCT(ucSanPhamCT.LoadDuLieuCT); loadDuLieu(false); Window frm = new Window(); frm.Title = DatabaseConstant.layNgonNguTieuDeForm(this.function); frm.WindowStartupLocation = WindowStartupLocation.CenterScreen; frm.Content = ucSanPhamCT; frm.ShowDialog(); } else { LMessage.ShowMessage("M.DungChung.KhongDuocChonNhieu", LMessage.MessageBoxType.Warning); } }
/// <summary> /// Thêm /// </summary> private void Them() { if (tlbAdd.IsEnabled == false) { return; } ucDangKySanPhamCT_02 ucSanPhamCT = new ucDangKySanPhamCT_02(); ucSanPhamCT.OnSavingComleted += new EventHandler(ucSanPhamCT_OnSavingComleted); ucSanPhamCT.IdSanPham = 0; Window frm = new Window(); frm.Title = DatabaseConstant.layNgonNguTieuDeForm(this.function); frm.WindowStartupLocation = WindowStartupLocation.CenterScreen; frm.Content = ucSanPhamCT; frm.ShowDialog(); }