public static bool ActivaCasa(YouCom.DTO.CasaDTO theCasaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 50, theCasaDTO.UsuarioModificacion); wobjSQLHelper.SetParametro("@pIdCasa", SqlDbType.VarChar, 20, theCasaDTO.IdCasa); try { //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("Activa_Casa", "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 IList <YouCom.DTO.CasaDTO> getListadoCasa() { IList <YouCom.DTO.CasaDTO> ICasa = new List <YouCom.DTO.CasaDTO>(); DataTable pobjDataTable = new DataTable(); if (YouCom.DAL.CasaDAL.getListadoCasas(ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { YouCom.DTO.CasaDTO casa = new YouCom.DTO.CasaDTO(); casa.IdCasa = decimal.Parse(wobjDataRow["IdCasa"].ToString()); casa.IdCondominio = decimal.Parse(wobjDataRow["idCondominio"].ToString()); casa.NombreCasa = wobjDataRow["nombreCasa"].ToString(); casa.DireccionCasa = wobjDataRow["direccionCasa"].ToString(); casa.TelefonoCasa = wobjDataRow["telefonoCasa"].ToString(); casa.UsuarioIngreso = wobjDataRow["usuario_ingreso"].ToString(); casa.FechaIngreso = wobjDataRow["fecha_ingreso"].ToString(); casa.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString(); casa.FechaModificacion = wobjDataRow["fecha_modificacion"].ToString(); casa.Estado = wobjDataRow["estado"].ToString(); ICasa.Add(casa); } } return(ICasa); }
public static bool ValidaEliminacionCasa(YouCom.DTO.CasaDTO theCasaDTO) { DataTable pobjDataTable = new DataTable(); List <YouCom.DTO.CasaDTO> collCasa = new List <YouCom.DTO.CasaDTO>(); bool retorno = false; if (YouCom.DAL.CasaDAL.ValidaEliminacionCasa(theCasaDTO, ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { retorno = true; } } return(retorno); }
public static bool Insert(YouCom.DTO.CasaDTO myCasaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myCasaDTO.IdCondominio); wobjSQLHelper.SetParametro("@pNombreCasa", SqlDbType.VarChar, 200, myCasaDTO.NombreCasa); wobjSQLHelper.SetParametro("@pDireccionCasa", SqlDbType.VarChar, 200, myCasaDTO.DireccionCasa); wobjSQLHelper.SetParametro("@pTelefonoCasa", SqlDbType.VarChar, 20, myCasaDTO.TelefonoCasa); wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myCasaDTO.UsuarioIngreso); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("INS_CASA", "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 Delete(YouCom.DTO.CasaDTO myCasaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdCasa", SqlDbType.Decimal, -1, myCasaDTO.IdCasa); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myCasaDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("DEL_CASA", "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); }