Ejemplo n.º 1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (setup.SelectedRows.Count == 0)
            {
                Msg.Exclamation("Выберите элемент сборки");
                return;
            }
            PartOfToolSetup p   = retTool.First(x => x.Tool.Id == Guid.Parse(setup.SelectedRows[0].Cells[0].Value.ToString()));
            var             frm = new FrmGetNum();

            frm.Count = p.Count;

            if (frm.ShowDialog() == DialogResult.OK)
            {
                p.Count = frm.Count;
                UpdateGrid();
            }
        }
Ejemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (database.SelectedRows.Count == 0)
            {
                return;
            }
            var frm = new FrmGetNum();

            if (frm.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            PartOfToolSetup partOfToolSetup = new PartOfToolSetup();

            partOfToolSetup.Tool  = _toolsDB.First(x => x.Id == Guid.Parse(database.SelectedRows[0].Cells[0].Value.ToString()));
            partOfToolSetup.Count = frm.Count;
            retTool.Add(partOfToolSetup);

            UpdateGrid();
        }