private void UsuarioDeseaGrabarLaEmpresa() { try { UiVistaPrincipal.Focus(); if (ValidarCampos()) { var empresaDeTransporte = EmpresaDeTransporte; EmpresaDeTransporte.LAST_UPDATE_BY = InteraccionConUsuarioServicio.ObtenerUsuario(); if (!ExisteEmpresaDeTransporte(empresaDeTransporte.TRANSPORT_COMPANY_CODE)) { UsuarioDeseaCrearEmpresaDeTransporte?.Invoke(null, new EmpresaDeTransporteArgumento { EmpresaDeTransporte = empresaDeTransporte }); } else { UsuarioDeseaActualizarEmpresaDeTransporte?.Invoke(null, new EmpresaDeTransporteArgumento { EmpresaDeTransporte = empresaDeTransporte }); } } } catch (Exception ex) { InteraccionConUsuarioServicio.Alerta(ex.Message); } }
private void UiBotonReporte_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { if (Cajas == null) { return; } UiVistaPrincipal.ExpandAllGroups(); var listaCajas = GetFilteredData <Caja>(UiVistaPrincipal); var reporte = new Reportes.ConsultaLineaPicking(false) { DataSource = ListToDataTableClass.ListToDataTable(listaCajas), RequestParameters = false }; reporte.Parameters["ImagenLogo"].Value = InteraccionConUsuarioServicio.ObtenerLogo(); reporte.FillDataSource(); using (var printTool = new ReportPrintTool(reporte)) { printTool.ShowRibbonPreviewDialog(); } } catch (Exception ex) { InteraccionConUsuarioServicio.MensajeErrorDialogo(ex.Message); } }
private void UiVistaPrincipal_ValidatingEditor(object sender, DevExpress.XtraEditors.Controls.BaseContainerValidateEditorEventArgs e) { GridView view = sender as GridView; if (view.FocusedColumn == colQUANTITY) { decimal cantidad = Convert.ToDecimal(e.Value); if (cantidad < 0) { e.Valid = false; e.ErrorText = "Cantidad inválida."; return; } decimal cantidadOrginal = Convert.ToDecimal(UiVistaPrincipal.GetRowCellValue(UiVistaPrincipal.FocusedRowHandle, "QUANTITY_ORIGINAL").ToString()); if (cantidadOrginal < cantidad) { e.Valid = false; e.ErrorText = "No puede sobrepasar la cantidad original de la canasta."; return; } if (cantidadOrginal != cantidad) { view.SetRowCellValue(UiVistaPrincipal.FocusedRowHandle, "MODIFIED", true); } else { view.SetRowCellValue(UiVistaPrincipal.FocusedRowHandle, "MODIFIED", false); } } }
private void UiBotonContraer_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { UiVistaPrincipal.CollapseAllGroups(); } catch (Exception ex) { InteraccionConUsuarioServicio.Alerta(ex.Message); } }
private void EstablecerEmpresaDeTrasporte() { try { if (UiVistaPrincipal.FocusedRowHandle >= 0) { EmpresaDeTransporte = (EmpresaDeTransporte)UiVistaPrincipal.GetFocusedRow(); } } catch (Exception ex) { InteraccionConUsuarioServicio.Alerta(ex.Message); } }
private void UiBotonRefrescar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { UsuarioDeseaObtenerCajas?.Invoke(e, new ConsultaArgumento { FechaInicial = (DateTime)UiFechaIncial.EditValue, FechaFinal = (DateTime)UiFechaFinal.EditValue }); UiVistaPrincipal.ExpandGroupLevel(0); } catch (Exception ex) { InteraccionConUsuarioServicio.MensajeErrorDialogo(ex.Message); } }
private void UiVistaPrincipal_ShowingEditor(object sender, CancelEventArgs e) { int implosion = Convert.ToInt32(UiVistaPrincipal.GetRowCellValue(UiVistaPrincipal.FocusedRowHandle, "WAS_IMPLODED")); if (implosion == (int)Estados.SiNo.Si) { e.Cancel = true; } string estado = UiVistaPrincipal.GetRowCellValue(UiVistaPrincipal.FocusedRowHandle, "STATUS").ToString(); if (EnumsOperations.GetEnumValueFromStringValue <Estados.EstadoCajaLineaPicking>(estado) == EstadoCajaLineaPicking.Despachado) { e.Cancel = true; } }
private void UiBotonExportarExcel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { UiDialogoParaGuardar.DefaultExt = "xlsx"; UiDialogoParaGuardar.Filter = @"Archivos de excel (*.xlsx)|*.xlsx"; UiDialogoParaGuardar.FilterIndex = 2; UiDialogoParaGuardar.RestoreDirectory = true; UiDialogoParaGuardar.Title = @"Guardar Pedidos por Vendedor"; if (UiDialogoParaGuardar.ShowDialog() == DialogResult.OK) { UiVistaPrincipal.ExportToXlsx(UiDialogoParaGuardar.FileName); } } catch (Exception ex) { InteraccionConUsuarioServicio.MensajeErrorDialogo(ex.Message); } }
private void UiBotonImprimir_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { Cursor.Current = Cursors.WaitCursor; if (PedidosPorVendedor == null) { return; } UiVistaPrincipal.ExpandAllGroups(); var pedidosPorVendedor = GetFilteredData <ReportePedidosPorVendedor>(UiVistaPrincipal); var reporte = new Reportes.ConsultaPedidosPorVendedor() { DataSource = ListToDataTableClass.ListToDataTable(pedidosPorVendedor), RequestParameters = false }; reporte.Parameters["ImagenLogo"].Value = InteraccionConUsuarioServicio.ObtenerLogo(); reporte.Parameters["Usuario"].Value = InteraccionConUsuarioServicio.ObtenerUsuario(); reporte.FillDataSource(); using (var printTool = new ReportPrintTool(reporte)) { printTool.ShowRibbonPreviewDialog(); } } catch (Exception ex) { InteraccionConUsuarioServicio.MensajeErrorDialogo(ex.Message); } finally { Cursor.Current = Cursors.Default; } }
private void UiBotonContraer_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { UiVistaPrincipal.CollapseAllGroups(); }
private void UiBotonExpandir_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { UiVistaPrincipal.ExpandAllGroups(); }