public static bool ActivaTipoVisita(YouCom.DTO.AccesoHogar.TipoVisitaDTO theTipoVisitaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 50, theTipoVisitaDTO.UsuarioModificacion); wobjSQLHelper.SetParametro("@pIdTipoVisita", SqlDbType.VarChar, 20, theTipoVisitaDTO.IdTipoVisita); try { //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("Activa_TipoVisita", "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 ValidaEliminacionTipoVisita(YouCom.DTO.AccesoHogar.TipoVisitaDTO theTipoVisitaDTO) { DataTable pobjDataTable = new DataTable(); bool retorno = false; if (YouCom.DAL.AccesoHogar.TipoVisitaDAL.ValidaEliminacionTipoVisita(theTipoVisitaDTO, ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { retorno = true; } } return(retorno); }
public static bool Update(YouCom.DTO.AccesoHogar.TipoVisitaDTO myTipoVisitaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdTipoVisita", SqlDbType.Decimal, -1, myTipoVisitaDTO.IdTipoVisita); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myTipoVisitaDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myTipoVisitaDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametro("@pNombreTipoVisita", SqlDbType.VarChar, 200, myTipoVisitaDTO.NombreTipoVisita); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myTipoVisitaDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_TipoVisita", "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.AccesoHogar.TipoVisitaDTO> getListadoTipoVisita() { IList <YouCom.DTO.AccesoHogar.TipoVisitaDTO> ITipoVisita = new List <YouCom.DTO.AccesoHogar.TipoVisitaDTO>(); DataTable pobjDataTable = new DataTable(); if (YouCom.DAL.AccesoHogar.TipoVisitaDAL.getListadoTipoVisita(ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { YouCom.DTO.AccesoHogar.TipoVisitaDTO tipo_Visita = new YouCom.DTO.AccesoHogar.TipoVisitaDTO(); tipo_Visita.IdTipoVisita = decimal.Parse(wobjDataRow["IdTipoVisita"].ToString()); YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO(); myCondominioDTO.IdCondominio = decimal.Parse(wobjDataRow["idCondominio"].ToString()); tipo_Visita.TheCondominioDTO = myCondominioDTO; YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO(); myComunidadDTO.IdComunidad = decimal.Parse(wobjDataRow["idComunidad"].ToString()); tipo_Visita.TheComunidadDTO = myComunidadDTO; tipo_Visita.NombreTipoVisita = wobjDataRow["nombreTipoVisita"].ToString(); tipo_Visita.UsuarioIngreso = wobjDataRow["usuario_ingreso"].ToString(); tipo_Visita.FechaIngreso = wobjDataRow["fecha_ingreso"].ToString(); tipo_Visita.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString(); tipo_Visita.FechaModificacion = wobjDataRow["fecha_modificacion"].ToString(); tipo_Visita.Estado = wobjDataRow["estado"].ToString(); ITipoVisita.Add(tipo_Visita); } } return(ITipoVisita); }
public static IList <YouCom.DTO.AccesoHogar.AccesoHogarDTO> getListadoAccesoHogar() { IList <YouCom.DTO.AccesoHogar.AccesoHogarDTO> IAccesoHogar = new List <YouCom.DTO.AccesoHogar.AccesoHogarDTO>(); DataTable pobjDataTable = new DataTable(); if (YouCom.DAL.AccesoHogar.AccesoHogarDAL.getListadoAccesoHogar(ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { YouCom.DTO.AccesoHogar.AccesoHogarDTO accesoHogar = new YouCom.DTO.AccesoHogar.AccesoHogarDTO(); accesoHogar.IdAccesoHogar = decimal.Parse(wobjDataRow["IdAccesoHogar"].ToString()); DTO.Propietario.CasaDTO myCasa = new DTO.Propietario.CasaDTO(); myCasa.IdCasa = decimal.Parse(wobjDataRow["idCasa"].ToString()); accesoHogar.TheCasaDTO = myCasa; YouCom.DTO.AccesoHogar.TipoVisitaDTO myTipoVisita = new YouCom.DTO.AccesoHogar.TipoVisitaDTO(); myTipoVisita.IdTipoVisita = decimal.Parse(wobjDataRow["idTipoVisita"].ToString()); myTipoVisita.NombreTipoVisita = wobjDataRow["nombreTipoVisita"].ToString(); accesoHogar.TheTipoVisitaDTO = myTipoVisita; YouCom.DTO.AccesoHogar.FrecuenciaDTO myFrecuencia = new YouCom.DTO.AccesoHogar.FrecuenciaDTO(); myFrecuencia.IdFrecuencia = decimal.Parse(wobjDataRow["idFrecuencia"].ToString()); myFrecuencia.NombreFrecuencia = wobjDataRow["nombreFrecuencia"].ToString(); accesoHogar.TheFrecuenciaDTO = myFrecuencia; DTO.Propietario.FamiliaDTO myFamilia = new DTO.Propietario.FamiliaDTO(); myFamilia.IdFamilia = decimal.Parse(wobjDataRow["idFamilia"].ToString()); myFamilia.RutFamilia = wobjDataRow["rutFamilia"].ToString(); myFamilia.NombreFamilia = wobjDataRow["nombreFamilia"].ToString(); myFamilia.ApellidoPaternoFamilia = wobjDataRow["apellidoPaternoFamilia"].ToString(); myFamilia.ApellidoMaternoFamilia = wobjDataRow["apellidoMaternoFamilia"].ToString(); accesoHogar.TheFamiliaDTO = myFamilia; YouCom.DTO.Seguridad.CondominioDTO myCondominio = new YouCom.DTO.Seguridad.CondominioDTO(); myCondominio.IdCondominio = decimal.Parse(wobjDataRow["idCondominio"].ToString()); accesoHogar.TheCondominioDTO = myCondominio; YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO(); myComunidadDTO.IdComunidad = decimal.Parse(wobjDataRow["idComunidad"].ToString()); accesoHogar.TheComunidadDTO = myComunidadDTO; accesoHogar.FechaInicio = DateTime.Parse(wobjDataRow["FechaInicio"].ToString()); accesoHogar.FechaTermino = DateTime.Parse(wobjDataRow["fechaTermino"].ToString()); accesoHogar.HoraInicio = wobjDataRow["HoraInicio"].ToString(); accesoHogar.HoraTermino = wobjDataRow["HoraTermino"].ToString(); accesoHogar.NombreVisita = wobjDataRow["nombreVisita"].ToString(); accesoHogar.ApellidoPaternoVisita = wobjDataRow["apellidoPaternoVisita"].ToString(); accesoHogar.ApellidoMaternoVisita = wobjDataRow["apellidoMaternoVisita"].ToString(); accesoHogar.RutVisita = wobjDataRow["rutVisita"].ToString(); accesoHogar.EmailVisita = wobjDataRow["emailVisita"].ToString(); accesoHogar.Avisar = wobjDataRow["avisar"].ToString(); accesoHogar.UsuarioIngreso = wobjDataRow["usuario_ingreso"].ToString(); accesoHogar.FechaIngreso = wobjDataRow["fecha_ingreso"].ToString(); accesoHogar.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString(); accesoHogar.FechaModificacion = wobjDataRow["fecha_modificacion"].ToString(); accesoHogar.Estado = wobjDataRow["estado"].ToString(); IAccesoHogar.Add(accesoHogar); } } return(IAccesoHogar); }