Exemplo n.º 1
0
        public bool IsDuplicatePopulation(int familyId, int originId, string cross, int genusId)
        {
            int count = u_repo.GetFamilies(f => f.GenusId == genusId && f.Id != familyId && f.OriginId == originId && f.CrossNum == cross)
                        .Count();

            return(count > 0);
        }
 private void SetViewBagForPlant(Genotype genotype)
 {
     if (genotype != null)
     {
         IEnumerable <Family> families = m_repo.GetFamilies(f => f.Genus.Id == SessionManager.GetGenusId().Value);
         ViewBag.FamilyId = new SelectList(families, "Id", "Name", genotype.FamilyId);
         IEnumerable <SelectListItem> ploidies = m_repo
                                                 .GetPloidies()
                                                 .Select(p => new SelectListItem()
         {
             Value    = p.Id.ToString(),
             Text     = p.Name,
             Disabled = p.Retired
         });
         ViewBag.PloidyId = ploidies;
     }
 }