Beispiel #1
0
        private void Reload(int clientID)
        {
            if (!File.Exists("packages.xml"))
            {
                File.Create("packages.xml");
            }
            List <Package> packagesFromXML = new XMLProvider().XMLToPackages();

            packagesFromXML = packagesFromXML.Where(e => e.ID_User == clientID).ToList();
            dataGridViewPackages.Rows.Clear();
            if (packagesFromXML != null)
            {
                foreach (var pack in packagesFromXML)
                {
                    dataGridViewPackages.Rows.Add(pack.PackageNumber, pack.Status, pack.StatusChangedDate.ToString("g"));
                }
            }
        }
Beispiel #2
0
        private void textBoxPackageNumber_TextChanged(object sender, EventArgs e)
        {
            var searchOption = textBoxPackageNumber.Text;

            if (!File.Exists("packages.xml"))
            {
                File.Create("packages.xml");
            }
            List <Package> packagesFromXML = new XMLProvider().XMLToPackages();

            packagesFromXML = packagesFromXML.Where(f => f.PackageNumber.Contains(searchOption)).ToList();
            dataGridViewPackages.Rows.Clear();
            if (packagesFromXML != null)
            {
                foreach (var pack in packagesFromXML)
                {
                    dataGridViewPackages.Rows.Add(pack.PackageNumber, pack.Status, pack.StatusChangedDate.ToString("g"));
                }
            }
        }