Beispiel #1
0
        private void cmdSkip_Click(object sender, EventArgs e)
        {
            if (EntryData.Count == 0)
            {
                MessageBox.Show("Nu exista nici o masina in asteptare!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            var         entry = EntryData[0];
            CommentForm cForm = new CommentForm();

            cForm.Comment = entry.comments;
            cForm.ShowDialog();
            if (cForm.DialogResult == DialogResult.OK)
            {
                entry.comments = cForm.Comment;
            }
            entry.dateSkip = DateTime.Now;
            AddSkipToFile(entry);
            AddToSkipList(entry);
            SkipData.Add(entry);
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SkipData"));

            using (FixedObjectFileStream stream = new FixedObjectFileStream(dataFile, FileMode.Open, FileAccess.ReadWrite)) {
                stream.RemoveAt(0);
            }

            if (EntryData != null)
            {
                EntryData.RemoveAt(0);
                AutoIncrementNrCrt = EntryData.Count == 0 ? 1 : EntryData.Last().nrCrt + 1;
                lstTruckOrder.Items.RemoveAt(0);

                foreach (TruckInfo ti in EntryData)
                {
                    lstTruckOrder.Items[--ti.nrCrt - 1].SubItems[0].Text = ti.nrCrt.ToString();
                }
            }
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("EntryData"));
        }
Beispiel #2
0
        private void cmdSkip_Click(object sender, EventArgs e)
        {
            if (EntryData.Count == 0) {
                MessageBox.Show("Nu exista nici o masina in asteptare!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            var entry = EntryData[0];
            CommentForm cForm = new CommentForm();
            cForm.Comment = entry.comments;
            cForm.ShowDialog();
            if (cForm.DialogResult == DialogResult.OK) {
                entry.comments = cForm.Comment;
            }
            entry.dateSkip = DateTime.Now;
            AddSkipToFile(entry);
            AddToSkipList(entry);
            SkipData.Add(entry);
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SkipData"));

            using (FixedObjectFileStream stream = new FixedObjectFileStream(dataFile, FileMode.Open, FileAccess.ReadWrite)) {
                stream.RemoveAt(0);
            }

            if (EntryData != null) {
                EntryData.RemoveAt(0);
                AutoIncrementNrCrt = EntryData.Count == 0 ? 1 : EntryData.Last().nrCrt + 1;
                lstTruckOrder.Items.RemoveAt(0);

                foreach (TruckInfo ti in EntryData)
                    lstTruckOrder.Items[--ti.nrCrt - 1].SubItems[0].Text = ti.nrCrt.ToString();
            }
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("EntryData"));
        }