public static RankingServicioDTO getListadoRankingServicioByFamilia(decimal idCondominio, decimal idComunidad, decimal idFamilia) { IList <RankingServicioDTO> theRankingServicioDTO = new List <RankingServicioDTO>(); RankingServicioDTO myRankingServicioDTO = new RankingServicioDTO(); theRankingServicioDTO = listaRankingServicioActivo().Where(x => x.TheCondominioDTO.IdCondominio == idCondominio && x.TheComunidadDTO.IdComunidad == idComunidad).ToList(); if (theRankingServicioDTO.Any()) { myRankingServicioDTO = theRankingServicioDTO.Where(x => x.TheFamiliaDTO.IdFamilia == idFamilia).Single(); } return(myRankingServicioDTO); }
public static int getNotaByEmpresaServicio(decimal idCondominio, decimal idComunidad, decimal idEmpresaServicio) { int nota = 0; IList <RankingServicioDTO> theRankingServicioDTO = new List <RankingServicioDTO>(); RankingServicioDTO myRankingServicioDTO = new RankingServicioDTO(); theRankingServicioDTO = listaRankingServicioActivo().Where(x => x.TheCondominioDTO.IdCondominio == idCondominio && x.TheComunidadDTO.IdComunidad == idComunidad).ToList(); if (theRankingServicioDTO.Any()) { theRankingServicioDTO = theRankingServicioDTO.Where(x => x.TheEmpresaServicioDTO.IdEmpresaServicio == idEmpresaServicio).ToList(); } nota = theRankingServicioDTO.Sum(x => x.Nota) / theRankingServicioDTO.Count(); return(nota); }
public static bool Insert(RankingServicioDTO myRankingServicioDTO) { bool resultado = RankingServicioDAL.Insert(myRankingServicioDTO); return(resultado); }
protected void rptServicio_ItemDataBound(object sender, RepeaterItemEventArgs e) { try { if (e.Item.DataItem != null) { LinkButton myLnkBtnVer = (LinkButton)e.Item.FindControl("LnkBtnVer"); Image img = (Image)e.Item.FindControl("imgServicio"); RadioButtonList rdblNotas = new RadioButtonList(); rdblNotas = (RadioButtonList)e.Item.FindControl("rdblNotas"); Literal myLitServicioDescripcion = new Literal(); myLitServicioDescripcion = (Literal)e.Item.FindControl("LitServicioDescripcion"); LinkButton myLnkBtnVerMas = (LinkButton)e.Item.FindControl("LnkBtnVerMas"); if (!string.IsNullOrEmpty(((ServiciosDTO)e.Item.DataItem).ImagenServicio) && ((ServiciosDTO)e.Item.DataItem).ImagenServicio.Trim() != "") { img.ImageUrl = YouCom.Service.Generales.General.GetPropiedad("UploadsPathServicioPub") + ((ServiciosDTO)e.Item.DataItem).ImagenServicio; img.AlternateText = ((ServiciosDTO)e.Item.DataItem).NombreServicio; img.ToolTip = ((ServiciosDTO)e.Item.DataItem).NombreServicio; } else { img.ImageUrl = "http://placehold.it/300x200"; img.AlternateText = ((ServiciosDTO)e.Item.DataItem).NombreServicio; img.ToolTip = ((ServiciosDTO)e.Item.DataItem).NombreServicio; } RankingServicioDTO myRankingServicioDTO = new RankingServicioDTO(); IList <RankingServicioDTO> collRankingServicioDTO = new List <RankingServicioDTO>(); myRankingServicioDTO = YouCom.bll.RankingServicioBLL.getListadoRankingServicioByFamilia(myUsuario.TheCondominioSeleccionDTO.IdCondominio, myUsuario.TheComunidadSeleccionDTO.IdComunidad, myUsuario.TheFamiliaDTO.IdFamilia); collRankingServicioDTO = YouCom.bll.RankingServicioBLL.getListadoRankingServicioByCondominioByComunidad(myUsuario.TheCondominioSeleccionDTO.IdCondominio, myUsuario.TheComunidadSeleccionDTO.IdComunidad); if (myRankingServicioDTO.TheFamiliaDTO != null) { rdblNotas.SelectedIndex = rdblNotas.Items.IndexOf(rdblNotas.Items.FindByValue(myRankingServicioDTO.Nota.ToString())); } myLnkBtnVer.Text = "<span class=\"glyphicon glyphicon-comment\"></span> (" + collRankingServicioDTO.Count().ToString() + ")"; if (((YouCom.DTO.Servicio.ServiciosDTO)e.Item.DataItem).DescripcionServicio.Length < 200) { myLitServicioDescripcion.Text = ((YouCom.DTO.Servicio.ServiciosDTO)e.Item.DataItem).DescripcionServicio; myLnkBtnVerMas.Visible = false; } else { myLitServicioDescripcion.Text = YouCom.Service.Generales.General.truncaTitulo(((YouCom.DTO.Servicio.ServiciosDTO)e.Item.DataItem).DescripcionServicio, 200); myLnkBtnVerMas.Visible = true; } myLnkBtnVerMas.Visible = true; } } catch (Exception ex) { } }