Exemple #1
0
        private static async Task <Attachment> GetDetailedRoasterCard(Activity activity, TeamsChannelAccount userDetails)
        {
            var  details = JsonConvert.DeserializeObject <AirlineActionDetails>(activity.Value.ToString());
            Crew crew    = await CabinCrewPlansHelper.ReadJson(userDetails.UserPrincipalName);

            var datePlan = crew.plan.FirstOrDefault(c => c.flightDetails.flightStartDate.Date.ToString() == details.Id);

            return(CardHelper.GetDetailedRoster(datePlan));
        }
        private static async Task <Attachment> GetDetailedRoasterCard(Activity activity, TeamsChannelAccount userDetails, GraphHelper graphHelper, IConfiguration configuration)
        {
            var details = JsonConvert.DeserializeObject <AirlineActionDetails>(activity.Value.ToString());
            // Crew crew = await CabinCrewPlansHelper.ReadJson(userDetails.UserPrincipalName);

            string crewid = await graphHelper.GetUserEmployeeIdAsync(userDetails.UserPrincipalName);

            Crew crew = await CabinCrewPlansHelper.ReadJson(crewid, configuration);

            // Crew crew = await CabinCrewPlansHelper.ReadJson("10055"); // ${Debugging}
            var datePlan = crew.plan.FirstOrDefault(c => c.flightDetails.flightStartDate.Date.ToString() == details.Id);

            return(CardHelper.GetDetailedRoster(datePlan));
        }