public static bool ActivaGastoComun(YouCom.DTO.GastosComunesDTO theGastosComunesDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 50, theGastosComunesDTO.UsuarioModificacion); wobjSQLHelper.SetParametro("@pIdGasto", SqlDbType.VarChar, 20, theGastosComunesDTO.IdGastoComun); try { //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("Activa_GastoComun", "YouCom")) { case 0: throw new Exception("No se pudo grabar."); case -1: throw new Exception("Hubo un error."); case -2: throw new Exception("Hubo un error."); } //==================================================================================== retorno = true; } catch (Exception eobjException) { throw eobjException; } return(retorno); }
public static bool Update(YouCom.DTO.GastosComunesDTO myGastosComunesDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdGasto", SqlDbType.Decimal, -1, myGastosComunesDTO.IdGastoComun); wobjSQLHelper.SetParametro("@pIdCasa", SqlDbType.Decimal, -1, myGastosComunesDTO.IdCasa); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myGastosComunesDTO.IdCondominio); wobjSQLHelper.SetParametro("@pDescripcionGasto", SqlDbType.VarChar, 500, myGastosComunesDTO.DescripcionGasto); wobjSQLHelper.SetParametro("@pMontoGasto", SqlDbType.VarChar, 200, myGastosComunesDTO.MontoGasto); wobjSQLHelper.SetParametro("@pFechaGasto", SqlDbType.DateTime, -1, myGastosComunesDTO.FechaGasto); wobjSQLHelper.SetParametro("@pArchivoGasto", SqlDbType.VarChar, 200, !string.IsNullOrEmpty(myGastosComunesDTO.ArchivoGasto) ? myGastosComunesDTO.ArchivoGasto : System.Data.SqlTypes.SqlString.Null); wobjSQLHelper.SetParametro("@pEstadoGasto", SqlDbType.VarChar, 10, myGastosComunesDTO.EstadoGasto); wobjSQLHelper.SetParametro("@pFechaPagoGasto", SqlDbType.DateTime, -1, myGastosComunesDTO.FechaPagoGasto); wobjSQLHelper.SetParametro("@pComentarioGasto", SqlDbType.VarChar, 500, !string.IsNullOrEmpty(myGastosComunesDTO.ComentarioGasto) ? myGastosComunesDTO.ComentarioGasto : System.Data.SqlTypes.SqlString.Null); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myGastosComunesDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_GastoComun", "YouCom")) { case 0: throw new Exception("No se pudo grabar."); case -1: throw new Exception("Hubo un error."); case -2: throw new Exception("Hubo un error."); } //==================================================================================== retorno = true; } #region Catch catch (Exception eobjException) { throw eobjException; } #endregion return(retorno); }
public static bool ValidaEliminacionGastoComun(YouCom.DTO.GastosComunesDTO theGastosComunesDTO) { DataTable pobjDataTable = new DataTable(); bool retorno = false; if (YouCom.DAL.GastosComunesDAL.ValidaEliminacionGastoComun(theGastosComunesDTO, ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { retorno = true; } } return(retorno); }
public static bool Delete(YouCom.DTO.GastosComunesDTO myGastosComunesDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdGasto", SqlDbType.Decimal, -1, myGastosComunesDTO.IdGastoComun); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myGastosComunesDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("DEL_GastoComun", "YouCom")) { case 0: throw new Exception("No se pudo grabar."); case -1: throw new Exception("Hubo un error."); case -2: throw new Exception("Hubo un error."); } //==================================================================================== retorno = true; } #region Catch catch (Exception eobjException) { throw eobjException; } #endregion return(retorno); }
public static IList <YouCom.DTO.GastosComunesDTO> getListadoGastosComunes() { IList <YouCom.DTO.GastosComunesDTO> IGastosComunes = new List <YouCom.DTO.GastosComunesDTO>(); DataTable pobjDataTable = new DataTable(); if (YouCom.DAL.GastosComunesDAL.getListadoGastosComunes(ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { YouCom.DTO.GastosComunesDTO gastos = new YouCom.DTO.GastosComunesDTO(); gastos.IdGastoComun = decimal.Parse(wobjDataRow["idGasto"].ToString()); gastos.IdCasa = decimal.Parse(wobjDataRow["idCasa"].ToString()); gastos.IdCondominio = decimal.Parse(wobjDataRow["idCondominio"].ToString()); gastos.DescripcionGasto = wobjDataRow["descripcionGasto"].ToString(); gastos.MontoGasto = decimal.Parse(wobjDataRow["montoGasto"].ToString()); gastos.FechaGasto = Convert.ToDateTime(wobjDataRow["fechaGasto"].ToString()); gastos.ArchivoGasto = wobjDataRow["archivoGasto"].ToString(); gastos.EstadoGasto = wobjDataRow["estadoGasto"].ToString(); gastos.FechaPagoGasto = Convert.ToDateTime(wobjDataRow["fechaPagoGasto"].ToString()); gastos.ComentarioGasto = wobjDataRow["comentarioGasto"].ToString(); gastos.UsuarioIngreso = wobjDataRow["usuario_ingreso"].ToString(); gastos.FechaIngreso = wobjDataRow["fecha_ingreso"].ToString(); gastos.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString(); gastos.FechaModificacion = wobjDataRow["fecha_modificacion"].ToString(); gastos.Estado = wobjDataRow["estado"].ToString(); IGastosComunes.Add(gastos); } } return(IGastosComunes); }