public static IEnumerable <LigneSqlView> GetLigneRubrique(Societe societe, CategorieCnss categorie, DateTime dateMin, DateTime dateMax, string etablissementNo) { var dateMinBrut1 = dateMin; var dateMaxBrut1 = dateMin.AddMonths(1).AddDays(-1); var dateMinBrut2 = dateMin.AddMonths(1); var dateMaxBrut2 = dateMinBrut2.AddMonths(1).AddDays(-1); var dateMinBrut3 = dateMinBrut2.AddMonths(1); var dateMaxBrut3 = dateMinBrut3.AddMonths(1).AddDays(-1); var query = societe.CnssTypeMatricule == TypeMatriculCnss.Matricule ? EnteteSelectMatricule : EnteteSelectBadge; query = string.Format("{0} {1}", query, string.IsNullOrWhiteSpace(etablissementNo)? QueryGetByRubriqueEtabNull: QueryGetByRubrique); using (var con = new SqlConnection(societe.GetConnection())) { var result = con.Query <LigneSqlView>(query, new { categorie.CodePaie, dateMin, dateMax, etablissementNo, dateMinBrut1, dateMaxBrut1, dateMinBrut2, dateMaxBrut2, dateMinBrut3, dateMaxBrut3 }); return(result); } }
public static IEnumerable <EtabSqlView> GetEtb(Societe societe) { var query = @"select T_ETA.CodeEtab 'Id',T_ETA.Intitule 'Intitule'FROM T_ETA"; using (var con = new SqlConnection(societe.GetConnection())) { var result = con.Query <EtabSqlView>(query); return(result); } }