public static IEnumerable <ProofPaymentdt> ComprobantedePago() { chzkEntities db = new chzkEntities(); var list = from b in db.ProofPayment select new ProofPaymentdt() { proofPayment1 = b.proofPayment1 }; return(list); }
//listado de tipos de documentos public static IEnumerable <DocumentTypedt> ListarTipoDocumento() { chzkEntities db = new chzkEntities(); var list = from b in db.DocumentType select new DocumentTypedt() { documentType1 = b.documentType1, description = b.description }; return(list); }
public static IEnumerable <Storedt> TiendasPorPais(string pais, string direccion) { chzkEntities db = new chzkEntities(); var list = from b in db.Store.Where(t => t.country == pais && t.address == direccion) select new Storedt() { storeId = b.storeId, district = b.district }; return(list); }
//listado de monedas public static IEnumerable <Currencydt> ListarMonedas() { chzkEntities db = new chzkEntities(); var list = from b in db.Currency select new Currencydt() { currency1 = b.currency1, description = b.description }; return(list); }
public static IEnumerable <DeliveryServicedt> EntregasPorTienda(int tienda) { chzkEntities db = new chzkEntities(); var list = from b in db.DeliveryService.Where(t => t.storeId == tienda) select new DeliveryServicedt() { deliveryTrackCode = b.deliveryTrackCode, storeId = b.storeId }; return(list); }
public static IEnumerable <DeliveryServicedt> Entregas() { chzkEntities db = new chzkEntities(); var list = from b in db.DeliveryService select new DeliveryServicedt() { deliveryTrackCode = b.deliveryTrackCode, storeId = b.storeId }; return(list); }
public static IEnumerable <Modedt> MododeEnvio() { chzkEntities db = new chzkEntities(); var list = from b in db.Mode select new Modedt() { mode1 = b.mode1, description = b.description, fee = b.fee }; return(list); }
public static IEnumerable <Countrydt> ListarPaises() { chzkEntities db = new chzkEntities(); var list = from b in db.Country select new Countrydt() { country1 = b.country1, description = b.description, timezone = b.timezone }; return(list); }
public static IEnumerable <Storedt> Tiendas() { chzkEntities db = new chzkEntities(); var list = from b in db.Store select new Storedt() { storeId = b.storeId, district = b.district, reference = b.reference }; return(list); }
//listado de monedas por pais public static IEnumerable <Currencydt> ListarMonedasXpais(string pais) { chzkEntities db = new chzkEntities(); var list = from b in db.Currency.Where(t => t.country == pais) select new Currencydt() { currency1 = b.currency1, description = b.description, sign = b.sign }; return(list); }
//listado de tamaños public static IEnumerable <DeliverySizedt> ListarTamaños() { chzkEntities db = new chzkEntities(); var list = from b in db.DeliverySize select new DeliverySizedt() { size = b.size, description = b.description, fee = b.fee }; return(list); }
public static void ValidarTienda(string distrito_n, string direccion_n, string referencia_n, string pais_n) { chzkEntities db = new chzkEntities(); var otienda = db.Store.FirstOrDefault(t => t.district == distrito_n && t.address == direccion_n && t.reference == referencia_n && t.country == pais_n); if (otienda == null) { Store ntienda = new Store() { district = distrito_n, address = direccion_n, reference = referencia_n, country = pais_n }; db.Store.Add(ntienda); db.SaveChanges(); } else { //db.Entry(otienda).State = EntityState.Modified; // db.SaveChanges(); } }
public static IEnumerable <Storedt> ListarTiendas(string distrito, string direccion, string referencia, string pais) { chzkEntities db = new chzkEntities(); var list = from b in db.Store.Where(t => t.district == distrito && t.address == direccion && t.reference == referencia && t.country == pais) select new Storedt() { storeId = b.storeId, district = b.district, reference = b.reference }; /* * System.Linq.IQueryable<Storedt> list_temp1; * System.Linq.IQueryable<Storedt> list_temp2; * System.Linq.IQueryable<Storedt> list_x_distrito; * System.Linq.IQueryable<Storedt> list_x_direccion; * System.Linq.IQueryable<Storedt> list_x_referencia; * System.Linq.IQueryable<Storedt> list_x_pais; * * list_x_distrito = from b in db.Store.Where(t => t.district == distrito) * select new Storedt() * { * storeId = b.storeId, * district = b.district, * reference = b.reference * }; * * list_x_direccion = from b in db.Store.Where(t => t.address == direccion) * select new Storedt() * { * storeId = b.storeId, * district = b.district, * reference = b.reference * }; * * * * list_x_referencia = from b in db.Store.Where(t => t.reference == referencia) * select new Storedt() * { * storeId = b.storeId, * district = b.district, * reference = b.reference * }; * * list_x_pais = from b in db.Store.Where(t => t.country == pais) * select new Storedt() * { * storeId = b.storeId, * district = b.district, * reference = b.reference * }; * * list_temp1 = buscarTiendas(list_x_distrito, list_x_direccion); * list_temp2 = buscarTiendas(list_x_referencia, list_x_pais); * * return buscarTiendas(list_temp1, list_temp2); */ return(list); }