/// <summary> /// Xử lý sự kiện sửa /// </summary> private void Sua() { if (grDanhSach.SelectedItems.Count == 1) { try { List <DataRow> list = new List <DataRow>(); DataRow dr = (DataRow)grDanhSach.SelectedItems.First(); list.Add(dr); ucDanhMucCT ct = new ucDanhMucCT(); ct.LstChiTiet = list; ct.ChiXem = false; Window window = new Window(); window.Content = ct; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.ShowDialog(); } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } } else { LMessage.ShowMessage("M.DungChung.KhongDuocChonNhieu", LMessage.MessageBoxType.Warning); } }
/// <summary> /// Xử lý sự kiện thêm /// </summary> private void Them() { try { ucDanhMucCT ct = new ucDanhMucCT(); ct.LstChiTiet = null; ct.ChiXem = false; Window window = new Window(); window.Content = ct; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.ShowDialog(); } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }