コード例 #1
0
ファイル: OrdersForm.cs プロジェクト: Karajohann/OrderSystem
        private void button2_Click(object sender, EventArgs e)
        {
            DataGridViewRow row         = OrdersGridView.CurrentCell.OwningRow;
            int             ID          = Convert.ToInt32(row.Cells[0].Value.ToString());
            string          Ordercode   = row.Cells[1].Value.ToString();
            string          Description = row.Cells[2].Value.ToString();
            int             quantity    = Convert.ToInt32(row.Cells[3].Value.ToString());
            double          price       = Convert.ToDouble(row.Cells[4].Value.ToString());

            OrdersFunctions.Delete(ID, Ordercode, Description, quantity, price);
            OrdersForm_Load(this, null);
        }
コード例 #2
0
ファイル: OrdersForm.cs プロジェクト: Karajohann/OrderSystem
        private void button3_Click(object sender, EventArgs e)
        {
            DataGridViewRow row         = OrdersGridView.CurrentCell.OwningRow;
            int             ID          = Convert.ToInt32(row.Cells[0].Value.ToString());
            string          Ordercode   = row.Cells[1].Value.ToString();
            string          Description = UpdateDescription.Text;
            int             Quantity    = Convert.ToInt32(UpdateQuantity.Text);
            double          Price       = Convert.ToDouble(UpdatePrice.Text);

            OrdersFunctions.Delete(ID, Ordercode, Description, Quantity, Price);
            OrdersFunctions.Update(ID, Ordercode, Description, Quantity, Price);
            OrdersForm_Load(this, null);
        }
コード例 #3
0
        private void btnDeleteCustomer_Click(object sender, EventArgs e)
        {
            DataGridViewRow row       = dataGridView1.CurrentCell.OwningRow;
            int             ID        = Convert.ToInt32(row.Cells[0].Value.ToString());
            string          FirstName = row.Cells[1].Value.ToString();
            string          LastName  = row.Cells[2].Value.ToString();

            if (MessageBox.Show("ΠΡΟΣΟΧΗ! Εάν ο πελάτης έχει αποθηκευμένες παραγγελίες θα σβηστούν και αυτές!\nΕίστε σίγουροι ότι θέλετε να σβήσετε τον πελάτη;", "Διαγραφή πελάτη " + FirstName + " " + LastName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
            {
                CustomersFunctions CF = new CustomersFunctions();
                CF.Delete(ID);
                OrdersFunctions.Delete(ID);
                RefreshGridCustomers();
            }
        }