private void cmdExport_Click(object sender, EventArgs e) { this.ctlSaveFileDialog.FileName = ""; this.ctlSaveFileDialog.Filter = "CSV|*.csv"; this.ctlSaveFileDialog.AddExtension = true; this.ctlSaveFileDialog.ShowDialog(this); if (this.ctlSaveFileDialog.FileName == "") { return; } CSV w_csv = new CSV(this.ctlSaveFileDialog.FileName); CSV r_csv = new CSV(this.m_address.UserDefinedFile, this.m_address.Encoding); w_csv.Write(r_csv.Read()); }
private void cmdImport_Click(object sender, EventArgs e) { this.ctlOpenFileDialog.FileName = ""; this.ctlOpenFileDialog.ShowDialog(this); if (this.ctlOpenFileDialog.FileName == "") { return; } CSV t_csv = new CSV(this.ctlOpenFileDialog.FileName); List <Model.IAddress> t_list = t_csv.Read(); foreach (Model.IAddress t_address in t_list) { ListViewItem t_item = new ListViewItem(t_address.Company); t_item.SubItems.Add(t_address.Suffix); this.lsvUserDefined.Items.Add(t_item); } }
//protected override void OnLoadShipmentList() //{ // CSV t_csv = new CSV(this.m_shipment_file); // List<Model.IAddress> t_address_list = t_csv.ReadShipmentData(); // // this.m_shipment_list.Clear(); // for (int t_idx = 0; t_idx < t_address_list.Count; t_idx++) // { // this.m_shipment_list.Add(t_address_list[t_idx]); // } //} protected override void OnLoadUserDefinedList() { if (this.m_user_defined_file == null || this.m_user_defined_file == "") { return; } if (File.Exists(m_user_defined_file) == false) { return; } CSV t_csv = new CSV(this.m_user_defined_file); List <Model.IAddress> t_address_list = t_csv.Read(); this.m_encoding = t_csv.Encoding; this.m_user_defined_list.Clear(); for (int t_idx = 0; t_idx < t_address_list.Count; t_idx++) { this.m_user_defined_list.Add(t_address_list[t_idx]); } }