Esempio n. 1
0
        private bool ProcessTextFile() {
            
               // textfileOpen.Filter = "Text Files (*.txt) | *.doc";
                textfileOpen.InitialDirectory = @"C:\";
                textfileOpen.Title = "Select Text File To Process";
                TextFileReadingHelper _helper = new TextFileReadingHelper();
                if (textfileOpen.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {


                    string _path = textfileOpen.FileName;
                    foreach (var Line in _helper.getAllLines(_path)) {

                        if (Line.Length == 5)
                        {
                            GenaricRepository<Employee> _EmployeeRepos = new GenaricRepository<Employee>(new ItrackContext());
                            var emplist = _EmployeeRepos.GetAll().Where(x=>x.EmployeeID == Line);
                            if (emplist.Count() > 0)
                            {
                                _employee.EmployeeID = Line;

                            }
                            else {

                                Debug.WriteLine("Error :" + _employee.EmployeeID);
                            
                            }
                         
                            Debug.WriteLine("EMployee ID :" + Line);
                        }
                        else if (Line.Length == 6) 
                        {

                            offlineScaning(Line);
                            Debug.WriteLine(Line);
                        }
                    
                }

                


            }

            return true;
        
        }
Esempio n. 2
0
        private bool ProcessTextFile()
        {

            // textfileOpen.Filter = "Text Files (*.txt) | *.doc";
            textfileOpen.InitialDirectory = @"C:\";
            textfileOpen.Title = "Select Text File To Process";
            TextFileReadingHelper _helper = new TextFileReadingHelper();
            if (textfileOpen.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {


                string _path = textfileOpen.FileName;

                txtLocation.Text = _path;



            }

            return true;

        }