public static bool ActivaResponsable(YouCom.DTO.Servicio.ResponsableDTO theResponsableDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 50, theResponsableDTO.UsuarioModificacion); wobjSQLHelper.SetParametro("@pIdResponsable", SqlDbType.VarChar, 20, theResponsableDTO.IdResponsable); try { //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("Activa_Responsable", "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.Servicio.ResponsableDTO myResponsableDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdResponsable", SqlDbType.Decimal, -1, myResponsableDTO.IdResponsable); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myResponsableDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myResponsableDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametro("@pIdCargo", SqlDbType.Decimal, -1, myResponsableDTO.TheCargoDTO.IdCargo); wobjSQLHelper.SetParametro("@pNombreResponsable", SqlDbType.VarChar, 300, myResponsableDTO.NombreResponsable); wobjSQLHelper.SetParametro("@pApellidoPaternoResponsable", SqlDbType.VarChar, 20, myResponsableDTO.ApellidoPaternoResponsable); wobjSQLHelper.SetParametro("@pApellidoMaternoResponsable", SqlDbType.VarChar, 500, myResponsableDTO.ApellidoMaternoResponsable); wobjSQLHelper.SetParametro("@pRutResponsable", SqlDbType.VarChar, 500, myResponsableDTO.RutResponsable); wobjSQLHelper.SetParametro("@pTelefonoResponsable", SqlDbType.VarChar, 20, myResponsableDTO.TelefonoResponsable); wobjSQLHelper.SetParametro("@pCelularResponsable", SqlDbType.VarChar, 20, myResponsableDTO.CelularResponsable); wobjSQLHelper.SetParametro("@pEmailResponsable", SqlDbType.VarChar, 300, myResponsableDTO.EmailResponsable); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myResponsableDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_Responsable", "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.Servicio.ResponsableDTO> getListadoResponsable() { IList <YouCom.DTO.Servicio.ResponsableDTO> IResponsable = new List <YouCom.DTO.Servicio.ResponsableDTO>(); DataTable pobjDataTable = new DataTable(); if (YouCom.DAL.ResponsableDAL.getListadoResponsable(ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { YouCom.DTO.Servicio.ResponsableDTO responsable = new YouCom.DTO.Servicio.ResponsableDTO(); responsable.IdResponsable = decimal.Parse(wobjDataRow["idResponsable"].ToString()); responsable.RutResponsable = wobjDataRow["rutResponsable"].ToString(); responsable.NombreResponsable = wobjDataRow["nombreResponsable"].ToString(); responsable.ApellidoPaternoResponsable = wobjDataRow["apellidoPaternoResponsable"].ToString(); responsable.ApellidoMaternoResponsable = wobjDataRow["apellidoMaternoResponsable"].ToString(); responsable.TelefonoResponsable = wobjDataRow["telefonoResponsable"].ToString(); responsable.CelularResponsable = wobjDataRow["celularResponsable"].ToString(); responsable.EmailResponsable = wobjDataRow["emailResponsable"].ToString(); YouCom.DTO.Seguridad.CondominioDTO myCondominio = new YouCom.DTO.Seguridad.CondominioDTO(); myCondominio.IdCondominio = decimal.Parse(wobjDataRow["idCondominio"].ToString()); responsable.TheCondominioDTO = myCondominio; YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO(); myComunidadDTO.IdComunidad = decimal.Parse(wobjDataRow["idComunidad"].ToString()); responsable.TheComunidadDTO = myComunidadDTO; YouCom.DTO.CargoDTO myCargoDTO = new YouCom.DTO.CargoDTO(); myCargoDTO.IdCargo = decimal.Parse(wobjDataRow["idCargo"].ToString()); myCargoDTO.NombreCargo = wobjDataRow["nombreCargo"].ToString(); responsable.TheCargoDTO = myCargoDTO; responsable.UsuarioIngreso = wobjDataRow["usuario_ingreso"].ToString(); responsable.FechaIngreso = wobjDataRow["fecha_ingreso"].ToString(); responsable.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString(); responsable.FechaModificacion = wobjDataRow["fecha_modificacion"].ToString(); responsable.Estado = wobjDataRow["estado"].ToString(); IResponsable.Add(responsable); } } return(IResponsable); }
public static bool ValidaEliminacionResponsable(YouCom.DTO.Servicio.ResponsableDTO theResponsableDTO) { DataTable pobjDataTable = new DataTable(); bool retorno = false; if (YouCom.DAL.ResponsableDAL.ValidaEliminacionResponsable(theResponsableDTO, ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { retorno = true; } } return(retorno); }
public static bool Delete(YouCom.DTO.Servicio.ResponsableDTO myResponsableDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdResponsable", SqlDbType.Decimal, -1, myResponsableDTO.IdResponsable); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myResponsableDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("DEL_Responsable", "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); }