Пример #1
0
        private void btnRegresar_Click(object sender, EventArgs e)
        {
            IndexNew objindex = new IndexNew();

            objindex.Show();
            this.Close();
        }
Пример #2
0
        private void btnCerrar_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("¿Deseas facturar esta venta?",
                                "Alerta!", MessageBoxButtons.YesNo,
                                MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, 0, false)
                == DialogResult.Yes)
            {
                using (var ctx = new AppDTEntities())
                {
                    var ticket = (from s in ctx.TICKETS_PV
                                  where s.Ticket_Id == idTicket
                                  select s).FirstOrDefault();

                    ticket.Ticket_Status   = "terminado";
                    ticket.Ticket_Subtotal = Convert.ToInt32(lblTotal.Text);

                    int num = ctx.SaveChanges();
                }

                IndexNew objmesas = new IndexNew();
                objmesas.Show();
                this.Close();

                //datosFactura factura = new datosFactura(idTicket);
                //factura.Show();
                //btnimprime_Click(sender, e);
                //MessageBox.Show("Facturando");
            }
            else
            {
                using (var ctx = new AppDTEntities())
                {
                    var ticket = (from s in ctx.TICKETS_PV
                                  where s.Ticket_Id == idTicket
                                  select s).FirstOrDefault();

                    ticket.Ticket_Status   = "terminado";
                    ticket.Ticket_Subtotal = Convert.ToInt32(lblTotal.Text);

                    int num = ctx.SaveChanges();
                }

                IndexNew objmesas = new IndexNew();
                objmesas.Show();
                // btnimprime_Click(sender, e);
                this.Close();
            }
        }
Пример #3
0
        void Acceso()
        {
            string Pass = GetMD5(txtContra.Text);

            var login = db.USUARIOS_PV.Where(u => u.User_Login == txtUsuario.Text && u.User_Password == Pass).ToList();

            if (login.Count() != 0)
            {
                //MessageBox.Show("Entra");
                txtContra.Text   = "";
                txtUsuario.Text  = "";
                lblError.Visible = false;
                IndexNew objForm = new IndexNew();
                objForm.Show();
            }
            else
            {
                //MessageBox.Show("No entro");
                lblError.Visible = true;
            }
        }