Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Order order = new Order(Convert.ToInt32(textBox1.Text), textBox2.Text, textBox3.Text, Convert.ToInt32(textBox4.Text), Convert.ToDouble(textBox5.Text));

            OrdersFunctions.Create(order.ToString());
            this.FindForm().Dispose();
        }
Example #2
0
        public MainForm()
        {
            InitializeComponent();
            CustomersFunctions.CheckandCreate();
            OrdersFunctions.CheckandCreate();

            RefreshGridCustomers();
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
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();
            }
        }
Example #6
0
        private void OrdersForm_Load(object sender, EventArgs e)
        {
            int ID = int.Parse(SetId);

            OrdersGridView.DataSource = OrdersFunctions.Read(ID);
            DataGridViewRow row         = OrdersGridView.CurrentCell.OwningRow;
            string          Description = row.Cells[2].Value.ToString();
            string          quantity    = row.Cells[3].Value.ToString();
            string          price       = row.Cells[4].Value.ToString();

            UpdateDescription.Text = Description;
            UpdateQuantity.Text    = quantity;
            UpdatePrice.Text       = price;
            SetNumberOrders();
        }