private void LoadCurrentFile() { var path = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); path += "\\LANTalk\\SaveFile\\SSP\\" + DateTime.Now.ToString("yyyy-MM-dd") + ".csv"; if (File.Exists(path)) { MainTable = CSVHelper.ReadCSVToTable(path); } else { MainTable = new DataTable(); MainTable.Columns.Add("Line", typeof(string)); MainTable.Columns.Add("Model", typeof(string)); MainTable.Columns.Add("IPN", typeof(string)); MainTable.Columns.Add("MO", typeof(string)); MainTable.Columns.Add("P/N", typeof(string)); MainTable.Columns.Add("Order_Qty", typeof(string)); MainTable.Columns.Add("Start_Time", typeof(string)); MainTable.Columns.Add("Daily_Plan", typeof(string)); MainTable.Columns.Add("Actual_Output", typeof(string)); MainTable.Columns.Add("Man_Status", typeof(string)); MainTable.Columns.Add("Machine_Status", typeof(string)); MainTable.Columns.Add("Material_Status", typeof(string)); MainTable.Columns.Add("Method_Status", typeof(string)); } }
private void btnOpenFile_Click(object sender, EventArgs e) { ofdOpenFile.ShowDialog(); if (!string.IsNullOrWhiteSpace(ofdOpenFile.FileName)) { MainTable = CSVHelper.ReadCSVToTable(ofdOpenFile.FileName); dglMain.DataSource = MainTable.Copy(); } }
public static DataTable LoadConfig() { try { var path = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); path += "\\LANTalk\\LANTalk.config"; return(CSVHelper.ReadCSVToTable(path)); } catch { return(null); } }
private void InitOrderList() { var path = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); foreach (var department in DepartmentList) { var currentpath = path + "\\LANTalk\\OrderList"; currentpath += "\\" + department.Name; currentpath += "\\" + DateTime.Now.ToString("yyyy-MM-dd") + ".csv"; if (File.Exists(currentpath)) { department.OrderList = CSVHelper.ReadCSVToTable(currentpath); } } }
private void btnOpenFile_Click(object sender, EventArgs e) { ofdOpenFile.ShowDialog(); var path = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); path += "\\LANTalk\\SaveFile\\SSP"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } ofdOpenFile.InitialDirectory = path; if (!string.IsNullOrWhiteSpace(ofdOpenFile.FileName)) { MainTable = CSVHelper.ReadCSVToTable(ofdOpenFile.FileName); dglMain.DataSource = MainTable.Copy(); } }