Example #1
0
        public static async Task <Models.SqlServer.Enriquecimento.LayoutSaida> GetLayoutSaida(int origemAppsettingsJson, long idLayoutSaida)
        {
            Models.SqlServer.Enriquecimento.LayoutSaida layoutSaida = new Models.SqlServer.Enriquecimento.LayoutSaida();
            layoutSaida = await Data.SqlServer.Enriquecimento.LayoutSaida.GetByIdLayoutSaida(origemAppsettingsJson, idLayoutSaida);

            return(layoutSaida);
        }
Example #2
0
        public static async Task <Models.SqlServer.Enriquecimento.LayoutSaida> GetByIdLayoutSaida(int origemAppsettingsJson, long idLayoutSaida)
        {
            var parametros = new DynamicParameters();

            Models.SqlServer.Enriquecimento.LayoutSaida        layoutSaida = new Models.SqlServer.Enriquecimento.LayoutSaida();
            List <Models.SqlServer.Enriquecimento.LayoutSaida> list        = new List <Models.SqlServer.Enriquecimento.LayoutSaida>();

            parametros.Add("@IdLayoutSaida", idLayoutSaida, DbType.Int64, ParameterDirection.Input, null);
            using (SqlConnection db = new SqlConnection(Utils.AppConfiguration.GetAppConfiguration(origemAppsettingsJson).GetConnectionString(connectionString)))
            {
                var result = (await db.QueryAsync <Models.SqlServer.Enriquecimento.LayoutSaida>(
                                  "[LayoutSaidaGetByIdLayoutSaida]",
                                  parametros,
                                  commandType: CommandType.StoredProcedure));
                if (result != null)
                {
                    list = result.ToList <Models.SqlServer.Enriquecimento.LayoutSaida>();
                }
            }
            if ((list != null) && (list.Count > 0))
            {
                layoutSaida = list.First();
            }
            else
            {
                layoutSaida = new Models.SqlServer.Enriquecimento.LayoutSaida();
            }
            return(layoutSaida);
        }