public int Actualizar(DeclaranteIdentificacionesBE e_DeclaranteIdentificaciones) { using (SqlConnection connection = Conectar(m_BaseDatos)) { try { ComandoSP("usp_DeclaranteIdentificacionesActualizar", connection); ParametroSP("@DeclaranteIdentificacionId", e_DeclaranteIdentificaciones.DeclaranteIdentificacionId); ParametroSP("@DocumentoIdentidadTipoId", e_DeclaranteIdentificaciones.DocumentoIdentidadTipoId); ParametroSP("@DeclaranteNumeroDocumento", e_DeclaranteIdentificaciones.DeclaranteNumeroDocumento); ParametroSP("@EstadoId", e_DeclaranteIdentificaciones.EstadoId); ParametroSP("@DatosPersonalesId", e_DeclaranteIdentificaciones.DatosPersonalesId); ParametroSP("@UsuarioModificacionRegistro", e_DeclaranteIdentificaciones.UsuarioModificacionRegistro); ParametroSP("@NroIpRegistro", e_DeclaranteIdentificaciones.NroIpRegistro); return(comando.ExecuteNonQuery()); } catch (SqlException ex) { throw new Exception("Clase DataAccess " + Nombre_Clase + "\r\n" + "Descripción: " + ex.Message); } finally { connection.Dispose(); } } }
public void ConvertToIdentificacionesBE(string[][] array) { for (int i = 0; i < array.Length; i++) { DeclaranteIdentificacionesBE BE = new DeclaranteIdentificacionesBE(); string[] register = array[i]; BE.DocumentoIdentidadTipoId = Int32.Parse(register[0]); BE.DeclaranteNumeroDocumento = register[1]; LstMaestraIdentificaciones.Add(BE); } }
public bool Anular(DeclaranteIdentificacionesBE e_DeclaranteIdentificaciones) { try { DeclaranteIdentificacionesDA o_DeclaranteIdentificaciones = new DeclaranteIdentificacionesDA(m_BaseDatos); int resp = o_DeclaranteIdentificaciones.Anular(e_DeclaranteIdentificaciones); return(resp > 0); } catch (Exception ex) { throw new Exception("Clase Business: " + Nombre_Clase + "\r\n" + "Descripción: " + ex.Message); } }
public bool Insertar(string login) { bool v = false; DatosPersonales1003BE BE = new DatosPersonales1003BE(); this.UsuarioRegistro = login; this.DatosPersonalesId = new DatosPersonales1003BL().GetMaxId() + 1; this.EstadoId = 1; BE = ViewModelToBE(this); if (new DatosPersonales1003BL().Insertar(BE) == false) { this.ErrorSMS = "Error al Insertar Datos Personales"; return(false); } DeclaranteIdentificacionesBE m_BE = new DeclaranteIdentificacionesBE(); foreach (AgregarDocumentoViewModel vm in LstAgregarDocumentoVM) { m_BE.DatosPersonalesId = BE.DatosPersonalesId; m_BE.UsuarioRegistro = login;; m_BE.EstadoId = 1; m_BE.NroIpRegistro = HttpContext.Current.Request.UserHostAddress; m_BE.DocumentoIdentidadTipoId = Int32.Parse(vm.DocumentoIdentidadTipoId); m_BE.DeclaranteNumeroDocumento = vm.NroDocumentoIdentidad; if (new DeclaranteIdentificacionesBL().Insertar(m_BE) == false) { this.ErrorSMS = "Error al Insertar Datos Personales : " + m_BE.DeclaranteNumeroDocumento; return(false); } } FotosViewModel f_vm = new FotosViewModel(); foreach (FotosViewModel vm in LstFotos) { if (vm.GrabarFotos(this.DatosPersonalesId, this.Paterno, this.Materno, login) == false) { this.ErrorSMS = "Error al Insertar Datos Personales : " + m_BE.DeclaranteNumeroDocumento; return(false); } return(true); } return(true); }