public ActionResult InicioDetVenta(cmVentaDet oDest) { if (Session["UserName"] == null) { return(RedirectToAction("TravelInicio", "Logueo")); } var resultado = new JObject(); try { CD_DetVenta odVenta = new CD_DetVenta(); List <cmVentaDet> lsDetSal = new List <cmVentaDet>(); lsDetSal = odVenta.fnlsRecuperaSalidaDes(oDest); if (lsDetSal.Count > 0) { resultado["LsSalidas"] = JToken.FromObject(lsDetSal); resultado["Exito"] = true; } } catch (Exception x) { resultado["Exito"] = false; } return(Content(resultado.ToString())); }
public ActionResult RecuperaFechasVen(cmVentaDet detVenta) { if (Session["UserName"] == null) { return(RedirectToAction("TravelInicio", "Logueo")); } var resultado = new JObject(); try { CD_Viajes cdViaje = new CD_Viajes(); List <cmVentaDet> lsVentaDetFec = new List <cmVentaDet>(); lsVentaDetFec = cdViaje.fnlsRecuperaFechaVen(detVenta); if (lsVentaDetFec.Count > 0) { JToken arFecDest = new JArray(from d in lsVentaDetFec select new JObject( new JProperty("IdVenta", d.idVenta), new JProperty("dtFecha", d.dtFecha) )); resultado["LsFechaVta"] = arFecDest; resultado["Exito"] = true; } } catch (Exception x) { resultado["Exito"] = false; } return(Content(resultado.ToString())); }
public ActionResult RecuperaDestinosVen(cmVentaDet detVenta) { var resultado = new JObject(); try { CD_Viajes cdViaje = new CD_Viajes(); List <cmVentaDet> lsVentaDetDes = new List <cmVentaDet>(); lsVentaDetDes = cdViaje.fnlsRecuperaDestino(detVenta); if (lsVentaDetDes.Count > 0) { JToken arDestinos = new JArray(from d in lsVentaDetDes select new JObject( new JProperty("IdDest", d.idDestino), new JProperty("Destino", d.sDestino) )); resultado["LsDestinos"] = arDestinos; resultado["Exito"] = true; } } catch (Exception x) { resultado["Exito"] = false; } return(Content(resultado.ToString())); }
public List <cmVentaDet> fnlsRecuperaFechaVen(cmVentaDet oVenSal) { using (var contexto = new TravelOKEntitiesQA()) { List <cmVentaDet> LsDesVenta = new List <cmVentaDet>(); LsDesVenta = (from salida in contexto.spsObtFechaViajes(oVenSal.idSalida, oVenSal.idDestino) select new cmVentaDet { idVenta = salida.IdViaje, dtFecha = salida.dtFechaSalida }).ToList(); return(LsDesVenta); } }
public List <cmVentaDet> fnlsRecuperaDestino(cmVentaDet oVenSal) { using (var contexto = new TravelOKEntitiesQA()) { List <cmVentaDet> LsDesVenta = new List <cmVentaDet>(); LsDesVenta = (from salida in contexto.spsObtLugarDestinoViajes(oVenSal.idSalida) select new cmVentaDet { idDestino = salida.Id_Destino, sDestino = salida.Destino }).ToList(); return(LsDesVenta); } }
public List <cmVentaDet> fnlsRecuperaSalidaDes(cmVentaDet oDestino) { using (var contexto = new TravelOKEntities()) { List <cmVentaDet> LsSalVenta = new List <cmVentaDet>(); LsSalVenta = (from salida in contexto.spsObtLugarSalViajesDest(oDestino.idDestino) select new cmVentaDet { idSalida = salida.Id_salida, sSalida = salida.Ciudad }).ToList(); return(LsSalVenta); } }
public cmTransporte fnoObtieneTransporte(cmVentaDet oVenTrans) { using (var contexto = new TravelOKEntitiesQA()) { oVenTrans.idTransporte = 0; oVenTrans = contexto.TO_Viajes.Where(ven => ven.IdViaje == oVenTrans.idVenta).Select( ven => new cmVentaDet { idVenta = ven.IdViaje, idTransporte = ven.IdTransporte } ).FirstOrDefault(); if (oVenTrans.idTransporte != 0) { return(contexto.TO_Transporte .Where(tran => tran.IdTransporte == oVenTrans.idTransporte) .Select(tran => new cmTransporte { IdTransporte = tran.IdTransporte, FilaTrasera = tran.FilaTrasera, NumAsFilCDosDif = tran.NumAsFilCDosDif, NumAsFilCUnoDif = tran.NumAsFilCUnoDif, NumAsientos = tran.NumAsientos, NumAsTrasera = tran.NumAsTrasera, NumColDos = tran.NumColDos, NumColPrin = tran.NumColPrin, NumColUno = tran.NumColUno, NumFilcolDos = tran.NumFilcolDos, NumFilColUno = tran.NumFilColUno, NumFilSanM = tran.NumFilSanM, NumSani = tran.NumSani, PrimFilColDosDif = tran.PrimFilColDosDif, PrimFilColUnoDif = tran.PrimFilColUnoDif, SaniTrasero = tran.SaniTrasero, SanMedio = tran.SanMedio }) .FirstOrDefault()); } else { return(null); } } }
public ActionResult InicialVenta(cmVentaDet detVenta) { if (Session["UserName"] == null) { return(RedirectToAction("TravelInicio", "Logueo")); } /*return View();*/ /*return RedirectToAction("SeleccionVenta");*/ var resultado = new JObject(); CD_Transporte cdTran = new CD_Transporte(); cmTransporte oTran = cdTran.fnoObtieneTransporte(detVenta); if (oTran != null) { resultado["lsOcupados"] = JToken.FromObject(cdTran.fnlsObtieneOcupados(detVenta.idVenta)); resultado["oTransporte"] = JToken.FromObject(oTran); resultado["Exito"] = true; } else { resultado["Exito"] = false; } return(Content(resultado.ToString())); }