Esempio n. 1
0
        private void Drag_Panel_Tally_Input_DragDrop(object sender, DragEventArgs e)
        {
            var dropped          = ((string[])e.Data.GetData(DataFormats.FileDrop));
            var files            = dropped.ToList();
            Open_Tally_Input OTI = new Open_Tally_Input();

            foreach (string drop in dropped)
            {
                if (Path.GetExtension(drop) == ".csv")
                {
                    Drop_tally_label.Visible = false;

                    OTI.Open_Tally(drop);

                    ListBox_Of_Tallies_Input.Items.Add(Path.GetFileNameWithoutExtension(drop));
                }

                //if (Path.GetExtension(drop).ToLower() == ".xlsx")
                //{
                //    Drop_tally_label.Visible = false;

                //    OTI.Open_Excel(drop);
                //    foreach (string name in Open_Tally_Job.Excels_Names)
                //    {
                //        ListBox_Of_Tallies_Input.Items.Add(name);
                //    }
                //}
            }

            ALL_T_M.TM.load();
        }
Esempio n. 2
0
        private void addToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog openFileDialog = new OpenFileDialog())
            {
                openFileDialog.Filter      = "Tally File|*.csv";
                openFileDialog.Multiselect = true;
                Open_Tally_Input OTI = new Open_Tally_Input();

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    foreach (string file in openFileDialog.FileNames)
                    {
                        if (Path.GetExtension(file) == ".csv")
                        {
                            Drop_tally_label.Visible = false;

                            OTI.Open_Tally(file);

                            ListBox_Of_Tallies_Input.Items.Add(Path.GetFileNameWithoutExtension(file));
                        }

                        //if (Path.GetExtension(File).ToLower() == ".xlsx")
                        //{
                        //    Drop_tally_label.Visible = false;

                        //    OTJ.Open_Excel(File);
                        //    foreach (string name in Open_Tally_Job.Excels_Names)
                        //    {
                        //        ListBox_Of_Tallies_Job.Items.Add(name);
                        //    }
                        //}
                    }
                }

                ALL_T_M.TM.load();
            }
        }