private void Button_Click_1(object sender, RoutedEventArgs e) { MessageBoxResult exit = MessageBox.Show("Thêm dữ liệu mới sẽ xóa hét các dữ liệu lớp học củ!!", "Cảnh Báo", MessageBoxButton.YesNo); if (exit == MessageBoxResult.Yes) { LuuDuLieu.DocExcel(linkExcel, ngayBatDau, ngayKetThuc, soTietHoc); } }
public Test() { DateTime ngayBatDau = new DateTime(2018, 1, 2); DateTime ngayKetThuc = new DateTime(2018, 6, 2); int buoiHoc = 15; BO.ConfigSystem config = new BO.ConfigSystem() { NgayBatDau = ngayBatDau, NgayKetThuc = ngayKetThuc, SoBuoi = buoiHoc }; ConfigSystem doConfigSystem = new ConfigSystem(); doConfigSystem.LuuConfigSystem(config); LuuDuLieu.DocExcel(@"D:\Project\T_Manager\T_Manager\bin\Debug\gvv.xlsx"); InitializeComponent(); }
private void luu_Click(object sender, RoutedEventArgs e) { int _soBuoiHoc; if (string.IsNullOrEmpty(excelName.Text) || string.IsNullOrEmpty(ngayBatDau.Text) || string.IsNullOrEmpty(ngayKetThuc.Text) || !int.TryParse(SoBuoiHoc.Text, out _soBuoiHoc)) { return; } MongoDB <int> .XoaData(); ConfigSystem config = new ConfigSystem() { NgayBatDau = ngayBatDau.SelectedDate.Value, NgayKetThuc = ngayKetThuc.SelectedDate.Value, SoBuoi = int.Parse(SoBuoiHoc.Text) }; DO.ConfigSystem doConfig = new DO.ConfigSystem(); doConfig.LuuConfigSystem(config); LuuDuLieu.DocExcel(linkExcel); }