public DescuentoCollections(string json) { DataContractJsonSerializer serializador = new DataContractJsonSerializer(typeof(DescuentoCollections)); MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(json)); DescuentoCollections descList = (DescuentoCollections)serializador.ReadObject(stream); this.AddRange(descList); }
private DescuentoCollections GenerarLista(List <DALC.DESCUENTO> listaDALC) { DescuentoCollections list = new DescuentoCollections(); foreach (var item in listaDALC) { Descuento desc = new Descuento(); desc.IdDescuento = (int)item.ID_DESCUENTO; desc.MinPuntos = (int)item.MIN_PUNTOS; desc.MaxPuntos = (int)item.MAX_PUNTOS; desc.Porcentaje = (int)item.PORCENTAJE; desc.Tope = (int)item.TOPE; list.Add(desc); } return(list); }