示例#1
0
        // добавление объекта
        private void addObject_Click(object sender, EventArgs e)
        {
            //string nameO = Interaction.InputBox("Введите название объекта", "Запрос", "", -1, -1);
            //string addressO = Interaction.InputBox("Введите адрес объекта", "Запрос", "", -1, -1);
            InputObjectInfo ioi = new InputObjectInfo();

            ioi.ShowDialog();
            //ObjectRect or = new ObjectRect() { Name = nameO, Address = addressO };
            if (ioi.DialogResult == DialogResult.OK)
            {
                dbo.Value.AddObject(ioi.orNew);
            }

            RefreshObjectList();
        }
示例#2
0
        // редактирование объекта
        private void editObject_Click(object sender, EventArgs e)
        {
            InputObjectInfo ioi = new InputObjectInfo()
            {
                orNew = dgObjects.CurrentRow.DataBoundItem as ObjectRect
            };
            ObjectRect old = dgObjects.CurrentRow.DataBoundItem as ObjectRect;

            ioi.ShowDialog();
            if (ioi.DialogResult == DialogResult.OK)
            {
                dbo.Value.UpdateObject(old, ioi.orNew);
            }
            RefreshObjectList();
        }