public int UpLoadCustomerToDataBase(string upLoadFiles) { if (File.Exists(upLoadFiles)) { List <Customer> costlist = MyExcelHelper.CustomerList(upLoadFiles); if (costlist == null) { return(0); } return(this.myDal.UploadCustomertoDataBase(costlist)); } return(0); }
public int UpLoadToDataBase(string upLoadFiles) { if (File.Exists(upLoadFiles)) //判断是否存在 { List <Cost> costList = MyExcelHelper.GetCostList(upLoadFiles); if (costList == null) { return(0); } return(this.myDal.UploadCosttoDataBase(costList)); } return(0); }
public int UpLoadCollectBagToDataBase(string upLoadFiles) { if (File.Exists(upLoadFiles)) { List <CollectPackBag> collectList = MyExcelHelper.GetCollectList(upLoadFiles); if (collectList == null) { return(0); } return(this.myDal.UploadCollectBagtoDataBase(collectList)); } return(0); }
public void GenerateExcelResults() { if (ExcelFileName == null) { MessageBox.Show("Please Load a file before attempting to generate the results", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning); } else { CurrentStatus = "Generating Results"; MyExcelHelper.GenerateOutputSheets(ExcelFileName); CurrentStatus = "Result Generation Completed"; } }
public int UpLoadPartsToDataBase(string upLoadFiles) { if (File.Exists(upLoadFiles)) { List <Parts> partlist = MyExcelHelper.GetPartsList(upLoadFiles); if (partlist == null) { return(0); } return(this.myDal.UploadPartstoDataBase(partlist)); } return(0); }
public void LoadExcelFile() { var ofd = new OpenFileDialog(); ofd.Filter = "Excel files (*.xlsx) | *.xlsx;"; ofd.Multiselect = false; var result = ofd.ShowDialog(); if (result == true) { ExcelFileName = ofd.FileName; CurrentStatus = "Loading file: " + ExcelFileName; MyExcelHelper.Load(ExcelFileName); Rules = MyExcelHelper.Rules; CurrentStatus = "File Loaded"; } }
private void CloseWorkbook(object sender, EventArgs e) { MyExcelHelper.CloseWorkbook(); }