public ActionResult FinalizarCompra()
        {
            List <CarritoItem> compra = (List <CarritoItem>)Session["carrito"];

            if (compra != null && compra.Count > 0)
            {
                BOLETA nuevaBoleta = new BOLETA();
                nuevaBoleta.FEC_BOL       = DateTime.Now;
                nuevaBoleta.IDE_CLI       = Convert.ToInt32(Session["Cliente"]);
                nuevaBoleta.IDE_VEN       = Convert.ToInt32(Session["Vendedor"]);
                nuevaBoleta.DETALLEBOLETA = (from producto in compra
                                             select new DETALLEBOLETA
                {
                    IDE_PRO = producto.Producto.IDE_PRO,
                    CAN_ART = producto.Cantidad,
                }).ToList();
                fe.BOLETA.Add(nuevaBoleta);
                fe.SaveChanges();
                Session["carrito"]  = new List <CarritoItem>();
                Session["Cliente"]  = null;
                Session["Vendedor"] = null;
                Session.Remove("Cliente");
                Session.Remove("Vendedor");
            }
            return(View());
        }
Example #2
0
        protected void btnRegistroSalida_Click(object sender, EventArgs e)
        {
            System.Threading.Thread.Sleep(5000);
            long   estacionamiento = Convert.ToInt64(idEstacionamiento);
            LOGIN  conserje        = (LOGIN)Session["conserje"];
            string resultBoleta    = Controller.ControllerBoleta.crearBoletaEst(estacionamiento, conserje.ID_PERSONA, total);

            if (resultBoleta.Equals("Boleta Creada"))
            {
                BOLETA boleta    = Controller.ControllerBoleta.buscarBoletaEst(estacionamiento);
                string date      = DateTime.Now.Date.ToString();
                string patente   = txtPatente.Text;
                string horaS     = date.Substring(0, 10) + " " + txtHoraSalida.Text;
                string resultEst = Controller.ControllerEstacionamientoVisita.salidaEstacionamiento(estacionamiento, boleta.ID_BOLETA, horaS, total, false);
                if (resultEst.Equals("Salida Registrada"))
                {
                    Session["SalidaEst"] = null;
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alertIns", "alert('Salida Estacionamiento Registrado');window.location.href='" + Request.RawUrl + "';", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alertIns", "alert('Error al Registrar Estacionamiento');window.location.href='" + Request.RawUrl + "';", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alertIns", "alert('Error al Registrar Salida Estacionamiento');window.location.href='" + Request.RawUrl + "';", true);
            }
        }
Example #3
0
 public static BOLETA buscarBoletaReserva(long conserje, long departamento, int costo)
 {
     using (EasyLifeEntities dbc = new EasyLifeEntities())
     {
         BOLETA aux = (from u in dbc.BOLETA
                       where u.ID_PERSONA == conserje && u.DEP == departamento && u.COSTO_BOLETA == costo
                       select u).FirstOrDefault();
         if (aux != null)
         {
             return(aux);
         }
         else
         {
             return(null);
         }
     }
 }
Example #4
0
 public static BOLETA buscarBoletaEst(long estacionamiento)
 {
     using (EasyLifeEntities dbc = new EasyLifeEntities())
     {
         BOLETA aux = (from u in dbc.BOLETA
                       where u.ID_ESTACIONAMIENTO == estacionamiento
                       select u).FirstOrDefault();
         if (aux != null)
         {
             return(aux);
         }
         else
         {
             return(null);
         }
     }
 }
Example #5
0
        private void button5_Click(object sender, EventArgs e)
        {
            BOLETA nom = new BOLETA();

            nom.Show();
        }