예제 #1
0
 private void AddOrdersViews()
 {
     AddOrderViews newOrderView = new AddOrderViews();
        newOrderView.Text = "Добавить";
        newOrderView.ShowDialog();
        LoadOrdersViews();
 }
예제 #2
0
 private void EditOrdersViews()
 {
     if (orderViewsInfoDataGridView.SelectedRows.Count > 0)
        {
        int ordViewID = (int)orderViewsInfoDataGridView.SelectedRows[0].Cells[0].Value;
        foreach (OrderViewsInfo orderView in _orderViewList)
        {
            if (orderView.OrderViewID == ordViewID)
            {
                AddOrderViews newOrdView = new AddOrderViews();
                newOrdView.Text = "Изменить";
                newOrdView.ordViewInf = orderView;
                newOrdView.ShowDialog();
                break;
            }
        }
        LoadOrdersViews();
        }
        else
        {
        if (MessageBox.Show(this, "Ничего не выбрано!", "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error) == System.Windows.Forms.DialogResult.OK) return;
        }
 }