Ejemplo n.º 1
0
        public BindingList <CCustom_method_solution> GetMethodsBySolution(int idelement, int idsolution, int?idreactive_medium, int?idreactive_modif, int?idgroup_solution)
        {
            List <CTemplate_method_aa> lstTemplate_method_aa =
                new CTemplate_method_aaFactory()
                .GetAll()
                .Where(c => /*c.Sol_intermedia == idsolution &&*/ c.Medium == idreactive_medium && c.Modif == idreactive_modif).ToList();

            List <CTemplate_method> lstTemplate_method =
                new CTemplate_methodFactory()
                .GetAll()
                .Where(c => c.Idelement == idelement).ToList();

            var query_group_methods = new CGroup_solution_methodsFactory().GetAll().Where(c => c.Idgroup_solution == idgroup_solution).ToList();

            BindingList <CCustom_method_solution> query = new BindingList <CCustom_method_solution>(
                (from m in lstTemplate_method
                 join n in lstTemplate_method_aa on m.Idtemplate_method equals n.Idtemplate_method
                 join p in query_group_methods on n.Idtemplate_method equals p.Idtemplate_method into ps
                 from q in ps.DefaultIfEmpty()
                 select new CCustom_method_solution
            {
                Sel = q == null ? false : true,
                Idtemplate_method = n.Idtemplate_method,
                Cod_template_method = m.Cod_template_method,
                Title = m.Title
            }
                ).ToList());

            return(query);
        }
Ejemplo n.º 2
0
        public BindingList <CCustom_method_solution> GetMethodsByMrcPattern(int idelement, short idmr_detail, int?idreactive_medium, int?idreactive_modif, int?idgroup_solution)
        {
            List <CTemplate_method_aa> lstTemplate_method_aa =
                new CTemplate_method_aaFactory()
                .GetAll()
                .Where(c => c.Mrorpattern == idmr_detail && c.Medium == idreactive_medium && c.Modif == idreactive_modif).ToList();

            List <CTemplate_method> lstTemplate_method =
                new CTemplate_methodFactory()
                .GetAll()
                .Where(c => c.Idelement == idelement).ToList();

            var query_group_methods = new CGroup_solution_methodsFactory().GetAll().Where(c => c.Idgroup_solution == idgroup_solution).ToList();

            BindingList <CCustom_method_solution> query = new BindingList <CCustom_method_solution>(
                (from m in lstTemplate_method
                 join n in lstTemplate_method_aa on m.Idtemplate_method equals n.Idtemplate_method
                 join p in query_group_methods on n.Idtemplate_method equals p.Idtemplate_method into ps
                 from q in ps.DefaultIfEmpty()
                 select new CCustom_method_solution {
                Sel = q == null ? false : Convert.ToBoolean(q.Status),
                Idtemplate_method = n.Idtemplate_method,
                Cod_template_method = m.Cod_template_method,
                Title = m.Title
            }
                ).ToList());

            return(query);
        }