Esempio n. 1
0
        private void btnCerrarCoamanda_Click(object sender, EventArgs e)
        {
            Int32 selectedRowCount =
                dgComanda.Rows.GetRowCount(DataGridViewElementStates.Selected);

            if (selectedRowCount == 1)
            {
                int id_comanda = 0;
                int mesa       = 0;
                int mozo       = 0;
                for (int i = 0; i < selectedRowCount; i++)
                {
                    id_comanda = Convert.ToInt32(dgComanda.SelectedRows[i].Cells["colComanda"].Value);
                    mesa       = Convert.ToInt32(dgComanda.SelectedRows[i].Cells["colMesa"].Value);
                    mozo       = Convert.ToInt32(dgComanda.SelectedRows[i].Cells["colMozo"].Value);
                }

                if (Comanda.bajaComanda(id_comanda))
                {
                    actualizarListaComanda();
                }
                else
                {
                    Funciones.mError(this, "ERROR AL CERRAR LA COMANDA");
                }
            }
            else
            {
                Funciones.mError(this, "Por favor seleccione una comanda");
            }
        }