Пример #1
0
        private void checkBox1_Click(object sender, EventArgs e)
        {
            CheckBox       cb         = sender as CheckBox;
            frmTableConfig configForm = new frmTableConfig();

            configForm.mesaID     = cb.Tag.ToString();
            configForm.enableMesa = "NO";
            if (cb.Checked)
            {
                configForm.enableMesa = "SI";
            }
            DialogResult result = configForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                DataSet dsMesaInfo = DataUtil.FillDataSet(DataBaseQuerys.Mesa(DataUtil.GetInt(cb.Tag)), "mesa");
                cb.Text    = DataUtil.GetString(dsMesaInfo.Tables[0].Rows[0], "Mesa_descripcion");
                cb.Checked = DataUtil.GetBool(dsMesaInfo.Tables[0].Rows[0], "Mesa_habilitado");
            }
            else
            {
                if (cb.Checked)
                {
                    cb.Checked = false;
                }
                else
                {
                    cb.Checked = true;
                }
            }
        }
Пример #2
0
        private void GetMesaInfo()
        {
            var dsMesaInfo = DataUtil.FillDataSet(DataBaseQuerys.Mesa(DataUtil.GetInt(mesaID)), "mesa");

            if (dsMesaInfo.Tables[0].Rows.Count > 0)
            {
                if (DataUtil.GetString(DataUtil.GetString(dsMesaInfo.Tables[0].Rows[0], "mesa_tipo")).Equals("BAR"))
                {
                    tipoMesa = "Bar :";
                }
                else
                {
                    tipoMesa = "Mesa :";
                }

                mesaDesc = DataUtil.GetString(dsMesaInfo.Tables[0].Rows[0], "Mesa_descripcion");
                if (pedidoID == 0)
                {
                    pedidoID = DataUtil.GetInt(dsMesaInfo.Tables[0].Rows[0], "Pedido_id");
                }

                lblTipoMesa.Visible = true;
                lblMesaDesc.Visible = true;
                lblTipoMesa.Text    = tipoMesa;
                lblMesaDesc.Text    = mesaDesc;
            }
        }
Пример #3
0
        private void frmChangeTable_Load(object sender, EventArgs e)
        {
            foreach (Control button in this.Controls)
            {
                if (button is Button)
                {
                    Button mesa = button as Button;

                    if (mesa.Tag != null)
                    {
                        DataSet dsMesaInfo = DataUtil.FillDataSet(DataBaseQuerys.Mesa(DataUtil.GetInt(mesa.Tag)), "mesa");
                        mesa.Text    = DataUtil.GetString(dsMesaInfo.Tables[0].Rows[0], "Mesa_descripcion");
                        mesa.Visible = DataUtil.GetBool(dsMesaInfo.Tables[0].Rows[0], "Mesa_habilitado");
                        if (DataUtil.GetString(dsMesaInfo.Tables[0].Rows[0], "Mesa_estado").Equals("LIBRE"))
                        {
                            mesa.Image = RestautantResource.Mesa;
                        }
                        else
                        {
                            mesa.Visible = false;
                        }
                    }
                }
            }
        }
Пример #4
0
        private void frmTableConfig_Load(object sender, EventArgs e)
        {
            DataSet dsMesaInfo = DataUtil.FillDataSet(DataBaseQuerys.Mesa(DataUtil.GetInt(mesaID)), "mesa");

            txtDescripcion.Text = DataUtil.GetString(dsMesaInfo.Tables[0].Rows[0], "Mesa_descripcion");
            if (txtDescripcion.Text.Equals("CONFIG. MESA") || txtDescripcion.Equals("CONFIG. BAR"))
            {
                txtDescripcion.Text = string.Empty;
            }
            lblTipo.Text          = DataUtil.GetString(dsMesaInfo.Tables[0].Rows[0], "Mesa_tipo");
            cbEstado.SelectedItem = enableMesa;
        }
Пример #5
0
        private void frmTable_Load(object sender, EventArgs e)
        {
            DataSet dsMesaInfo = null;

            foreach (Control mesa in gbSalon.Controls)
            {
                CheckBox cb = mesa as CheckBox;

                dsMesaInfo = DataUtil.FillDataSet(DataBaseQuerys.Mesa(DataUtil.GetInt(cb.Tag)), "mesa");
                cb.Text    = DataUtil.GetString(dsMesaInfo.Tables[0].Rows[0], "Mesa_descripcion");
                cb.Checked = DataUtil.GetBool(dsMesaInfo.Tables[0].Rows[0], "Mesa_habilitado");
            }
            foreach (Control bar in gbBar.Controls)
            {
                CheckBox cb = bar as CheckBox;

                dsMesaInfo = DataUtil.FillDataSet(DataBaseQuerys.Mesa(DataUtil.GetInt(cb.Tag)), "mesa");
                cb.Text    = DataUtil.GetString(dsMesaInfo.Tables[0].Rows[0], "Mesa_descripcion");
                cb.Checked = DataUtil.GetBool(dsMesaInfo.Tables[0].Rows[0], "Mesa_habilitado");
            }
        }