Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        private void cmdOK_Click(object sender, EventArgs e)
        {
            ListViewItem t_item;

            Model.IAddress t_address;

            this.m_address.UserDefinedList.Clear();
            for (int t_idx = 0; t_idx < this.lsvUserDefined.Items.Count; t_idx++)
            {
                t_item    = this.lsvUserDefined.Items[t_idx];
                t_address = new Model.MAddress(t_item.SubItems[0].Text, t_item.SubItems[1].Text);
                this.m_address.UserDefinedList.Add(t_address);
            }

            CSV t_csv = new CSV(this.m_address.UserDefinedFile, this.m_address.Encoding);

            t_csv.Write(this.m_address.UserDefinedList);
            this.Close();
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        //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]);
            }
        }