public void EditarGPS() { this.vista.MostrarGPS(); if (this.vista.UltimoTramite != null && this.vista.UltimoTramite is GPSBO) { GPSBO gps = new GPSBO(); gps.Auditoria = new Basicos.BO.AuditoriaBO(); GPSBO temp = this.vista.UltimoTramite as GPSBO; gps.Activo = temp.Activo; gps.Auditoria.FC = temp.Auditoria.FC; gps.Auditoria.FUA = temp.Auditoria.FUA; gps.Auditoria.UC = temp.Auditoria.UC; gps.Auditoria.UUA = temp.Auditoria.UUA; gps.Compania = temp.Compania; gps.FechaInstalacion = temp.FechaInstalacion; gps.Numero = temp.Numero; gps.Resultado = temp.Resultado; gps.Tipo = temp.Tipo; gps.TramiteID = temp.TramiteID; this.presentadorGPS.DatoAInterfazUsuario(gps); this.presentadorGPS.ModoEdicion(true); } else { throw new Exception("Se esparaba un objeto GPSBO"); } }
protected void RegistrarTramiteGPS(SeguridadBO seguridad) { try { string s = ""; if (String.IsNullOrEmpty(s = presentadorGPS.ValidarDatos())) { GPSBO tramiteGPS = presentadorGPS.InterfazUsuarioADato(); tramiteGPS.Tramitable = vista.Tramitable; GPSBR gpsBr = new GPSBR(); gpsBr.InsertarCompleto(dctx, tramiteGPS, seguridad); this.presentadorGPS.Inicializar(); this.presentadorGPS.LimpiarSesion(); this.RedirigirADetalle(); } else { this.MostrarMensaje("Es necesario proporcional la siguiente información " + s, ETipoMensajeIU.ADVERTENCIA); } } catch (Exception ex) { this.MostrarMensaje("Error al guardar el trámite", ETipoMensajeIU.ERROR, nombreClase + ".RegistrarTramiteGPS: " + ex.Message); } }
public void DatoAInterfazUsuario(GPSBO gps) { this.LimpiarSesion(); this.Inicializar(); this.vista.UltimoObjetoGPS = gps; this.vista.FechaInstalacion = gps.FechaInstalacion; this.vista.Numero = gps.Numero; this.vista.Compania = gps.Compania; }
private void ActualizarGPS(GPSBO anteriorBO, GPSBO gpsBO, SeguridadBO seguridad) { try { gpsBR.ActualizarCompleto(dctx, gpsBO, anteriorBO, seguridad); this.RedirigirADetalle(); } catch (Exception ex) { this.MostrarMensaje("Ocurrio un error al intentar actualizar los datos", ETipoMensajeIU.ERROR, nombreClase + ".ActualizarGPS(): " + ex.Message); } }
public GPSBO InterfazUsuarioADato() { GPSBO gps = null; string s = string.Empty; if (String.IsNullOrEmpty(s = this.ValidarDatos())) { gps = new GPSBO(); if (this.vista.UltimoObjetoGPS.TramiteID == null) { gps.Auditoria = new AuditoriaBO { FC = this.vista.FC, UC = this.vista.UC, FUA = this.vista.FUA, UUA = this.vista.UUA }; gps.Activo = true; gps.FechaInstalacion = this.vista.FechaInstalacion; gps.Numero = this.vista.Numero; gps.Compania = this.vista.Compania; gps.Tipo = ETipoTramite.GPS; gps.Resultado = gps.Numero; } else { gps.TramiteID = this.vista.UltimoObjetoGPS.TramiteID; gps.Auditoria = new AuditoriaBO { FUA = this.vista.FUA, UUA = this.vista.UUA, FC = this.vista.UltimoObjetoGPS.Auditoria.FC, UC = this.vista.UltimoObjetoGPS.Auditoria.UC }; gps.Activo = this.vista.UltimoObjetoGPS.Activo; gps.FechaInstalacion = this.vista.FechaInstalacion; gps.Numero = this.vista.Numero; gps.Compania = this.vista.Compania; gps.Tipo = this.vista.UltimoObjetoGPS.Tipo; gps.Resultado = gps.Numero; } } else { throw new Exception("Se requieren los siguientes datos : " + s); } return(gps); }
private void ActualizarDatosGPS() { if (this.vista.Tipo == ETipoTramite.GPS) { string s = String.Empty; if (String.IsNullOrEmpty(s = this.presentadorGPS.ValidarDatos())) { GPSBO gpsBO = (GPSBO)this.presentadorGPS.InterfazUsuarioADato(); GPSBO anteriorBO = (GPSBO)this.vista.UltimoTramite; gpsBO.Tramitable = this.vista.Tramitable; anteriorBO.Tramitable = this.vista.Tramitable; if (gpsBO.TramiteID == anteriorBO.TramiteID) { #region SC0008 //obtener objeto SeguridadBO SeguridadBO seguridad = ObtenerSeguridad(); if (seguridad == null) { throw new Exception(nombreClase + ".ActualizarDatosPlacaFederal():El objeto de SeguridadBO no debe se nulo"); } #endregion this.ActualizarGPS(anteriorBO, gpsBO, seguridad); } else { throw new Exception("Error al actualizar los datos del trámite el Id anterior no coincide con el Id actual"); } } else { this.MostrarMensaje("Es necesario proporcionar la siguiente información " + s, ETipoMensajeIU.ADVERTENCIA); } } else { throw new Exception("ActualizarDatosGPS():El tipo de trámite no de GPS"); } }