Пример #1
0
        /// <summary>
        ///     Добавление элемента с выбранными атрибутами, вызов AddDialogForm
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ButtonAddProduct_Click(object sender, EventArgs e)
        {
            var form = new AddDialogForm();

            form.ShowDialog();
            if (form.DialogResult == DialogResult.OK)
            {
                _checkList.Add(form.Object);
            }
        }
Пример #2
0
        private void ModifyButton_Click(object sender, EventArgs e)
        {
            if (productTable.CurrentRow != null)
            {
                try
                {
                    var form = new AddDialogForm();
                    form.Object = _checkList[productTable.CurrentRow.Index];
                    form.ShowDialog();

                    if (form.DialogResult == DialogResult.OK)
                    {
                        _checkList[productTable.CurrentRow.Index] = form.Object;
                    }

                    ShowObject.CheckPosition = _checkList[productTable.CurrentRow.Index];
                    ShowObject.Visible       = true;
                }
                catch (ArgumentException exception)
                {
                    MessageBox.Show(exception.Message);
                }
            }
        }