public void AddPane(CimVariacio cv) { CimPanel cp = new CimPanel(cv); Controls.Add(cp); cp.Dock = DockStyle.Top; }
private void UpdateCimlista() { cimGrid.Rows.Clear(); CimVariacio cv; if (napszakAdat != null) { foreach (int id in napszakAdat.Keys) { if (!napszakAdat[id].Kiosztott) { cv = new CimVariacio(); cv.Cim = napszakAdat[id].CsoInfo; cv.Info = napszakAdat[id].CsakCsoInfo; cv.Kob = napszakAdat[id].Kobmeter; cv.Id = id; cv.Check = napszakAdat[id].Lat == 0; cimGrid.Rows.Add(cv, napszakAdat[id].Kobmeter); } } } if (cimGrid.SortOrder != SortOrder.None) { cimGrid.Sort(cimGrid.SortedColumn, cimGrid.SortOrder == SortOrder.Ascending ? ListSortDirection.Ascending : ListSortDirection.Descending); } }
private void AddFuvar(CimVariacio cv, bool ui) { int m3 = partialRepo[cv.Id].WorkCapacity; if (!actualWorkSet.Add(cv.Id)) { if (!cv.Check) { groupCapacity += m3; actualWorkSet.Remove(cv.Id); partialRepo[cv.Id].Processed = false; RemoveFromAktivak(cv.Id); } } else { groupCapacity -= m3; if (ui) { browser.Document.InvokeScript("doid", new object[] { cv.Id }); clickedGroup.Items.Add(cv); AppLogger.WriteSelect(cv.Cim, true); } partialRepo[cv.Id].Processed = true; } }
private void CloseWithMultiCheck(object sender, EventArgs e) { int idInt = (int)browser.Document.InvokeScript("dosome"); CimVariacio item; List <CimVariacio> cimek = new List <CimVariacio>(); WorkData wd; if (remaining == 0) { MessageBox.Show("Az aktív járműnek nincs szabad címe a napszakban.\nVálasszon másik járművet.", "Nincs szabad cím", MessageBoxButtons.OK, MessageBoxIcon.Error); browser.Document.InvokeScript("undo", new object[] { idInt }); RestoreJunction(idInt); return; } if (multipleAddress.ContainsKey(idInt)) { foreach (int id in multipleAddress[idInt]) { wd = partialRepo[id]; if (wd.Kiosztott || wd.Processed || (alertGroup.Checked && !wd.Problematic) || (visibleGroup > 0 && wd.Csoport != visibleGroup)) { continue; } item = new CimVariacio(); item.Id = id; item.Cim = wd.GetInfo(true, true, true, true); item.Kob = wd.WorkCapacity; item.Megjegyzes = wd.Megjegyzes; cimek.Add(item); } } if (cimek.Count > 1) { using (MultiChoice ch = new MultiChoice(cimek)) { if (ch.ShowDialog() == DialogResult.OK) { foreach (CimVariacio cv in ch.GetAllChecked()) { AddFuvar(cv, false); } } } } else { item = new CimVariacio(); item.Id = idInt; item.Cim = partialRepo[idInt].GetInfo(true, true, true, true); item.Check = true; AddFuvar(item, false); } fixateBtn_Click(fixateBtn, null); }
private void kiválasztToolStripMenuItem_Click(object sender, EventArgs e) { if (cimGrid.SelectedRows.Count > 0) { CimVariacio ma = (CimVariacio)cimGrid.SelectedRows[0].Cells[0].Value; AddFuvar(ma, true); } }
private void mutatATérképenToolStripMenuItem_Click(object sender, EventArgs e) { if (cimGrid.SelectedRows.Count > 0) { CimVariacio ma = (CimVariacio)cimGrid.SelectedRows[0].Cells[0].Value; browser.Document.InvokeScript("centerTo", new object[] { ma.Id, ma.Cim }); } }
private void lezárToolStripMenuItem_Click(object sender, EventArgs e) { if (cimGrid.SelectedRows.Count > 0) { CimVariacio ma = (CimVariacio)cimGrid.SelectedRows[0].Cells[0].Value; AddFuvar(ma, false); fixateBtn_Click(fixateBtn, null); } }
private void AddWithMultiCheck(object sender, EventArgs e) { int idInt = (int)browser.Document.InvokeScript("dosome"); string info = ""; CimVariacio item; List <CimVariacio> cimek = new List <CimVariacio>(); if (napszakAdat[idInt].Lat != 0) { foreach (int a in napszakAdat.Keys) { if (!napszakAdat[a].Kiosztott && !napszakAdat[a].Processed && tavolsagok[a, idInt] == 0 && napszakAdat[a].Lat != 0) { item = new CimVariacio(); item.Id = a; item.Cim = napszakAdat[a].CsoInfo; item.Kob = napszakAdat[a].Kobmeter; info += napszakAdat[a].Megjegyzes + "<br/><br/>"; cimek.Add(item); } } } if (cimek.Count > 1) { browser.Document.InvokeScript("showMegaInfo", new object[] { info }); using (MultiChoice ch = new MultiChoice(cimek)) { if (ch.ShowDialog() == DialogResult.OK) { CheckedListBox cb = ch.items; if (!cb.CheckedIndices.Contains(idInt)) { browser.Document.InvokeScript("undo", new object[] { idInt }); } foreach (CimVariacio cv in cb.CheckedItems) { AddFuvar(cv, true); } } else { browser.Document.InvokeScript("undo", new object[] { idInt }); } } } else { item = new CimVariacio(); item.Id = idInt; item.Cim = napszakAdat[idInt].CsoInfo; item.Kob = napszakAdat[idInt].Kobmeter; AddFuvar(item, true); } }
private void CloseWithMultiCheck(object sender, EventArgs e) { int idInt = (int)browser.Document.InvokeScript("dosome"); CimVariacio item; List <CimVariacio> cimek = new List <CimVariacio>(); string info = ""; if (napszakAdat[idInt].Lat != 0) { foreach (int a in napszakAdat.Keys) { if (!napszakAdat[a].Kiosztott && !napszakAdat[a].Processed && tavolsagok[a, idInt] == 0 && napszakAdat[a].Lat != 0) { item = new CimVariacio(); item.Id = a; item.Cim = napszakAdat[a].CsoInfo; info += napszakAdat[a].Megjegyzes + "<br/><br/>"; cimek.Add(item); } } } if (cimek.Count > 1) { browser.Document.InvokeScript("showMegaInfo", new object[] { info }); using (MultiChoice ch = new MultiChoice(cimek)) { if (ch.ShowDialog() == DialogResult.OK) { CheckedListBox cb = ch.items; CimVariacio cv; for (int a = 0; a < cb.CheckedItems.Count; a++) { cv = (CimVariacio)cb.CheckedItems[a]; cv.Check = true; AddFuvar(cv, false); } } } } else { item = new CimVariacio(); item.Id = idInt; item.Cim = napszakAdat[idInt].CsoInfo; item.Check = true; AddFuvar(item, false); } fixateBtn_Click(fixateBtn, null); }
public CimPanel(CimVariacio cv) { this.cv = cv; InitializeComponent(); string inf = string.Format("{0}\nInfo: {1}", cv.Cim, cv.Megjegyzes); cim.Text = cv.Cim; info.Text = cv.Megjegyzes; cimTip.SetToolTip(info, inf); //cimTip.SetToolTip(info, inf); }
private void aktivak_MouseDoubleClick(object sender, MouseEventArgs e) { if (clickedGroup.SelectedIndex > -1) { CimVariacio ma = (CimVariacio)clickedGroup.SelectedItem; browser.Document.InvokeScript("undo", new object[] { ma.Id }); clickedGroup.Items.RemoveAt(clickedGroup.SelectedIndex); actualWorkSet.Remove(ma.Id); groupCapacity += ma.Kob; partialRepo[ma.Id].Processed = false; } }
private void cimGrid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.ColumnIndex == 0) { CimVariacio ma = (CimVariacio)cimGrid[0, e.RowIndex].Value; e.Value = ma.Info; if (ma.Check) { e.CellStyle.ForeColor = Color.Red; } } else { e.Value = cimGrid[e.ColumnIndex, e.RowIndex].Value.ToString(); } e.FormattingApplied = true; }
private void cimGrid_SortCompare(object sender, DataGridViewSortCompareEventArgs e) { switch (e.Column.Index) { case 0: CimVariacio v1 = (CimVariacio)e.CellValue1; CimVariacio v2 = (CimVariacio)e.CellValue2; e.SortResult = v1.Cim.CompareTo(v2.Cim); break; case 1: int i1 = (int)e.CellValue1, i2 = (int)e.CellValue2; e.SortResult = i1.CompareTo(i2); break; } e.Handled = true; }
private void cimGrid_MouseClick(object sender, MouseEventArgs e) { System.Windows.Forms.DataGridView.HitTestInfo hitTest = cimGrid.HitTest(e.X, e.Y); if (hitTest.Type == DataGridViewHitTestType.Cell) { if (!((DataGridViewRow)(cimGrid.Rows[hitTest.RowIndex])).Selected) { cimGrid.ClearSelection(); ((DataGridViewRow)cimGrid.Rows[hitTest.RowIndex]).Selected = true; } CimVariacio ma = (CimVariacio)cimGrid[0, hitTest.RowIndex].Value; ShowInfo(ma.Id); if (e.Button == MouseButtons.Right) { errorStrip.Show(cimGrid.PointToScreen(e.Location)); } } }
private void UpdateCimlista() { cimGrid.Rows.Clear(); CimVariacio cv; if (partialRepo != null) { foreach (int id in partialRepo.Keys) { if (!partialRepo[id].Kiosztott && (partialRepo[id].Csoport == visibleGroup || visibleGroup == 0)) { if (alertGroup.Checked && !partialRepo[id].Problematic) { continue; } cv = new CimVariacio(); cv.Cim = partialRepo[id].GetInfo(false, true, true, true); cv.Info = partialRepo[id].GetInfo(false, false, true, true); cv.Kob = partialRepo[id].WorkCapacity; cv.Id = id; cv.Check = partialRepo[id].Lat == 0; cimGrid.Rows.Add(cv, partialRepo[id].WorkCapacity); } } } if (cimGrid.SortOrder != SortOrder.None) { cimGrid.Sort(cimGrid.SortedColumn, cimGrid.SortOrder == SortOrder.Ascending ? ListSortDirection.Ascending : ListSortDirection.Descending); } if (cimGrid.Rows.Count > 0) { cimGrid.Rows[0].Selected = true; } UpdateBottomPanel(); }
private void AddFuvar(CimVariacio cv, bool ui) { if (aktivMenet == -1) { MessageBox.Show("Az aktív jármű minden fordulója le van zárva a napszakban.\nVálasszon másik járművet.", "Nincs szabad fuvar", MessageBoxButtons.OK, MessageBoxIcon.Error); browser.Document.InvokeScript("undo", new object[] { cv.Id }); return; } int m3 = napszakAdat[cv.Id].Kobmeter; if (!aktualisFordulo.Add(cv.Id)) { if (!cv.Check) { fuvarKapacitas += m3; aktualisFordulo.Remove(cv.Id); napszakAdat[cv.Id].Processed = false; RemoveFromAktivak(cv.Id); } } else { fuvarKapacitas -= m3; if (ui) { browser.Document.InvokeScript("doid", new object[] { cv.Id }); aktivak.Items.Add(cv); AppLogger.WriteSelect(cv.Cim, true); } napszakAdat[cv.Id].Processed = true; } }