Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        public void resize(int x, int y, int w, int h)
        {
            Geometry.Rectangle r = new Geometry.Rectangle(w, h, new Geometry.Point(x, y));
            var a = r.Split(1, 4, 0.05f, 0.05f);

            PalleteButton.Reorient(a[0]);
            AddProductButton.Reorient(a[1]);
            ReconnectButton.Reorient(a[2]);
            BypassButton.Reorient(a[3]);
        }