コード例 #1
0
        private void btnAnularPedido_Click(object sender, EventArgs e)
        {
            FrmCargarMozo frm = new FrmCargarMozo();

            frm.reimprimir = true;
            frm.ShowDialog();

            if (FrmCargarMozo.cancel == false)
            {
                if (string.IsNullOrEmpty(txtMotivoAnulacion.Text) == true)
                {
                    MessageBox.Show("Especifique motivo de la Anulación.", "FactuTED", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                DialogResult msj = MessageBox.Show("Desea Anular El Pedido?", "FactuTED", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

                if (msj == DialogResult.OK)
                {
                    //fn.Modificar("Pedido", "Anulado='True'", "IDPedido='" + IDOrder + "'");
                    //fn.Modificar("Mesa", "Estado='LIBRE'", "IDMesa='" + lblMesa.Tag + "'");
                    fn.RegistrarOficial("PedidoAnulacion", "Fecha,Hora,IDPedido,Motivo,IDMozo", "'" + DateTime.Now.ToShortDateString() + "','" + DateTime.Now.ToShortTimeString() + "','" + IDOrder + "','" + txtMotivoAnulacion.Text + "','" + lblMozo.Tag + "'");
                    MessageBox.Show("Pedido Anulado y Mesa Liberada", "FactuTED", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.Close();
                }
            }
        }
コード例 #2
0
        private void btnCargarMozo_Click_1(object sender, EventArgs e)
        {
            FrmCargarMozo frm = new FrmCargarMozo();

            frm.ShowDialog();

            if (FrmCargarMozo.cancel == false)
            {
                lblMozo.Text = frm.cboMozo.Text;
                lblMozo.Tag  = frm.cboMozo.SelectedValue;
                txtBuscar.Focus();
            }
        }
コード例 #3
0
        private void nOIMPRIMIOToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmCargarMozo frm = new FrmCargarMozo();

            frm.reimprimir = true;
            frm.ShowDialog();

            if (FrmCargarMozo.cancel == false)
            {
                dgvPedido.CurrentRow.Cells["cnImprimido"].Value = false;
                reimprimir = true;
            }
        }
コード例 #4
0
        private void qUITARToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (DataGridViewRow row2 in dgvPedido.SelectedRows)
                {
                    if (string.IsNullOrWhiteSpace(row2.Cells["cnCodPedido"].Value.ToString()) == true)
                    {
                        DialogResult result = MessageBox.Show("Desea Quitar el Plato de la Lista", "FactuTED", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);

                        if (result == DialogResult.Yes)
                        {
                            bool combo = Convert.ToBoolean(dgvPedido.CurrentRow.Cells["cnCombo"].Value);

                            if (combo)
                            {
                                string idPresentacion = dgvPedido.CurrentRow.Cells["cnCodigo"].Value.ToString();

                                for (int i = 0; i < dgvPedido.Rows.Count; i++)
                                {
                                    if (dgvPedido.Rows[i].Cells["cnIDPresentacionCombo"].Value.ToString() == idPresentacion)
                                    {
                                        dgvPedido.Rows.Remove(dgvPedido.Rows[i]);
                                        i--;
                                    }
                                }
                            }
                            dgvPedido.Rows.Remove(row2);
                        }
                    }
                    else
                    {
                        DialogResult result = MessageBox.Show("Desea Quitar el Plato de la Lista", "FactuTED", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);



                        if (result == DialogResult.Yes)
                        {
                            FrmCargarMozo frm = new FrmCargarMozo();
                            frm.reimprimir = true;
                            frm.ShowDialog();

                            if (FrmCargarMozo.cancel == false)
                            {
                                if (!row2.IsNewRow)
                                {
                                    string codPedido = dgvPedido.CurrentRow.Cells["cnCodPedido"].Value.ToString();
                                    fn.Eliminar("PedidoDetalle", "IDDetallePedido='" + codPedido + "'");

                                    bool combo = Convert.ToBoolean(dgvPedido.CurrentRow.Cells["cnCombo"].Value);

                                    if (combo)
                                    {
                                        string idPresentacion = dgvPedido.CurrentRow.Cells["cnCodigo"].Value.ToString();

                                        for (int i = 0; i < dgvPedido.Rows.Count; i++)
                                        {
                                            if (dgvPedido.Rows[i].Cells["cnIDPresentacionCombo"].Value.ToString() == idPresentacion)
                                            {
                                                dgvPedido.Rows.Remove(dgvPedido.Rows[i]);
                                                i--;
                                            }
                                        }


                                        fn.Eliminar("PedidoDetalle", "IDPresentacionCombo = '" + idPresentacion + "'");
                                    }


                                    dgvPedido.Rows.Remove(row2);
                                }
                            }
                        }
                    }
                }

                calcularTotal();
            }
            catch (Exception ex)
            {
            }
        }