//Botones: public void CargarProductos() { string referencia = TxtDoc; if (string.IsNullOrWhiteSpace(referencia)) { _windowManager.ShowDialog(new AlertViewModel(_windowManager, "No se ha ingresado ningun Documento de Referencia")); return; } string mot = this.selectedMotivo; if (string.Compare(mot, "Orden de Compra", true) == 0) { List<ProductoxOrdenCompra> poc = new List<ProductoxOrdenCompra>(); poc = SelectedOrden.LstProducto; List<ProductoCant> lpcan = new List<ProductoCant>(); for (int i = 0; i < poc.Count; i++) { ProductoCant pcan = new ProductoCant(); pcan.IdProducto = poc.ElementAt(i).Producto.IdProducto; pcan.Can = poc.ElementAt(i).Cantidad; pcan.CodigoProd = poc.ElementAt(i).Producto.CodigoProd; pcan.Nombre = poc.ElementAt(i).Producto.Nombre; pcan.CanAtend = poc.ElementAt(i).CantAtendida.ToString(); pcan.CanAtender = poc.ElementAt(i).CantidadAtender; pcan.Ubicaciones = new List<Ubicacion>(); lpcan.Add(pcan); } LstProductos = new List<ProductoCant>(lpcan); } else { if (string.Compare(mot, "Traslado Externo", true) == 0) { if (selectedGuia == null) { _windowManager.ShowDialog(new AlertViewModel(_windowManager, "Ingrese un código de guía de remisión valido")); } else { LstProductos = selectedGuia.Nota.LstProducto; } } else { if (string.Compare(mot, "Devolucion", true) == 0) { List<DevolucionProducto> dv = new List<DevolucionProducto>(); DevolucionSQL dsql = new DevolucionSQL(); dv = dsql.BuscarProductos(-1, -1, null, SelectedDevolucion.IdDevolucion); List<ProductoCant> lpcan = new List<ProductoCant>(); for (int i = 0; i < dv.Count; i++) { ProductoCant pcan = new ProductoCant(); Producto p = new Producto(); ProductoSQL pgw = new ProductoSQL(); p = pgw.Buscar_por_CodigoProducto(dv.ElementAt(i).IdProducto); pcan.IdProducto = p.IdProducto; pcan.Nombre = p.Nombre; pcan.Can = "0"; pcan.CanAtend = "0"; pcan.CanAtender = dv.ElementAt(i).Devuelto.ToString(); pcan.Ubicaciones = new List<Ubicacion>(); pcan.CodigoProd = p.CodigoProd; lpcan.Add(pcan); } LstProductos = new List<ProductoCant>(lpcan); } else { if (string.Compare(mot, "Abastecimiento", true) == 0) { List<ProductoCant> psa = new List<ProductoCant>(); ProductoxSolicitudAbSQL pasql = new ProductoxSolicitudAbSQL(); psa = pasql.ListaProductos(SelectedSolicitud.idSolicitudAB.ToString()); List<ProductoCant> lpcan = new List<ProductoCant>(); for (int i = 0; i < psa.Count; i++) { ProductoCant pcan = new ProductoCant(); pcan.IdProducto = psa.ElementAt(i).IdProducto; pcan.Can = psa.ElementAt(i).Can; pcan.CodigoProd = psa.ElementAt(i).CodigoProd; pcan.Nombre = psa.ElementAt(i).Nombre; pcan.CanAtend = "0"; pcan.CanAtender = psa.ElementAt(i).CanAtend; pcan.Ubicaciones = new List<Ubicacion>(); lpcan.Add(pcan); } LstProductos = new List<ProductoCant>(lpcan); } } } } NotifyOfPropertyChange(() => LstProductos); if (LstProductos != null) { EstadoMot = false; Estado = false; } }
private void CambiarEstadoSolicitud(Abastecimiento SelectedSolicitud) { ProductoxSolicitudAbSQL sasql = new ProductoxSolicitudAbSQL(); selectedSolicitud.estado = 6; sasql.Atendida(selectedSolicitud); }
//Botones: public void CargarProductos() { string referencia = TxtDoc; if (string.IsNullOrWhiteSpace(referencia)) { _windowManager.ShowDialog(new AlertViewModel(_windowManager, "No se ha ingresado ningun Documento de Referencia")); return; } string mot = this.selectedMotivo; if (string.Compare(mot, "Orden de Despacho", true) == 0) { List<DetalleVenta> l = new DetalleVentaSQL().BuscarTodos(); List<ProductoCant> lpcan = new List<ProductoCant>(); for (int i = 0; i < l.Count; i++) if (l[i].IdDetalleV == SelectedDespacho.Venta.IdVenta) { Producto p = new ProductoSQL().Buscar_por_CodigoProducto(l[i].IdProducto); ProductoCant pcan = new ProductoCant(); pcan.IdProducto = p.IdProducto; pcan.CodigoProd = p.CodigoProd; pcan.Nombre = p.Nombre; pcan.CanAtender = l.ElementAt(i).Cantidad.ToString(); lpcan.Add(pcan); } LstProductos = new List<ProductoCant>(lpcan); } else { if (string.Compare(mot, "Abastecimiento", true) == 0) { List<ProductoCant> psa = new List<ProductoCant>(); ProductoxSolicitudAbSQL pasql = new ProductoxSolicitudAbSQL(); psa = pasql.ListaProductos(SelectedSolicitud.idSolicitudAB.ToString()); List<ProductoCant> lpcan = new List<ProductoCant>(); for (int i = 0; i < psa.Count; i++) { ProductoCant pcan = new ProductoCant(); pcan.IdProducto = psa.ElementAt(i).IdProducto; pcan.Can = psa.ElementAt(i).Can; pcan.CodigoProd = psa.ElementAt(i).CodigoProd; pcan.Nombre = psa.ElementAt(i).Nombre; pcan.CanAtend = "0"; pcan.CanAtender = psa.ElementAt(i).CanAtend; pcan.Ubicaciones = new List<Ubicacion>(); lpcan.Add(pcan); } LstProductos = new List<ProductoCant>(lpcan); } } NotifyOfPropertyChange(() => LstProductos); EstadoMot = false; Estado = false; }