示例#1
0
 public ReceiveStickerDialog(OMIClist oml)
 {
     InitializeComponent();
     list = oml;
     filterOutstandingLoads(oml);
     comboBox1.Refresh();
 }
示例#2
0
        public OMIClist Load(string filepath)
        {
            OMIClist    list = new OMIClist();
            XmlDocument doc  = new XmlDocument();

            doc.Load(filepath);
            XmlNodeList omicsList = doc.SelectNodes("/exports/Truck");

            foreach (XmlNode omic in omicsList)
            {
                string id     = omic.Attributes.GetNamedItem("OMIC").InnerText;
                OMIC   record = new OMIC(id);

                record.StickersOut.Other        = ExtractIntValue(ExtractValue(omic, "StickersOut/Other"));
                record.StickersOut.Partial      = ExtractIntValue(ExtractValue(omic, "StickersOut/Partial"));
                record.StickersReturned.Other   = ExtractIntValue(ExtractValue(omic, "StickersIn/Other"));
                record.StickersReturned.Partial = ExtractIntValue(ExtractValue(omic, "StickersIn/Partial"));
                record.UnitCount   = ExtractIntValue(ExtractValue(omic, "UnitCount"));
                record.LoadStatus  = ExtractCharValue(ExtractValue(omic, "LoadStatus"));
                record.DoorID      = record.DoorID = ExtractValue(omic, "DoorID");
                record.TotalWeight = ExtractFloatValue(ExtractValue(omic, "TotalWeight"));

                list.AddExistingRecord(record);
            }
            return(list);
        }
示例#3
0
        OMIClist filterOutstandingLoads(OMIClist oms)
        {
            OMIClist ol = oms.Filter((r) => { return(r.LoadStatus == 'N'); });

            comboBox2.Items.AddRange(ol.Select(r => r.OMICid).ToArray());
            comboBox2.AutoCompleteSource = AutoCompleteSource.ListItems;
            comboBox2.AutoCompleteMode   = AutoCompleteMode.Suggest;
            return(ol);
        }
示例#4
0
        public OMIClist Filter(Predicate <OMIC> p)
        {
            List <OMIC> l   = list.FindAll(p);
            OMIClist    oml = new OMIClist();

            foreach (OMIC o in l)
            {
                oml.AddExistingRecord(o);
            }
            return(oml);
        }
示例#5
0
        public void Save(string filepath, OMIClist data)
        {
            XmlDocument doc = new XmlDocument();

            doc.LoadXml("<?xml version=\"1.0\" encoding=\"UTF-8\"?> <exports></exports>");

            foreach (OMIC om in data)
            {
                XmlElement elem = OmicToXElem(om, doc);
                doc.DocumentElement.AppendChild(elem);
            }
            doc.Save(filepath);
        }
示例#6
0
        private void LoadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            StorageHandler sh = new StorageHandler();

            omList = sh.Load(ofd.FileName);
            displayList();
        }
示例#7
0
 public Form1()
 {
     omList = new OMIClist();
     InitializeComponent();
 }