Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TELEFONO tELEFONO = db.Telefonos.Find(id);

            db.Telefonos.Remove(tELEFONO);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 private void Limpiar()
 {
     Abono.Clear();
     Documento.Text = "DNI";
     Nombre.Clear(); TELEFONO.Clear(); PUNTO.Text = hu;
     NUMERO.Clear(); CANTBICI.SelectedIndex       = -1;  TIEMPOALQUI.SelectedIndex = -1;
     dtCLiente.ItemsSource = alquiler.ListarCliente(hu).OrderBy(k => Convert.ToDateTime(k.FECHA)).Where(K => Convert.ToDateTime(K.FECHA) > DateTime.Now.AddDays(-7));
     Volver();
 }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "TelefonoId,ClienteId,numero")] TELEFONO tELEFONO)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tELEFONO).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ClienteId = new SelectList(db.Clientes, "ClienteId", "nom_Cliente", tELEFONO.ClienteId);
     return(View(tELEFONO));
 }
Ejemplo n.º 4
0
        public ActionResult Create([Bind(Include = "TelefonoId,ClienteId,numero")] TELEFONO tELEFONO)
        {
            if (ModelState.IsValid)
            {
                db.Telefonos.Add(tELEFONO);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ClienteId = new SelectList(db.Clientes, "ClienteId", "nom_Cliente", tELEFONO.ClienteId);
            return(View(tELEFONO));
        }
Ejemplo n.º 5
0
        // GET: TELEFONOes/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TELEFONO tELEFONO = db.Telefonos.Find(id);

            if (tELEFONO == null)
            {
                return(HttpNotFound());
            }
            return(View(tELEFONO));
        }
Ejemplo n.º 6
0
        // GET: TELEFONOes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TELEFONO tELEFONO = db.Telefonos.Find(id);

            if (tELEFONO == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ClienteId = new SelectList(db.Clientes, "ClienteId", "nom_Cliente", tELEFONO.ClienteId);
            return(View(tELEFONO));
        }
Ejemplo n.º 7
0
        public void RefrescarFiltrado()
        {
            string condicion_filtro = CONDICION_FIJA;
            string patron           = @"^[0-9]*$";
            Regex  pa = new Regex(patron);

            if (NUMEROPEDIDO != null && NUMEROPEDIDO.Trim(' ').Length > 0 && pa.IsMatch(NUMEROPEDIDO))
            {
                condicion_filtro += " AND pe.idPedido = " + NUMEROPEDIDO;
            }
            if (AÑOSELECCIONADO != null && AÑOSELECCIONADO.Length > 0)
            {
                condicion_filtro += " AND YEAR(pe.fechaIntroduccion) = " + Convert.ToInt32(AÑOSELECCIONADO);
            }
            if (MESSELECCIONADO != null && MESSELECCIONADO.Length > 0)
            {
                condicion_filtro += " AND MONTH(pe.fechaIntroduccion) = " + Convert.ToInt32(MESSELECCIONADO);
            }
            if (SITUACIONESELECCIONADA.IDSITUACION != 0)
            {
                condicion_filtro += " AND pe.situacion = '" + SITUACIONESELECCIONADA.IDSITUACION + "'";
            }
            if (TIPOPEDIDOESELECCIONADA.IDTIPO != 0)
            {
                condicion_filtro += " AND pe.tipoPedido = '" + TIPOPEDIDOESELECCIONADA.IDTIPO + "'";
            }
            if (TELEFONO != null && TELEFONO.Trim(' ').Length > 0)
            {
                condicion_filtro += " AND pe.telefono LIKE '%" + TELEFONO + "%'";
            }
            if (POBLACION != null && POBLACION.Trim(' ').Length > 0)
            {
                condicion_filtro += " AND pe.poblacion LIKE '%" + POBLACION + "%'";
            }
            PEDIDOS = bbdd.ObtenerPedidos(condicion_filtro, false);
        }
 /// <summary>
 /// Metodo para eliminar un telefono.
 /// </summary>
 /// <param name="pTelefono"> Es un objeto tipo telefono, se debe de
 ///                   ingresar en el cuerpo del llamado a
 ///                   la pagina web.</param>
 public string Delete([FromBody] TELEFONO pTelefono)
 {
     dbEntities.usp_DelTelefono(pTelefono.TE_telefono, pTelefono.TE_userID);
     dbEntities.SaveChanges();
     return(respond);
 }