public void loadSync(object element) { if (element != null) { INFRAESTRUCTURA poco = (INFRAESTRUCTURA)element; using (var entity = new TAE2Entities()) { var query = (from cust in entity.INFRAESTRUCTURAs where poco.UNID_INFRAESTRUCTURA == cust.UNID_INFRAESTRUCTURA select cust).ToList(); //Actualización if (query.Count > 0) { var aux = query.First(); if (aux.LAST_MODIFIED_DATE < poco.LAST_MODIFIED_DATE) { udpateElementSync((object)poco); } } //Inserción else { insertElementSync((object)poco); } var modifiedInfra = entity.INFRAESTRUCTURAs.First(p => p.UNID_INFRAESTRUCTURA == poco.UNID_INFRAESTRUCTURA); modifiedInfra.IS_MODIFIED = false; entity.SaveChanges(); } } }
public ULTIMO_MOVIMIENTO getCantidadItems(ITEM item, INFRAESTRUCTURA infraestructura) { ULTIMO_MOVIMIENTO um = new ULTIMO_MOVIMIENTO(); try { if (item != null && infraestructura != null) { using (var entity = new TAE2Entities()) { //var r = (from p in entity.ULTIMO_MOVIMIENTO // where p.UNID_ITEM == item.UNID_ITEM && p.UNID_INFRAESTRUCTURA == infraestructura.UNID_INFRAESTRUCTURA // select p).First(); //um = r; var r = (from p in entity.ULTIMO_MOVIMIENTO where p.UNID_ITEM == item.UNID_ITEM && p.UNID_INFRAESTRUCTURA == infraestructura.UNID_INFRAESTRUCTURA select p).First(); if (r == null) { return(null); } um.ITEM_STATUS = r.ITEM_STATUS; um = r; } } } catch (Exception) { return(new ULTIMO_MOVIMIENTO()); } return(um); }
public void insertElement(object element, USUARIO u) { if (element != null) { using (var entity = new TAE2Entities()) { INFRAESTRUCTURA tra = (INFRAESTRUCTURA)element; var validacion = (from cust in entity.INFRAESTRUCTURAs where cust.INFRAESTRUCTURA_NAME == tra.INFRAESTRUCTURA_NAME select cust).ToList(); if (validacion.Count == 0) { tra.UNID_INFRAESTRUCTURA = UNID.getNewUNID(); //Sync tra.IS_MODIFIED = true; tra.IS_ACTIVE = true; tra.LAST_MODIFIED_DATE = UNID.getNewUNID(); var modifiedSync = entity.SYNCs.First(p => p.UNID_SYNC == 20120101000000000); modifiedSync.ACTUAL_DATE = UNID.getNewUNID(); entity.SaveChanges(); // entity.INFRAESTRUCTURAs.AddObject(tra); entity.SaveChanges(); UNID.Master(tra, u, -1, "Inserción"); } } } }
public DeleteInfraestructura(INFRAESTRUCTURA infraestructura) { this.UNID_INFRAESTRUCTURA = infraestructura.UNID_INFRAESTRUCTURA; this.INFRAESTRUCTURA_NAME = infraestructura.INFRAESTRUCTURA_NAME; this.IS_ACTIVE = infraestructura.IS_ACTIVE; this._isChecked = false; }
public CatalogInfraestructuraModel(IDataMapper dataMapper) { this._dataMapper = new InfraestructuraDataMapper(); this._infraestructuras = new FixupCollection <DeleteInfraestructura>(); this._selectedInfraestructura = new INFRAESTRUCTURA(); this.loadItems(); }
public void saveArticulo() { if (_dataMapper != null) { ITEM item = new ITEM(); item.UNID_ITEM = this.UnidItem; ULTIMO_MOVIMIENTO tmp = new ULTIMO_MOVIMIENTO(); if (this._unidAlmacen != null) { ALMACEN almacen = new ALMACEN(); almacen.UNID_ALMACEN = (long)this._unidAlmacen; tmp = this._dataMapper.getCantidadItems(item, almacen); } else if (this._unidProveedor != null) { PROVEEDOR proveedor = new PROVEEDOR(); proveedor.UNID_PROVEEDOR = (long)this._unidProveedor; tmp = this._dataMapper.getCantidadItems(item, proveedor); } else if (this._unidCliente != null) { CLIENTE cliente = new CLIENTE(); cliente.UNID_CLIENTE = (long)this._unidCliente; tmp = this._dataMapper.getCantidadItems(item, cliente); } else if (this._unidInfraestructura != null) { INFRAESTRUCTURA infraestructura = new INFRAESTRUCTURA(); infraestructura.UNID_INFRAESTRUCTURA = (long)this._unidInfraestructura; tmp = this._dataMapper.getCantidadItems(item, infraestructura); } this._cantidad += tmp.CANTIDAD; if (tmp.UNID_ULTIMO_MOVIMIENTO == 0) { _dataMapper.insertElement(new ULTIMO_MOVIMIENTO { UNID_ITEM = this._unidItem, UNID_ALMACEN = this._unidAlmacen, UNID_CLIENTE = this.UnidCliente, UNID_MOVIMIENTO_DETALLE = this._unidMovimientoDetalle, UNID_PROVEEDOR = this._unidProveedor, UNID_INFRAESTRUCTURA = this._unidInfraestructura, IS_ACTIVE = true, CANTIDAD = this._cantidad, UNID_ITEM_STATUS = this._unidItemStatus }); } else { _dataMapper.udpateElement2(new ULTIMO_MOVIMIENTO { UNID_ULTIMO_MOVIMIENTO = tmp.UNID_ULTIMO_MOVIMIENTO, UNID_ITEM = this._unidItem, UNID_ALMACEN = this._unidAlmacen, UNID_CLIENTE = this.UnidCliente, UNID_MOVIMIENTO_DETALLE = this._unidMovimientoDetalle, UNID_PROVEEDOR = this._unidProveedor, UNID_INFRAESTRUCTURA = this._unidInfraestructura, IS_ACTIVE = true, CANTIDAD = this._cantidad, UNID_ITEM_STATUS = this._unidItemStatus }); } //_dataMapper.insertElement(new MOVIMENTO() { UNID_MOVIMIENTO = this._unidMovimiento, FECHA_MOVIMIENTO = this._fechaMovimiento, UNID_TIPO_MOVIMIENTO = this._tipoMovimiento.UNID_TIPO_MOVIMIENTO, UNID_ALMACEN_DESTINO = this._almacenDestino.UNID_ALMACEN, UNID_PROVEEDOR_DESTINO = this._proveedorDestino.UNID_PROVEEDOR, UNID_CLIENTE_DESTINO = this._clienteDestino.UNID_CLIENTE, UNID_ALMACEN_PROCEDENCIA = this._almacenProcedencia.UNID_ALMACEN, UNID_CLIENTE_PROCEDENCIA = this._clienteProcedencia.UNID_CLIENTE, UNID_PROVEEDOR_PROCEDENCIA = this._proveedorProcedencia.UNID_PROVEEDOR, UNID_SERVICIO = this._servicio.UNID_SERVICIO, TT = this._tt, CONTACTO = this._contacto, UNID_TRANSPORTE = this._transporte.UNID_TRANSPORTE, IS_ACTIVE = this._isActive, DIRECCION_ENVIO = this._direccionEnvio, SITIO_ENLACE = this._sitioEnlace, NOMBRE_SITIO = this._nombreSitio, RECIBE = this._recibe, GUIA = this._guia, UNID_CLIENTE = this._cliente.UNID_CLIENTE, UNID_PROVEEDOR = this._proveedor.UNID_PROVEEDOR, UNID_FACTURA_VENTA = this._facturaVenta.UNID_FACTURA_VENTA }); //_dataMapper.udpateElement(new ULTIMO_MOVIMIENTO { UNID_ITEM = this._unidItem, UNID_ALMACEN = this._unidAlmacen, UNID_CLIENTE = this.UnidCliente, UNID_MOVIMIENTO_DETALLE = this._unidMovimientoDetalle, UNID_PROVEEDOR = this._unidProveedor, UNID_INFRAESTRUCTURA = this._unidInfraestructura, IS_ACTIVE = true, CANTIDAD = this._cantidad }); //_dataMapper.udpateElement2(new ULTIMO_MOVIMIENTO { UNID_ITEM = this._unidItem, UNID_ALMACEN = this._unidAlmacen, UNID_CLIENTE = this.UnidCliente, UNID_MOVIMIENTO_DETALLE = this._unidMovimientoDetalle, UNID_PROVEEDOR = this._unidProveedor, UNID_INFRAESTRUCTURA = this._unidInfraestructura, IS_ACTIVE = true, CANTIDAD = this._cantidad }); } }
public void updateArticulo(INFRAESTRUCTURA infraestructura) { if (infraestructura != null) { if (_dataMapper != null) { ITEM item = new ITEM(); item.UNID_ITEM = this.UnidItem; ULTIMO_MOVIMIENTO aux = this._dataMapper.getCantidadItems(item, infraestructura); aux.CANTIDAD -= this._cantidad; this._dataMapper.udpateElement2(aux); } } }
public void getCantidadItemsTest() { UltimoMovimientoDataMapper target = new UltimoMovimientoDataMapper(); // TODO: Inicializar en un valor adecuado ITEM item = new ITEM(); // TODO: Inicializar en un valor adecuado INFRAESTRUCTURA infraestructura = new INFRAESTRUCTURA(); // TODO: Inicializar en un valor adecuado item.UNID_ITEM = 20130103181604156; infraestructura.UNID_INFRAESTRUCTURA = 2; ULTIMO_MOVIMIENTO expected = new ULTIMO_MOVIMIENTO(); expected.CANTIDAD = 100;// TODO: Inicializar en un valor adecuado ULTIMO_MOVIMIENTO actual; actual = target.getCantidadItems(item, infraestructura); Assert.AreEqual(expected.CANTIDAD, actual.CANTIDAD); }
public void insertElementSync(object element) { if (element != null) { using (var entity = new TAE2Entities()) { INFRAESTRUCTURA tra = (INFRAESTRUCTURA)element; //Sync tra.IS_MODIFIED = true; tra.LAST_MODIFIED_DATE = UNID.getNewUNID(); var modifiedSync = entity.SYNCs.First(p => p.UNID_SYNC == 20120101000000000); modifiedSync.ACTUAL_DATE = UNID.getNewUNID(); entity.SaveChanges(); // entity.INFRAESTRUCTURAs.AddObject(tra); entity.SaveChanges(); } } }
public void udpateElement(object element, USUARIO u) { if (element != null) { using (var entity = new TAE2Entities()) { INFRAESTRUCTURA infraestructura = (INFRAESTRUCTURA)element; var modifiedItemStatus = entity.INFRAESTRUCTURAs.First(p => p.UNID_INFRAESTRUCTURA == infraestructura.UNID_INFRAESTRUCTURA); modifiedItemStatus.INFRAESTRUCTURA_NAME = infraestructura.INFRAESTRUCTURA_NAME; //Sync modifiedItemStatus.IS_MODIFIED = true; modifiedItemStatus.LAST_MODIFIED_DATE = UNID.getNewUNID(); var modifiedSync = entity.SYNCs.First(p => p.UNID_SYNC == 20120101000000000); modifiedSync.ACTUAL_DATE = UNID.getNewUNID(); entity.SaveChanges(); // UNID.Master(infraestructura, u, -1, "Modificación"); } } }
public void deleteElement(object element) { if (element != null) { using (var entity = new TAE2Entities()) { INFRAESTRUCTURA infraestructura = (INFRAESTRUCTURA)element; var deleteTipoEmpresa = entity.INFRAESTRUCTURAs.First(p => p.UNID_INFRAESTRUCTURA == infraestructura.UNID_INFRAESTRUCTURA); deleteTipoEmpresa.IS_ACTIVE = false; //Sync deleteTipoEmpresa.IS_MODIFIED = true; deleteTipoEmpresa.LAST_MODIFIED_DATE = UNID.getNewUNID(); var modifiedSync = entity.SYNCs.First(p => p.UNID_SYNC == 20120101000000000); modifiedSync.ACTUAL_DATE = UNID.getNewUNID(); entity.SaveChanges(); // entity.SaveChanges(); } } }
public object getElement(object element) { object res = null; using (var entity = new TAE2Entities()) { //INFRAESTRUCTURA TEmp = (INFRAESTRUCTURA)element; //res = (from tipo in entity.INFRAESTRUCTURAs // where tipo.UNID_INFRAESTRUCTURA == TEmp.UNID_INFRAESTRUCTURA // select tipo).ToList(); //return res; INFRAESTRUCTURA TEmp = (INFRAESTRUCTURA)element; res = (from tipo in entity.INFRAESTRUCTURAs where tipo.UNID_INFRAESTRUCTURA == TEmp.UNID_INFRAESTRUCTURA select tipo).First(); return(res); } }
public void loadItems(INFRAESTRUCTURA infra) { try { bool ban = false; this.Mensaje1 = ""; this.Mensaje2 = ""; object element = this._dataMapper.getElements_EntradasSalidasSerie(infra, this._serie, this._sku); FixupCollection <ItemModel> ic = new FixupCollection <ItemModel>(); if (this.ItemModel.Count != 0) { foreach (ItemModel elem in this.ItemModel) { if (elem.IsChecked) { ic.Add(elem); } } } this.ItemModel.Clear(); if (element != null) { foreach (ITEM elemento in (List <ITEM>)element) { ban = true; ItemModel aux = new ItemModel(elemento); UltimoMovimientoDataMapper ultimomovimientodm = new UltimoMovimientoDataMapper(); ULTIMO_MOVIMIENTO tmp = new ULTIMO_MOVIMIENTO(); if (infra != null) { tmp = ultimomovimientodm.getCantidadItems(elemento, infra); } aux.CantidadDisponible = tmp.CANTIDAD; aux.CantidadMovimiento = 1; aux.ItemStatus = tmp.ITEM_STATUS; if (aux.CantidadDisponible > 0) { bool auxx = true; foreach (ItemModel elem in ic) { if (elem.UNID_ITEM == aux.UNID_ITEM && elem.NUMERO_SERIE == aux.NUMERO_SERIE && elem.SKU == aux.SKU) { auxx = false; } } if (auxx) { aux.IsChecked = true; ic.Add(aux); } } else { this.Mensaje1 = "Este artículo no se encuentra en el lugar especificado"; } } } if (ic != null) { this.ItemModel = ic; } if (!ban) { this.Mensaje1 = "Este artículo no se encuentra en el lugar especificado"; object element2 = this._dataMapper.getAlmacenDisponible(this._serie, this._sku); bool aux = false; this.Mensaje2 = "El artículo se encuentra en: "; foreach (ULTIMO_MOVIMIENTO um in (List <ULTIMO_MOVIMIENTO>)element2) { if (um.CLIENTE != null) { this.Mensaje2 += " El cliente: " + um.CLIENTE.CLIENTE1; aux = true; } if (um.PROVEEDOR != null) { aux = true; this.Mensaje2 += " El proveedor: " + um.PROVEEDOR.PROVEEDOR_NAME; } if (um.INFRAESTRUCTURA != null) { aux = true; this.Mensaje2 += " La infraestructura: " + um.INFRAESTRUCTURA.INFRAESTRUCTURA_NAME; } if (um.ALMACEN != null) { aux = true; this.Mensaje2 += " El almacén: " + um.ALMACEN.ALMACEN_NAME; } } if (!aux) { this.Mensaje2 = "El artículo no se encuentra en ningún cliente o proveedor"; } } } catch (ArgumentException ae) { ; } catch (Exception ex) { throw ex; } }
public void CargaMovimiento(MOVIMENTO m) { this._dataMapperArticulos = new MovimientoDetalleDataMapper(); this._dataMaperItemsLectura = new ItemDataMapper(); this._almacenDestino = new ALMACEN(); this._almacenProcedencia = new ALMACEN(); this._unidCliente = new CLIENTE(); this._clienteDestino = new CLIENTE(); this._clienteProcedencia = new CLIENTE(); this._unidFacturaVenta = new FACTURA_VENTA(); this._unidInfraestructura = new INFRAESTRUCTURA(); this._unidProveedor = new PROVEEDOR(); this._proveedorDestino = new PROVEEDOR(); this._proveedorProcedenia = new PROVEEDOR(); this._servicio = new SERVICIO(); this._unidSolicitante = new SOLICITANTE(); this._unidTecnico = new TECNICO(); this._unidTecnicoTrans = new TECNICO(); this._tipoMovimientos = new TIPO_MOVIMIENTO(); this._transporte = new TRANSPORTE(); this._unidTecnicoTrans = new TECNICO(); if (m.UNID_ALMACEN_DESTINO != null) { this._almacenDestino.UNID_ALMACEN = (long)m.UNID_ALMACEN_DESTINO; } if (m.UNID_ALMACEN_PROCEDENCIA != null) { this._almacenProcedencia.UNID_ALMACEN = (long)m.UNID_ALMACEN_PROCEDENCIA; } if (m.UNID_CLIENTE != null) { this._unidCliente.UNID_CLIENTE = (long)m.UNID_CLIENTE; } if (m.UNID_CLIENTE_DESTINO != null) { this._clienteDestino.UNID_CLIENTE = (long)m.UNID_CLIENTE_DESTINO; } if (m.UNID_CLIENTE_PROCEDENCIA != null) { this._clienteProcedencia.UNID_CLIENTE = (long)m.UNID_CLIENTE_PROCEDENCIA; } if (m.UNID_FACTURA_VENTA != null) { this._unidFacturaVenta.UNID_FACTURA_VENTA = (long)m.UNID_FACTURA_VENTA; } if (m.UNID_INFRAESTRUCTURA != null) { this._unidInfraestructura.UNID_INFRAESTRUCTURA = (long)m.UNID_INFRAESTRUCTURA; } if (m.UNID_MOVIMIENTO != null) { this._unidMovimiento = m.UNID_MOVIMIENTO; } if (m.UNID_PROVEEDOR != null) { this._unidProveedor.UNID_PROVEEDOR = (long)m.UNID_PROVEEDOR; } if (m.UNID_PROVEEDOR_DESTINO != null) { this._proveedorDestino.UNID_PROVEEDOR = (long)m.UNID_PROVEEDOR_DESTINO; } if (m.UNID_PROVEEDOR_PROCEDENCIA != null) { this._proveedorProcedenia.UNID_PROVEEDOR = (long)m.UNID_PROVEEDOR_PROCEDENCIA; } if (m.UNID_SERVICIO != null) { this._servicio.UNID_SERVICIO = (long)m.UNID_SERVICIO; } if (m.UNID_SOLICITANTE != null) { this._unidSolicitante.UNID_SOLICITANTE = (long)m.UNID_SOLICITANTE; } if (m.UNID_TECNICO != null) { this._unidTecnico.UNID_TECNICO = (long)m.UNID_TECNICO; } if (m.UNID_TECNICO_TRAS != null) { this._unidTecnicoTrans.UNID_TECNICO = (long)m.UNID_TECNICO_TRAS; } if (m.UNID_TIPO_MOVIMIENTO != null) { this._tipoMovimientos.UNID_TIPO_MOVIMIENTO = m.UNID_TIPO_MOVIMIENTO; } if (m.UNID_TRANSPORTE != null) { this._transporte.UNID_TRANSPORTE = (long)m.UNID_TRANSPORTE; } this._contacto = m.CONTACTO; this._guia = m.GUIA; this._sitioEnlace = m.SITIO_ENLACE; this._nombreSitio = m.NOMBRE_SITIO; this._tt = m.TT; this._timeFecha = m.FECHA_MOVIMIENTO; this.TotalItems = 0; FixupCollection <ItemModel> ic = new FixupCollection <ItemModel>(); foreach (MOVIMIENTO_DETALLE detalle in m.MOVIMIENTO_DETALLE) { ITEM itLec = new ITEM(); itLec.UNID_ITEM = (detalle.UNID_ITEM); itemsLectura = this._dataMaperItemsLectura.getElementLectura(itLec); ITEM_STATUS itemStatus = new ITEM_STATUS(); itemStatus.UNID_ITEM_STATUS = (long)detalle.UNID_ITEM_STATUS; ItemModel aux = new ItemModel((ITEM)itemsLectura, detalle.CANTIDAD, itemStatus); if (!String.IsNullOrEmpty(detalle.OBSERVACIONES)) { this._observaciones = detalle.OBSERVACIONES; } ic.Add(aux); this.ArticulosLectura = ic; } }
public DeleteMovimiento(MOVIMENTO m) { this._dataMapperArticulos = new MovimientoDetalleDataMapper(); this._almacenDestino = new ALMACEN(); this._almacenProcedencia = new ALMACEN(); this._unidCliente = new CLIENTE(); this._clienteDestino = new CLIENTE(); this._clienteProcedencia = new CLIENTE(); this._unidFacturaVenta = new FACTURA_VENTA(); this._unidInfraestructura = new INFRAESTRUCTURA(); this._unidProveedor = new PROVEEDOR(); this._proveedorDestino = new PROVEEDOR(); this._proveedorProcedenia = new PROVEEDOR(); this._servicio = new SERVICIO(); this._unidSolicitante = new SOLICITANTE(); this._unidTecnico = new TECNICO(); this._unidTecnicoTrans = new TECNICO(); this._tipoMovimientos = new TIPO_MOVIMIENTO(); this._transporte = new TRANSPORTE(); this._unidTecnicoTrans = new TECNICO(); if (m.UNID_ALMACEN_DESTINO != null) { this._almacenDestino.UNID_ALMACEN = (long)m.UNID_ALMACEN_DESTINO; } if (m.UNID_ALMACEN_PROCEDENCIA != null) { this._almacenProcedencia.UNID_ALMACEN = (long)m.UNID_ALMACEN_PROCEDENCIA; } if (m.UNID_CLIENTE != null) { this._unidCliente.UNID_CLIENTE = (long)m.UNID_CLIENTE; } if (m.UNID_CLIENTE_DESTINO != null) { this._clienteDestino.UNID_CLIENTE = (long)m.UNID_CLIENTE_DESTINO; } if (m.UNID_CLIENTE_PROCEDENCIA != null) { this._clienteProcedencia.UNID_CLIENTE = (long)m.UNID_CLIENTE_PROCEDENCIA; } if (m.UNID_FACTURA_VENTA != null) { this._unidFacturaVenta.UNID_FACTURA_VENTA = (long)m.UNID_FACTURA_VENTA; } if (m.UNID_INFRAESTRUCTURA != null) { this._unidInfraestructura.UNID_INFRAESTRUCTURA = (long)m.UNID_INFRAESTRUCTURA; } if (m.UNID_MOVIMIENTO != null) { this._unidMovimiento = m.UNID_MOVIMIENTO; } if (m.UNID_PROVEEDOR != null) { this._unidProveedor.UNID_PROVEEDOR = (long)m.UNID_PROVEEDOR; } if (m.UNID_PROVEEDOR_DESTINO != null) { this._proveedorDestino.UNID_PROVEEDOR = (long)m.UNID_PROVEEDOR_DESTINO; } if (m.UNID_PROVEEDOR_PROCEDENCIA != null) { this._proveedorProcedenia.UNID_PROVEEDOR = (long)m.UNID_PROVEEDOR_PROCEDENCIA; } if (m.UNID_SERVICIO != null) { this._servicio.UNID_SERVICIO = (long)m.UNID_SERVICIO; } if (m.UNID_SOLICITANTE != null) { this._unidSolicitante.UNID_SOLICITANTE = (long)m.UNID_SOLICITANTE; } if (m.UNID_TECNICO != null) { this._unidTecnico.UNID_TECNICO = (long)m.UNID_TECNICO; } if (m.UNID_TECNICO_TRAS != null) { this._unidTecnicoTrans.UNID_TECNICO = (long)m.UNID_TECNICO_TRAS; } if (m.UNID_TIPO_MOVIMIENTO != null) { this._tipoMovimientos.UNID_TIPO_MOVIMIENTO = m.UNID_TIPO_MOVIMIENTO; } if (m.UNID_TRANSPORTE != null) { this._transporte.UNID_TRANSPORTE = (long)m.UNID_TRANSPORTE; } this._contacto = m.CONTACTO; this._guia = m.GUIA; this._sitioEnlace = m.SITIO_ENLACE; this._nombreSitio = m.NOMBRE_SITIO; this._tt = m.TT; this._timeFecha = m.FECHA_MOVIMIENTO; this.TotalItems = 0; FixupCollection <ItemModel> ic = new FixupCollection <ItemModel>(); foreach (MOVIMIENTO_DETALLE detalle in m.MOVIMIENTO_DETALLE) { articulosLectura = this._dataMapperArticulos.getElementLectura(detalle); if (articulosLectura != null) { foreach (MOVIMIENTO_DETALLE item in (List <MOVIMIENTO_DETALLE>)articulosLectura) { ItemModel aux = new ItemModel(item.ITEM, detalle.CANTIDAD, item.ITEM_STATUS); ic.Add(aux); } this.ArticulosLectura = ic; } this.TotalItems += detalle.CANTIDAD; } this._fecha = m.FECHA_MOVIMIENTO.Year + "/" + m.FECHA_MOVIMIENTO.Month + "/" + m.FECHA_MOVIMIENTO.Day; //this.Fecha = m.FECHA_MOVIMIENTO.ToString(); if (m.ALMACEN != null) { this._destino = "Almacén: " + m.ALMACEN.ALMACEN_NAME; } else if (m.PROVEEDOR2 != null) { this._destino = "Proveedor: " + m.PROVEEDOR2.PROVEEDOR_NAME; } else if (m.CLIENTE2 != null) { this._destino = "Cliente: " + m.CLIENTE2.CLIENTE1; } else if (m.INFRAESTRUCTURA != null) { this._destino = "Infraestructura: " + m.INFRAESTRUCTURA.INFRAESTRUCTURA_NAME; } else { this._destino = ""; } if (m.ALMACEN1 != null) { this._procedencia = "Almacén: " + m.ALMACEN1.ALMACEN_NAME; } else if (m.PROVEEDOR != null) { this._procedencia = "Proveedor: " + m.PROVEEDOR.PROVEEDOR_NAME; } else if (m.CLIENTE != null) { this._procedencia = "Cliente: " + m.CLIENTE.CLIENTE1; } else if (m.INFRAESTRUCTURA != null) { this._procedencia = "Infraestructura: " + m.INFRAESTRUCTURA.INFRAESTRUCTURA_NAME; } else { this._procedencia = ""; } this._tipoMovimiento = m.TIPO_MOVIMIENTO.TIPO_MOVIMIENTO_NAME; }