private void MethodLoadHeader() { try { CollectionESGR_UsuarioCajero.Source = new CmpObservableCollection <ESGR_Usuario>(new BSGR_Usuario().GetCollectionUsuario().Where(x => x.ESGR_Perfil.IdPerfil == 2)); CollectionESGR_Caja.Source = new BSGR_Caja().CollectionESGR_Caja(); CollectionESGR_Motivo.Source = new CmpObservableCollection <ESGR_Motivo>(new BSGR_Motivo().CollectionESGR_Motivo().Where(x => x.Modulo == "SGR_Caja")); CollectionESGR_Estado.Source = new BSGR_Estado().GetCollectionEstado("SGR_Caja"); if (ESGR_AperturaCierreCaja.Opcion == "I") { Application.Current.Dispatcher.Invoke(() => ColletionMDSGR_AperturaCajaDetalle.Clear()); SelectedESGR_Motivo = CollectionESGR_Motivo.FirstOrDefault(x => x.CodMotivo == "SLI"); CollectionESGR_Caja.Source = new CmpObservableCollection <ESGR_Caja>(CollectionESGR_Caja.Where(x => x.ESGR_Estado.CodEstado != "APTCJ" && x.FlgEliminado)); SelectedESGR_Caja = CollectionESGR_Caja.FirstOrDefault(); SelectedESGR_Estado = CollectionESGR_Estado.FirstOrDefault(x => x.CodEstado == "CRDCJ"); SelectedFecha = DateTime.Now; } else if (ESGR_AperturaCierreCaja.Opcion == "C" || ESGR_AperturaCierreCaja.Opcion == "V") { SelectedESGR_Motivo = CollectionESGR_Motivo.FirstOrDefault(x => x.CodMotivo == ((ESGR_AperturaCierreCaja.Opcion == "C") ? "SLF" : ESGR_AperturaCierreCaja.ESGR_Motivo.CodMotivo)); SelectedESGR_Caja = CollectionESGR_Caja.FirstOrDefault(x => x.IdCaja == ESGR_AperturaCierreCaja.ESGR_Caja.IdCaja); SelectedESGR_Estado = CollectionESGR_Estado.FirstOrDefault(x => x.CodEstado == ESGR_AperturaCierreCaja.ESGR_Estado.CodEstado); SelectedESGR_UsuarioCajero = CollectionESGR_UsuarioCajero.FirstOrDefault(x => x.IdUsuario == ESGR_AperturaCierreCaja.ESGR_UsuarioCajero.IdUsuario); SelectedFecha = (ESGR_AperturaCierreCaja.ESGR_Estado.CodEstado == "APTCJ") ? (ESGR_AperturaCierreCaja.FechaApertura.ToShortDateString() == DateTime.Now.ToShortDateString()) ? DateTime.Now : ESGR_AperturaCierreCaja.FechaApertura : ESGR_AperturaCierreCaja.FechaCierre; Glosa = ESGR_AperturaCierreCaja.Glosa; } MethodValuesProperty(); } catch (Exception ex) { CmpMessageBox.Show(SGRMessage.AdministracionAperturaCierreCaja, ex.Message, CmpButton.Aceptar); } }
private async void MethodLoadPedidoTipo() { await Task.Factory.StartNew(() => { try { CollectionESGR_PedidoTipo.Source = new BSGR_PedidoTipo().GetCollectionPedidoTipo(); //Thread.Sleep(1000); Application.Current.Dispatcher.Invoke(() => { if (ESGR_Pedido.Opcion == "I") { SelectedESGR_PedidoTipo = CollectionESGR_PedidoTipo.FirstOrDefault(); } else { SelectedESGR_PedidoTipo = CollectionESGR_PedidoTipo.FirstOrDefault(x => x.IdPedidoTipo == ESGR_Pedido.ESGR_PedidoTipo.IdPedidoTipo); } }); } catch (Exception ex) { CmpMessageBox.Show(SGRMessage.TitlePedido, ex.Message, CmpButton.Aceptar); } }); }
public bool MethodValidarDatos() { bool vrValidaDato = false; if (ESGR_TipoCambio.FechaTcb == new DateTime() || ESGR_TipoCambio.FechaTcb == null) { CmpMessageBox.Show(SGRMessage.AdministratorTipoCambio, "Campo Obligatorio: Fecha.", CmpButton.Aceptar); vrValidaDato = true; } else if (ESGR_TipoCambio.ESGR_Moneda.CodMoneda == string.Empty || ESGR_TipoCambio.ESGR_Moneda.CodMoneda == null) { CmpMessageBox.Show(SGRMessage.AdministratorTipoCambio, "Campo Obligatorio: Tipo Moneda.", CmpButton.Aceptar); vrValidaDato = true; } else if (ESGR_TipoCambio.BuyRate == 0 || ESGR_TipoCambio.BuyRate == null) { CmpMessageBox.Show(SGRMessage.AdministratorTipoCambio, "Campo Obligatorio: Precio Compra.", CmpButton.Aceptar); vrValidaDato = true; } else if (ESGR_TipoCambio.SelRate == 0 || ESGR_TipoCambio.SelRate == null) { CmpMessageBox.Show(SGRMessage.AdministratorTipoCambio, "Campo Obligatorio: Precio Venta.", CmpButton.Aceptar); vrValidaDato = true; } return(vrValidaDato); }
private async void MethodCleaningOrder() { await Task.Factory.StartNew(() => { try { Application.Current.Dispatcher.Invoke(() => { CollectionMSGR_PedidoDetalle.Clear(); SelectedESGR_ProductoSubCategoria = null; CollectionESGR_Producto.Clear(); ListVMSGR_PedidoDetalleDelete.Clear(); }); Total = 0; var Opcion = ESGR_Pedido.Opcion; if (Opcion == "I") { var NombreMesa = ESGR_Pedido.Identificador; var NumPersonas = ESGR_Pedido.Cubierto; ESGR_Pedido = new BSGR_Pedido().GetPedido(); ESGR_Pedido.Opcion = Opcion; ESGR_Pedido.Identificador = NombreMesa; ESGR_Pedido.Cubierto = NumPersonas; ESGR_Pedido.ESGR_PedidoTipo = SelectedESGR_PedidoTipo; } } catch (Exception ex) { CmpMessageBox.Show(SGRMessage.TitlePedido, ex.Message, CmpButton.Aceptar); } }); }
private async void MethodLoadDetails(ESGR_Pedido ESGR_Pedido) { await Task.Factory.StartNew(() => { try { var vrCollectionMSGR_PedidoDetalle = new BSGR_PedidoDetalle().GetCollectionPedidoDetalle(ESGR_Pedido); Application.Current.Dispatcher.Invoke(() => { CollectionMSGR_PedidoDetalle.Clear(); foreach (var item in vrCollectionMSGR_PedidoDetalle) { CollectionMSGR_PedidoDetalle.Add(new VMSGR_PedidoDetalle() { ESGR_Producto = item.ESGR_Producto, PrecioDolar = (ESGR_TipoCambio != null) ? (item.ESGR_Producto.Precio / (decimal)ESGR_TipoCambio.SelRate) : 0, Cantidad = item.Cantidad, CantidadAux = item.Cantidad, CantidadMesa = item.CantidadMesa, CantidadLlevar = item.CantidadLlevar, Enviado = true }); } MethodCalcularCuenta(); }); } catch (Exception ex) { CmpMessageBox.Show(SGRMessage.TitlePedido, ex.Message, CmpButton.Aceptar); } }); }
private async void MethodLoadPedido() { await Task.Factory.StartNew(() => { try { CollectionESGR_PedidoDetalle.Source = new BSGR_PedidoDetalle().GetCollectionPedidoDetalle(ESGR_Venta.ESGR_Pedido); if (CollectionESGR_PedidoDetalle.Count == 0) { PropertyFiltroPedido = string.Empty; } if (ESGR_Venta.Opcion == "I") { CollectionESGR_PedidoDetalle.ToList().ForEach(x => { x.CantidadAux = x.Cantidad; x.Importe = x.Cantidad *x.ESGR_Producto.Precio; }); } else { CollectionESGR_PedidoDetalle.ToList().ForEach(x => { x.Cantidad = 0; x.Importe = x.Cantidad *x.ESGR_Producto.Precio; }); } MethodCalcular(); } catch (Exception ex) { CmpMessageBox.Show(SGRMessage.AdministratorVenta, ex.Message, CmpButton.Aceptar); } }); }
public async void MethodLoadFormaPago() { await Task.Factory.StartNew(() => { try { CollectionESGR_FomaPago.Source = new BSGR_FormaPago().GetCollectionFormaPago(); Application.Current.Dispatcher.Invoke(() => { if (ESGR_MedioPago.Opcion != "I") { SelectedESGR_FormaPago = CollectionESGR_FomaPago.FirstOrDefault(x => x.IdFormaPago == ESGR_MedioPago.ESGR_FormaPago.IdFormaPago); } else { SelectedESGR_FormaPago = CollectionESGR_FomaPago.FirstOrDefault(); } }); } catch (Exception ex) { CmpMessageBox.Show(SGRMessage.AdministratorMedioPago, ex.Message, CmpButton.Aceptar); } }); }
public async void MethodLoadSubCategoria(ESGR_ProductoCategoria ESGR_ProductoCategoria) { await Task.Factory.StartNew(() => { try { CollectionESGR_ProductoSubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoria(ESGR_ProductoCategoria); Application.Current.Dispatcher.Invoke(() => { if (ESGR_Producto.Opcion == "I") { SelectESGR_ProductoSubCategoria = CollectionESGR_ProductoSubCategoria.FirstOrDefault(); } else { SelectESGR_ProductoSubCategoria = CollectionESGR_ProductoSubCategoria.FirstOrDefault(x => x.IdSubCategoria == ESGR_Producto.ESGR_ProductoSubCategoria.IdSubCategoria); } }); } catch (Exception ex) { CmpMessageBox.Show(SGRMessage.AdministratorProducto, ex.Message, CmpButton.Aceptar); } }); }
private void btnEnviar_Click(object sender, System.Windows.RoutedEventArgs e) { string LocationFile = string.Empty; try { Warning[] warnings; string[] streamids; string mimeType; string encoding; string extension; LocationFile = System.IO.Path.GetTempPath() + "Orden - " + DateTime.Now.ToString("dd.MM.yyyy") + ".pdf"; byte[] bytes = _reportViewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings); FileStream fs = new FileStream(LocationFile, FileMode.Create); fs.Write(bytes, 0, bytes.Length); fs.Close(); SendEmail ObjSendEmail = new SendEmail(); ObjSendEmail.SetFile = LocationFile; ObjSendEmail.Show(); } catch (Exception ex) { CmpMessageBox.Show(CMPMensajes.TitleMessage, ex.Message, CmpButton.Aceptar); } }
private void cbxCategoria_SelectionChanged(object sender, SelectionChangedEventArgs e) { ObjEMNF_ArticuloCategoria = (EMNF_ArticuloCategoria)cbxCategoria.SelectedItem; if (ObjEMNF_ArticuloCategoria == null) { dtgListaPrecio.Columns.Clear(); return; } var vrListEMNF_SubCategoria = new List <EMNF_ArticuloSubCategoria>(); string strOutMessageError = string.Empty; CmpTask.ProcessAsync(() => { vrListEMNF_SubCategoria = new BMNF_ArticuloSubCategoria().ListAdministrarSubCategoria(ObjEMNF_ArticuloCategoria); vrListEMNF_SubCategoria.Add(new EMNF_ArticuloSubCategoria() { IdSubCategoria = 0, SubCategoria = "TODOS" }); }, (ex) => { if (ex != null) { CmpMessageBox.Show(CMPMensajes.TitleAdminListadoPrecio, ex.Message, CmpButton.Aceptar); return; } else { cbxSubCategoria.ItemsSource = vrListEMNF_SubCategoria; cbxSubCategoria.SelectedItem = vrListEMNF_SubCategoria.FirstOrDefault(x => x.IdSubCategoria == 0); } }); }
private async void MethodLoadMesaArea() { await Task.Factory.StartNew(() => { try { CollectionMesaArea.Source = new BSGR_MesaArea().GetCollectionMesaArea(); Application.Current.Dispatcher.Invoke(() => { if (ESGR_Mesa.Opcion == "I") { SelectESGR_MesaArea = CollectionMesaArea.FirstOrDefault(); } else { SelectESGR_MesaArea = CollectionMesaArea.FirstOrDefault(x => x.IdMesaArea == ESGR_Mesa.EESGR_MesaArea.IdMesaArea); } }); } catch (Exception ex) { CmpMessageBox.Show(SGRMessage.AdministratorMesa, ex.Message, CmpButton.Aceptar); } }); }
private async void MethodLoadTipoCambio() { await Task.Factory.StartNew(() => { try { if (!SelectedESGR_Moneda.Defecto) { var ESGR_TipoCambio = new BSGR_TipoCambio().GetCollectionTipoCambio().FirstOrDefault(x => x.FechaTcb == ESGR_VentaCuenta.Fecha && x.ESGR_Moneda.CodMoneda == SelectedESGR_Moneda.CodMoneda); if (ESGR_TipoCambio == null) { ESGR_VentaCuenta.TipoCambio = 0; throw new Exception("No se ha registrado el tipo de cambio de la moneda extranjera para el día " + DateTime.Now.ToShortDateString()); } else { ESGR_VentaCuenta.TipoCambio = (decimal)ESGR_TipoCambio.SelRate; } } else { ESGR_VentaCuenta.TipoCambio = 1; } } catch (Exception ex) { CmpMessageBox.Show(SGRMessage.AdministratorVenta, ex.Message, CmpButton.Aceptar); } }); }
private void LoadDetail() { string strOutMessageError = string.Empty; CmpTask.Process( () => { try { ObjECMP_ReporteGastosInternos.ObjEMNF_ClienteProveedor = (ObjECMP_ReporteGastosInternos.ObjEMNF_ClienteProveedor == null) ? new EMNF_ClienteProveedor() : ObjECMP_ReporteGastosInternos.ObjEMNF_ClienteProveedor; ObjECMP_ReporteGastosInternos.ObjESGC_Moneda = (ObjECMP_ReporteGastosInternos.ObjESGC_Moneda == null) ? new ESGC_Moneda() { CodMoneda = "%" } : ObjECMP_ReporteGastosInternos.ObjESGC_Moneda; ObjECMP_ReporteGastosInternos.Opcion = (ObjECMP_ReporteGastosInternos.Opcion == null) ? string.Empty : ObjECMP_ReporteGastosInternos.Opcion; ListECMP_ReporteGastosInternos = new ObservableCollection <ECMP_ReporteGastosInternos>(new BCMP_ReporteGastosInternos().ListReporteReciboGastosInternos(ObjECMP_ReporteGastosInternos)); } catch (Exception ex) { strOutMessageError = ex.Message; } }, () => { if (strOutMessageError.Length > 0) { CmpMessageBox.Show(CMPMensajes.TitleMessage, strOutMessageError, CmpButton.Aceptar); } }); }
public bool MethodValidarDatos() { bool vrValidarDatos = false; if (ESGR_Documento.CodDocumento == string.Empty || ESGR_Documento.CodDocumento == null) { CmpMessageBox.Show(SGRMessage.AdministratorDocumento, "Campo Obligatorio: Código Documento.", CmpButton.Aceptar); vrValidarDatos = true; } else if (ESGR_Documento.Serie == string.Empty || ESGR_Documento.Serie == null) { CmpMessageBox.Show(SGRMessage.AdministratorDocumento, "Campo Obligatorio: Serie.", CmpButton.Aceptar); vrValidarDatos = true; } else if (ESGR_Documento.Descripcion == string.Empty || ESGR_Documento.Descripcion == null) { CmpMessageBox.Show(SGRMessage.AdministratorDocumento, "Campo Obligatorio: Descripción.", CmpButton.Aceptar); vrValidarDatos = true; } else if (ESGR_Documento.Longitud == 0 || ESGR_Documento.Longitud == null) { CmpMessageBox.Show(SGRMessage.AdministratorDocumento, "Campo Obligatorio: Longitud.", CmpButton.Aceptar); vrValidarDatos = true; } else if (ESGR_Documento.Correlativo.Trim().Length == 0 || ESGR_Documento.Correlativo == null) { CmpMessageBox.Show(SGRMessage.AdministratorDocumento, "Campo Obligatorio: Correlativo.", CmpButton.Aceptar); vrValidarDatos = true; } return(vrValidarDatos); }
public void btnAprobarIsClicked() { if (!btnAprobar.IsEnabled) { return; } MSGC_UpdatePrivilege.Process(this, "CMP", CMPMensajes.TitleAprobacionOrdenServicio, CMPMensajes.GetAccesoRestringidoNull("Aprobación de Orden de Servicio"), new Action <ESGC_PermisoPerfil>((P) => { try { if (dtgOrdenServicio.SelectedItems.Count == 0) { CmpMessageBox.Show(CMPMensajes.TitleAdminOrdenServicio, CMPMensajes.IsNullSelectItem, CmpButton.Aceptar); return; } var vrObjECMP_OrdenServicio = new ECMP_OrdenServicio(dtgOrdenServicio.SelectedItem, TipoConstructor.Update); if (vrObjECMP_OrdenServicio.ObjESGC_Estado.CodEstado == "PECOS") { new CmpNavigationService().Ir(new PCMP_AprobacionOrdenServicio(), _MyFrame, vrObjECMP_OrdenServicio); } else { CmpMessageBox.Show(CMPMensajes.TitleAdminOrdenCompra, "Solo se puede dar Aprobado a las Orden de Servicio Pendientes", CmpButton.Aceptar); } } catch (Exception ex) { CmpMessageBox.Show(CMPMensajes.TitleAprobacionOrdenServicio, ex.Message, CmpButton.Aceptar); } }), "PCMP_AprobacionOrdenServicio"); }
private void LoadAlmacen() { string strOutMessageError = string.Empty; CmpTask.Process( () => { try { ListEALM_Almacen = new ObservableCollection <EALM_Almacen>(new BALM_Almacen().ListFiltrarAlmacen(SelectUsuarioEmpresaSucursal.ObjESGC_EmpresaSucursal)); } catch (Exception ex) { strOutMessageError = ex.Message; } }, () => { if (strOutMessageError.Length > 0) { CmpMessageBox.Show(CMPMensajes.TitleMessage, strOutMessageError, CmpButton.Aceptar); } else { ListEALM_Almacen.Add(new EALM_Almacen() { Almacen = "TODOS", IdAlmacen = 0 }); SelectAlmacen = ListEALM_Almacen.FirstOrDefault(x => x.IdAlmacen == 0); } }); }
private async void MethodLoadCategoria() { await Task.Factory.StartNew(() => { try { PropertyMetroProgressBarCategoria = true; PropertyFlitroText = string.Empty; CollectionESGR_ProductoCategoria.Source = new BSGR_ProductoCategoria().GetCollectionProductoCategoria(); PropertyMetroProgressBarCategoria = false; if (ESGR_CartaDia.Opcion == "I") { PropertyEnableddActualizar = true; SelectFecha_CartaDia = DateTime.Now; } else { PropertyEnableddActualizar = false; SelectFecha_CartaDia = Convert.ToDateTime(ESGR_CartaDia.Fecha); } } catch (Exception ex) { CmpMessageBox.Show(SGRMessage.AdministratorCartaDia, ex.Message, CmpButton.Aceptar); } }); }
private async void MethodConsultRUC() { ESGR_Cliente.Telefono.Clear(); if (CodigoCaptcha.Trim().Length == 0) { CmpMessageBox.Show(SGRMessage.AdministratorCliente, "Campo Obligatorio: Codigo Captcha", CmpButton.Aceptar); return; } else if (ESGR_Cliente.NroDocIdentidad.Trim().Length == 0) { CmpMessageBox.Show(SGRMessage.AdministratorCliente, "Campo Obligatorio: Número de Documento", CmpButton.Aceptar); return; } else { var instResult = await CmpConsultRUC.GetInfo(ESGR_Cliente.NroDocIdentidad, CodigoCaptcha); ESGR_Cliente.Cliente = instResult.BusinessName; ESGR_Cliente.Direccion = instResult.Address; foreach (var item in instResult.ArrayPhone) { if (item != "") { ESGR_Cliente.Telefono.Add(new ESGR_Item() { ValueMemberPath = item }); } } } }
private async void MethodLoadDetalle() { await Task.Factory.StartNew(() => { try { var vrCollectionESGR_VentaCuenta = new BSGR_VentaCuenta().GetCollectionESGR_VentaCuenta(ESGR_Venta.IdVenta); Application.Current.Dispatcher.Invoke(() => { vrCollectionESGR_VentaCuenta.ToList().ForEach(x => { var vrCollectionVentaDetalle = new BSGR_VentaDetalle().GetCollectionVentaDetalle(ESGR_Venta.IdVenta); x.JsonDetalle = JsonConvert.SerializeObject(vrCollectionVentaDetalle); decimal dmlImporte = vrCollectionVentaDetalle.Where(z => z.ESGR_VentaCuenta.IdCuenta == x.IdCuenta).Sum(y => y.Precio *y.CantidadPagar); dmlImporte = (dmlImporte + x.Adicional - x.Descuento); CollectionESGR_VentaDetalle.Add(new ESGR_VentaDetalle() { ESGR_VentaCuenta = x, Importe = dmlImporte }); }); MethodCalcular(); }); } catch (Exception ex) { CmpMessageBox.Show(SGRMessage.AdministratorVenta, ex.Message, CmpButton.Aceptar); } }); }
private bool MethodValidarDatos() { var vrValidaDatos = false; string OutMessageValid = string.Empty; if (ESGR_Cliente.Cliente == null || ESGR_Cliente.Cliente.Trim().Length == 0) { CmpMessageBox.Show(SGRMessage.AdministratorCliente, "Campo Obligatorio: Cliente", CmpButton.Aceptar); vrValidaDatos = true; } else if (ESGR_Cliente.NroDocIdentidad == null || ESGR_Cliente.NroDocIdentidad.Trim().Length == 0) { CmpMessageBox.Show(SGRMessage.AdministratorCliente, "Campo Obligatorio: Numero de Documento", CmpButton.Aceptar); vrValidaDatos = true; } else if (ESGR_Cliente.FechaNacimiento == null) { CmpMessageBox.Show(SGRMessage.AdministratorCliente, "Campo Obligatorio: Fecha Nacimiento", CmpButton.Aceptar); vrValidaDatos = true; } else if (ESGR_Cliente.Correo != null) { if (!CmpMetodos.ValidateEmail(ESGR_Cliente.Correo, out OutMessageValid)) { CmpMessageBox.Show(SGRMessage.AdministratorCliente, OutMessageValid, CmpButton.Aceptar); vrValidaDatos = true; } } else if (ESGR_Cliente.Direccion == null || ESGR_Cliente.Direccion.Trim().Length == 0) { CmpMessageBox.Show(SGRMessage.AdministratorCliente, "Campo Obligatorio: Direccion", CmpButton.Aceptar); vrValidaDatos = true; } return(vrValidaDatos); }
private bool MethodValidaDatos() { if (ESGR_MovimientoCaja.ESGR_Estado != null && ESGR_MovimientoCaja.ESGR_Estado.CodEstado == "ANMOV") { CmpMessageBox.Show(SGRMessage.AdministracionMovimientoCaja, "No puede editar el Movimiento porque está anulado.", CmpButton.Aceptar); return(true); } else if (ESGR_MovimientoCaja.ESGR_Moneda == null) { CmpMessageBox.Show(SGRMessage.AdministracionMovimientoCaja, "Datos Obligatorios: Moneda", CmpButton.Aceptar); return(true); } else if (ESGR_MovimientoCaja.ESGR_Motivo == null) { CmpMessageBox.Show(SGRMessage.AdministracionMovimientoCaja, "Datos Obligatorios: Motivo", CmpButton.Aceptar); return(true); } else if (ESGR_MovimientoCaja.Fecha == null) { CmpMessageBox.Show(SGRMessage.AdministracionMovimientoCaja, "Datos Obligatorios: Fecha", CmpButton.Aceptar); return(true); } else if (ESGR_MovimientoCaja.ESGR_Documento.Correlativo == null) { CmpMessageBox.Show(SGRMessage.AdministracionMovimientoCaja, "Datos Obligatorios: Numero", CmpButton.Aceptar); return(true); } else if (ESGR_MovimientoCaja.ESGR_Documento.Serie == null) { CmpMessageBox.Show(SGRMessage.AdministracionMovimientoCaja, "Datos Obligatorios: Serie", CmpButton.Aceptar); return(true); } else if (CollectionESGR_MovimientoCajaDetalle.Count == 0) { CmpMessageBox.Show(SGRMessage.AdministracionMovimientoCaja, "Ingrese al menos un detalle.", CmpButton.Aceptar); return(true); } else if (Glosa == null || Glosa.Trim().Length == 0) { CmpMessageBox.Show(SGRMessage.AdministracionMovimientoCaja, "Ingrese una glosa valida.", CmpButton.Aceptar); return(true); } else if (CollectionESGR_MovimientoCajaDetalle.Count > 0) { string Message = string.Empty; CollectionESGR_MovimientoCajaDetalle.ToList().ForEach(x => { if (x.Monto == 0) { Message = "Datos Obligatorios: Monto"; } }); if (Message.Trim().Length != 0) { CmpMessageBox.Show(SGRMessage.AdministracionMovimientoCaja, Message, CmpButton.Aceptar); return(true); } } return(false); }
private void btnEditarIsClicked() { if (!btnEditar.IsEnabled) { return; } MSGC_UpdatePrivilege.Process(this, "CMP", CMPMensajes.TitleAdminCompra, CMPMensajes.GetAccesoRestringidoNull("Compra"), new Action <ESGC_PermisoPerfil>((P) => { try { if (P.Editar) { if (dtgCompra.SelectedItems.Count == 0) { CmpMessageBox.Show(CMPMensajes.TitleAdminCompra, CMPMensajes.IsNullSelectItem, CmpButton.Aceptar); return; } new CmpNavigationService().Ir(new PCMP_Compra(), _MyFrame, new ECMP_Compra(dtgCompra.SelectedItem, TipoConstructor.Update)); } else { CmpMessageBox.Show(CMPMensajes.TitleAdminCompra, CMPMensajes.GetAccesoRestringidoEditar("Compra"), CmpButton.Aceptar); } } catch (Exception ex) { CmpMessageBox.Show(CMPMensajes.TitleAdminCompra, ex.Message, CmpButton.Aceptar); } })); }
private bool MethodValidarDatos() { if (CollectionMSGR_PedidoDetalle == null || CollectionMSGR_PedidoDetalle.Count == 0) { CmpMessageBox.Show(SGRMessage.TitlePedido, "Ingrese un Detalle para el Pedido.", CmpButton.Aceptar); return(true); } else if (CollectionSelectESGR_Mesa == null || CollectionSelectESGR_Mesa.Count == 0) { CmpMessageBox.Show(SGRMessage.TitlePedido, "Seleccione al menos una Mesa.", CmpButton.Aceptar); return(true); } else if (ESGR_Pedido.ESGR_PedidoTipo == null || ESGR_Pedido.ESGR_PedidoTipo.IdPedidoTipo == 0) { CmpMessageBox.Show(SGRMessage.TitlePedido, "Seleccione el Tipo de Pedido.", CmpButton.Aceptar); return(true); } else if (ESGR_Pedido.Identificador == null || ESGR_Pedido.Identificador.Trim().Length == 0) { CmpMessageBox.Show(SGRMessage.TitlePedido, "Ingrese el Número de Mesa.", CmpButton.Aceptar); return(true); } //else if (ESGR_Pedido.Cubierto == 0) //{ // CmpMessageBox.Show(SGRMessage.TitlePedido, "Ingrese el Número de Cubiertos.", CmpButton.Aceptar); // return true; //} return(false); }
/// <summary> /// Carga datos Orden Compra /// </summary> /// <param name="Filtro">Datos para filtrar</param> public void LoadDetail(string Filtro = "%") { var vrListECMP_Compra = new List <ECMP_Compra>(); DateTime FechaDesde = (dtpFechaDesde.SelectedDate != null) ? dtpFechaDesde.SelectedDate.Value : DateTime.Now; DateTime FechaHasta = (dtpFechaHasta.SelectedDate != null) ? dtpFechaHasta.SelectedDate.Value : DateTime.Now; string strOutMessageError = string.Empty; CmpTask.Process( () => { try { vrListECMP_Compra = new BCMP_Compra().ListCompra(((strOpcion == string.Empty) ? "F" : strOpcion), FechaDesde, FechaHasta, "%", Filtro); } catch (Exception ex) { strOutMessageError = ex.Message; } }, () => { if (strOutMessageError.Length > 0) { CmpMessageBox.Show(CMPMensajes.TitleAdminCompra, strOutMessageError, CmpButton.Aceptar); } else { dtgCompra.ItemsSource = vrListECMP_Compra; lblCountItems.Text = vrListECMP_Compra.Count + " Registros"; } }); }
private async void MethodLoadSubCategoria(ESGR_ProductoCategoria ESGR_ProductoCategoria) { await Task.Factory.StartNew(() => { try { PropertyMetroProgressBarSubCategoria = true; CollectionESGR_ProductoSubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoriaCartaDia(ESGR_ProductoCategoria); SelectedESGR_ProductoSubCategoria = CollectionESGR_ProductoSubCategoria.FirstOrDefault(); if (SelectedESGR_ProductoSubCategoria.SubCategoria == "NINGUNA") { PropertyVisibilitySubCategoria = Visibility.Collapsed; } else { PropertyVisibilitySubCategoria = Visibility.Visible; } PropertyMetroProgressBarSubCategoria = false; } catch (Exception ex) { CmpMessageBox.Show(SGRMessage.TitlePedido, ex.Message, CmpButton.Aceptar); } }); }
private void GetData() { string strOutMessageError = string.Empty; CmpTask.Process( () => { try { if (SelectOpcionFiltro == null) { return; } ObjECMP_NotaCreditoDebito.FechaInicio = SelectFechaInicio; ObjECMP_NotaCreditoDebito.FechaHasta = SelectFechaFin; ObjECMP_NotaCreditoDebito.Filtro = (Filtro == null || Filtro == string.Empty)?"%":Filtro; ListaNotaCreditoDebito = new BCMP_NotaCreditoDebito().GETNotaCreditoDebito(SelectOpcionFiltro.Item, ObjECMP_NotaCreditoDebito); } catch (Exception ex) { strOutMessageError = ex.Message; } }, () => { if (strOutMessageError.Length > 0) { CmpMessageBox.Show(CMPMensajes.TitleAdminNotaCreditoDebito, strOutMessageError, CmpButton.Aceptar); } }); }
public async void MethodLoadMoneda() { await Task.Factory.StartNew(() => { try { CollectionESGR_Moneda.Source = new BSGR_Moneda().GetCollectionMoneda(); var FirstMoneda = CollectionESGR_Moneda.ToList().FirstOrDefault(x => x.Defecto == true); Application.Current.Dispatcher.Invoke(() => { CollectionESGR_Moneda.Remove(FirstMoneda); }); if (ESGR_TipoCambio.Opcion == "I") { SelectedESGR_Moneda = CollectionESGR_Moneda.ToList().FirstOrDefault(); } else { SelectedESGR_Moneda = CollectionESGR_Moneda.ToList().FirstOrDefault(x => x.CodMoneda == ESGR_TipoCambio.ESGR_Moneda.CodMoneda); } } catch (Exception ex) { CmpMessageBox.Show(SGRMessage.AdministratorTipoCambio, ex.Message, CmpButton.Aceptar); } }); }
public void btnNuevoIsClicked() { if (!btnNuevo.IsEnabled) { return; } MSGC_UpdatePrivilege.Process(this, "CMP", CMPMensajes.TitleAdminOrdenServicio, CMPMensajes.GetAccesoRestringidoNull("Orden Servicio"), new Action <ESGC_PermisoPerfil>((P) => { try { if (P.Nuevo) { new CmpNavigationService().Ir(new PCMP_OrdenServicio(), _MyFrame, new ECMP_OrdenServicio(null, TipoConstructor.Insert)); } else { CmpMessageBox.Show(CMPMensajes.TitleAdminOrdenServicio, CMPMensajes.GetAccesoRestringidoNuevo("Orden Servicio"), CmpButton.Aceptar); } } catch (Exception ex) { CmpMessageBox.Show(CMPMensajes.TitleAdminOrdenServicio, ex.Message, CmpButton.Aceptar); } })); }
private void LoadHeader() { string strOutMessageError = string.Empty; string strPeriodoActual = new BMNF_Periodo().GetPeriodoActual(); CmpTask.ProcessAsync( () => { ListOpciones = GetOpciones(); ListEMNF_Periodo = new ObservableCollection <EMNF_Periodo>(new BMNF_Periodo().ListPeriodo()); ListESGC_Moneda = new ObservableCollection <ESGC_Moneda>(new BSGC_Moneda().ListGetMoneda()); }, (e) => { if (e != null) { CmpMessageBox.Show(CMPMensajes.TitleMessage, strOutMessageError, CmpButton.Aceptar); return; } else { ListESGC_Moneda.Add(new ESGC_Moneda() { CodMoneda = "%", Descripcion = "TODOS" }); ListEMNF_Periodo.ToList().ForEach(x => ListPeriodoCmpPeriodo.Add(x.Periodo)); SelectPeriodo = ListEMNF_Periodo.LastOrDefault(x => x.Periodo == strPeriodoActual); SelectOpcion = ListOpciones.LastOrDefault(); SelectMoneda = ListESGC_Moneda.LastOrDefault(); SelectPeriodoCmpPeriodo = strPeriodoActual; } }); }
public bool MethoDValidaDatos() { bool vrValidaDato = false; if (ESGR_Moneda.CodMoneda == null || ESGR_Moneda.CodMoneda.Trim().Length == 0) { CmpMessageBox.Show(SGRMessage.AdministratorMoneda, "Campo Obligatorio: Código Moneda.", CmpButton.Aceptar); vrValidaDato = true; } else if (ESGR_Moneda.Descripcion == null || ESGR_Moneda.Descripcion.Trim().Length == 0) { CmpMessageBox.Show(SGRMessage.AdministratorMoneda, "Campo Obligatorio: Descripción.", CmpButton.Aceptar); vrValidaDato = true; } else if (ESGR_Moneda.Abreviacion == null || ESGR_Moneda.Abreviacion.Trim().Length == 0) { CmpMessageBox.Show(SGRMessage.AdministratorMoneda, "Campo Obligatorio: Abreviatura.", CmpButton.Aceptar); vrValidaDato = true; } else if (ESGR_Moneda.Simbolo == null || ESGR_Moneda.Simbolo.Trim().Length == 0) { CmpMessageBox.Show(SGRMessage.AdministratorMoneda, "Campo Obligatorio: Símbolo.", CmpButton.Aceptar); vrValidaDato = true; } return(vrValidaDato); }