private void EditProductButton_Clickk(object sender, EventArgs e) { if (edit == -1) { AddProductButton.Hide(); DeleteProductButton.Hide(); } else { AddProductButton.Show(); DeleteProductButton.Show(); } if (edit == 1) { try { Products[ProductsGridView.CurrentCell.RowIndex].Size = ToInt64(SizeTextBox.Text); Products[ProductsGridView.CurrentCell.RowIndex].Name = NameTextBox.Text; Products[ProductsGridView.CurrentCell.RowIndex].Price = ToDouble(PriceTextBox.Text); Products[ProductsGridView.CurrentCell.RowIndex].Date = Convert.ToString(DateTimePickerOfProduct.Value); ProductsGridView.CurrentRow.SetValues(Products[ProductsGridView.CurrentCell.RowIndex].Id, Products[ProductsGridView.CurrentCell.RowIndex].Size, Products[ProductsGridView.CurrentCell.RowIndex].Date, Products[ProductsGridView.CurrentCell.RowIndex].Name, Products[ProductsGridView.CurrentCell.RowIndex].Price); SizeTextBox.Clear(); NameTextBox.Clear(); PriceTextBox.Clear(); } catch (Exception) { MessageBox.Show("Ошибка"); } } edit *= -1; }
public CartPage ClickDeleteProductButton() { DeleteProductButton.Click(); return(new CartPage(driver)); }