/// <summary>Método que registra actividades.</summary> /// <param name="objPersona">Entidad con los datos de la entidad.</param> /// <returns>.</returns> /// <remarks><list type="bullet"> /// <item><CreadoPor>Bryan Luna Vasquez</CreadoPor></item> /// <item><FecCrea>13/02/2018.</FecCrea></item></list> /// <list type="bullet"> /// <item><FecActu>XX/XX/XXXX.</FecActu></item> /// <item><Resp>Responsable.</Resp></item> /// <item><Mot>Motivo.</Mot></item></list></remarks> public static void EliminarPago(int id) { Pago objPago; int estadoPendiente; string tablaPago; objPago = PagoData.ObtenerPago(id); estadoPendiente = Convert.ToInt32(Constantes.Tablas.EstadoAprobacion.PENDIENTE); tablaPago = Constantes.Tablas.PAGO; try { if (objPago.EstadoId != estadoPendiente) { BusinessException.Generar(Constantes.Mensajes.PAGO_NOELIMINAR); } using (TransactionScope tran = new TransactionScope()) { PagoData.Eliminar(id); ArchivoData.EliminarArchivosPorRegistro(tablaPago, id.ToString()); tran.Complete(); } } catch (Exception ex) { Log.RegistrarLog(NivelLog.Error, ex); throw; } }
internal static ArchivoData GetFile(Guid fileGuid) { ArchivoData fileData = new ArchivoData(); try { if (fileGuid == Guid.Empty) { return(fileData); } DbCommand cmd = db.GetStoredProcCommand("IBVD_GetFile"); db.AddInParameter(cmd, "Id", System.Data.DbType.Guid, fileGuid); using (IDataReader reader = db.ExecuteReader(cmd)) { if (reader.Read()) { fileData = BuildFile(reader); } } } catch (Exception ex) { throw new DataAccessException("Error obtener los datos del archivo: FileMapper.GetFile", ex); } return(fileData); }
/// <summary>Método que registra actividades.</summary> /// <param name="objPersona">Entidad con los datos de la entidad.</param> /// <returns>.</returns> /// <remarks><list type="bullet"> /// <item><CreadoPor>Bryan Luna Vasquez</CreadoPor></item> /// <item><FecCrea>13/02/2018.</FecCrea></item></list> /// <list type="bullet"> /// <item><FecActu>XX/XX/XXXX.</FecActu></item> /// <item><Resp>Responsable.</Resp></item> /// <item><Mot>Motivo.</Mot></item></list></remarks> public static void RegistrarPago(PagoRequestDto request) { Pago objPago; Archivo objAdjunto1; Archivo objAdjunto2; Archivo objAdjunto3; int idPago; int idTablaPago; objPago = request.Pago; objAdjunto1 = request.Adjunto1; objAdjunto2 = request.Adjunto2; objAdjunto3 = request.Adjunto3; objPago.EstadoId = Funciones.Check.Int32(Constantes.Tablas.EstadoAprobacion.PENDIENTE); objPago.FechaHoraPago = DateTime.Now; idTablaPago = Convert.ToInt32(Constantes.Tablas.PAGO); try { if (objAdjunto1 == null && objAdjunto2 == null && objAdjunto3 == null) { BusinessException.Generar(Constantes.Mensajes.FOTO_PAGO_OBLIGATORIO); } using (TransactionScope tran = new TransactionScope()) { idPago = PagoData.Insertar(objPago); VistoData.EliminarVistos(idTablaPago); tran.Complete(); } if (objAdjunto1 != null) { objAdjunto1.Codigo = idPago.ToString(); ArchivoData.GuardarArchivo(objAdjunto1); } if (objAdjunto2 != null) { objAdjunto2.Codigo = idPago.ToString(); ArchivoData.GuardarArchivo(objAdjunto2); } if (objAdjunto3 != null) { objAdjunto3.Codigo = idPago.ToString(); ArchivoData.GuardarArchivo(objAdjunto3); } } catch (Exception ex) { Log.RegistrarLog(NivelLog.Error, ex); throw; } }
/// <summary>Método que registra actividades.</summary> /// <param name="objPersona">Entidad con los datos de la entidad.</param> /// <returns>.</returns> /// <remarks><list type="bullet"> /// <item><CreadoPor>Bryan Luna Vasquez</CreadoPor></item> /// <item><FecCrea>13/02/2018.</FecCrea></item></list> /// <list type="bullet"> /// <item><FecActu>XX/XX/XXXX.</FecActu></item> /// <item><Resp>Responsable.</Resp></item> /// <item><Mot>Motivo.</Mot></item></list></remarks> public static PagoResponseDto ObtenerEditorPago(int edificioId, int pagoId) { try { PagoResponseDto response; Pago objPago; List <GenericoListaDto> listaCuentasBancarias; List <ArchivoListaDto> listaArchivos; string tablaPago = Constantes.Tablas.PAGO; ArchivoListaDto objAdjunto1; ArchivoListaDto objAdjunto2; ArchivoListaDto objAdjunto3; objPago = PagoData.ObtenerPago(pagoId); listaCuentasBancarias = Edificio_CuentaBancariaData.ListaCuentas_Combo(edificioId); response = new PagoResponseDto { Pago = objPago, ListaCuentasBancarias = listaCuentasBancarias }; if (objPago != null) { listaArchivos = ArchivoData.ListarArchivos(tablaPago, objPago.PagoId.ToString()); if (listaArchivos.Count >= 1) { objAdjunto1 = listaArchivos[0]; response.Adjunto1 = objAdjunto1; } if (listaArchivos.Count >= 2) { objAdjunto2 = listaArchivos[1]; response.Adjunto2 = objAdjunto2; } if (listaArchivos.Count >= 3) { objAdjunto3 = listaArchivos[2]; response.Adjunto3 = objAdjunto3; } } return(response); } catch (Exception ex) { Log.RegistrarLog(NivelLog.Error, ex); throw; } }
internal static void SaveFile(ArchivoData file) { try { DbCommand cmd = db.GetStoredProcCommand("IBVD_SaveFile"); db.AddInParameter(cmd, "Id", System.Data.DbType.Guid, file.Id); db.AddInParameter(cmd, "Name", System.Data.DbType.String, file.FileName); db.AddInParameter(cmd, "ContentType", System.Data.DbType.String, file.ContentType); db.AddInParameter(cmd, "Size", System.Data.DbType.Int32, file.Size); db.AddInParameter(cmd, "FullPath", System.Data.DbType.String, file.FullPath); db.ExecuteNonQuery(cmd); } catch (Exception ex) { throw new DataAccessException("Error guardar los datos del archivo: FileMapper.SaveFile", ex); } }
/// <summary>Método que registra MaestroStopees.</summary> /// <param name="objPersona">Entidad con los datos de la entidad.</param> /// <returns>.</returns> /// <remarks><list type="bullet"> /// <item><CreadoPor>David Castañeda</CreadoPor></item> /// <item><FecCrea>13/02/2018.</FecCrea></item></list> /// <list type="bullet"> /// <item><FecActu>XX/XX/XXXX.</FecActu></item> /// <item><Resp>Responsable.</Resp></item> /// <item><Mot>Motivo.</Mot></item></list></remarks> public static void GuardarArchivo(ArchivoRequestDto request) { try { Archivo objArchivo; objArchivo = request.Archivo; using (TransactionScope tran = new TransactionScope()) { ArchivoData.GuardarArchivo(objArchivo); tran.Complete(); } } catch (Exception ex) { Log.RegistrarLog(NivelLog.Error, ex); throw; } }
/// <summary>Método que registra Movimientos.</summary> /// <param name="objPersona">Entidad con los datos de la entidad.</param> /// <returns>.</returns> /// <remarks><list type="bullet"> /// <item><CreadoPor>Bryan Luna Vasquez</CreadoPor></item> /// <item><FecCrea>13/02/2018.</FecCrea></item></list> /// <list type="bullet"> /// <item><FecActu>XX/XX/XXXX.</FecActu></item> /// <item><Resp>Responsable.</Resp></item> /// <item><Mot>Motivo.</Mot></item></list></remarks> public static ArchivoResponseDto ListadoArchivos(string tabla, int id) { try { ArchivoResponseDto response; List <ArchivoListaDto> listaArchivos; listaArchivos = ArchivoData.ListarArchivos(tabla, id.ToString()); response = new ArchivoResponseDto { ListaArchivos = listaArchivos }; return(response); } catch (Exception ex) { Log.RegistrarLog(NivelLog.Error, ex); throw; } }
/// <summary>Método que registra Movimientos.</summary> /// <param name="objPersona">Entidad con los datos de la entidad.</param> /// <returns>.</returns> /// <remarks><list type="bullet"> /// <item><CreadoPor>Bryan Luna Vasquez</CreadoPor></item> /// <item><FecCrea>13/02/2018.</FecCrea></item></list> /// <list type="bullet"> /// <item><FecActu>XX/XX/XXXX.</FecActu></item> /// <item><Resp>Responsable.</Resp></item> /// <item><Mot>Motivo.</Mot></item></list></remarks> public static ArchivoResponseDto ObtenerArchivoPorId(string id) { try { ArchivoResponseDto response; ArchivoListaDto objArchivo; objArchivo = ArchivoData.ObtenerArchivoPorId(id); response = new ArchivoResponseDto { Archivo = objArchivo }; return(response); } catch (Exception ex) { Log.RegistrarLog(NivelLog.Error, ex); throw; } }
/// <summary>Método que registra MaestroStopees.</summary> /// <param name="objPersona">Entidad con los datos de la entidad.</param> /// <returns>.</returns> /// <remarks><list type="bullet"> /// <item><CreadoPor>David Castañeda</CreadoPor></item> /// <item><FecCrea>13/02/2018.</FecCrea></item></list> /// <list type="bullet"> /// <item><FecActu>XX/XX/XXXX.</FecActu></item> /// <item><Resp>Responsable.</Resp></item> /// <item><Mot>Motivo.</Mot></item></list></remarks> public static int EliminarArchivo(string id) { try { ArchivoListaDto objArchivo; objArchivo = ArchivoData.ObtenerArchivoPorId(id); using (TransactionScope tran = new TransactionScope()) { ArchivoData.EliminarArchivo(id); tran.Complete(); } return(Convert.ToInt32(objArchivo.Codigo)); } catch (Exception ex) { Log.RegistrarLog(NivelLog.Error, ex); throw; } }
public ArchivoBussines(string cadenaConexion) { archivoData = new ArchivoData(cadenaConexion); }
public static void SaveFileData(string name, Guid guid, string contentType, int size) { ArchivoData file = new ArchivoData(guid, name, contentType, size); FilesMapper.SaveFile(file); }
public static void SaveUsuario(Usuario usuario, ArchivoData fotoPerfil) { SaveUsuario(usuario); FilesMapper.SaveFile(fotoPerfil); }