Ejemplo n.º 1
0
        public List <CContact> GetLstContactsByCompany(short idcompany)
        {
            // --- get last idrecep_sample
            if (new CRecep_sampleFactory().GetAll().Exists(c => c.Idcompany == idcompany))
            {
                CRecep_sample oRecep_sample = new CRecep_sampleFactory().GetAll().Where(c => c.Idcompany == idcompany).Last();
                // --- retrieve contacts of last record company
                List <CRecep_company_person> lstRecep_company_person =
                    new CRecep_company_personFactory().GetAll().Where(c => c.Idrecep_sample == oRecep_sample.Idrecep_sample && c.Enabled_show == true).ToList();
                List <CPerson>  lstPerson = new CPersonFactory().GetAll();
                List <CContact> lst       = (
                    from r in lstRecep_company_person
                    join p in lstPerson on r.Idperson equals p.Idperson
                    select new CContact
                {
                    Idrecep_company_person = 0,
                    Idcompany = r.Idcompany,
                    Idperson = r.Idperson,
                    Allname = p.Allname,
                    Mail = p.Mail,
                    Phone = p.Phone,
                    Cellphone = p.Cellphone,
                    Person_type = r.Person_type
                }).ToList <CContact>();

                return(lst);
            }
            return(new List <CContact>());
        }
Ejemplo n.º 2
0
        public List <CExistFiles> GetLstExistFiles(short idcompany, string cod_type_sample)
        {
            List <CRecep_sample>        lstRecep_sample        = new CRecep_sampleFactory().GetAll().Where(c => c.Idcompany == idcompany && c.Cod_type_sample == cod_type_sample).ToList();
            List <CRecep_sample_attach> lstRecep_sample_attach = new CRecep_sample_attachFactory().GetAll();

            List <CExistFiles> lstExistFile = new List <CExistFiles>((from a in lstRecep_sample
                                                                      join b in lstRecep_sample_attach on a.Idrecep_sample equals b.Idrecep_sample
                                                                      select new CExistFiles
            {
                Idrecep_sample_attach = b.Idrecep_sample_attach //,
                                                                //Name_file = b.Name_file
            }).ToList <CExistFiles>());

            return(lstExistFile);
        }