Esempio n. 1
0
        public async Task <Result <EventOrganizerData> > FindEventOrganizerById(int eventId)
        {
            using (SqlConnection con = new SqlConnection(_connectionString))
            {
                EventOrganizerData eventi = await con.QueryFirstOrDefaultAsync <EventOrganizerData>(
                    @"select s.EventId,
                             s.CustomerId,
                             s.OrganizerId,
                             s.EventName,
                             s.Place,
                             s.MaximumPrice,
                             s.NumberOfGuestes,
                             s.Note,
                             s.WeddingDate
                      from weddingplanner.vEvent s
                      where s.EventId = @EventId;",
                    new { EventId = eventId });

                if (eventi == null)
                {
                    return(Result.Failure <EventOrganizerData>(Status.NotFound, "Event not found."));
                }
                return(Result.Success(eventi));
            }
        }
Esempio n. 2
0
        public async Task <Result <EventOrganizerData> > FindEventOrganizerById(int taskId)
        {
            using (SqlConnection con = new SqlConnection(_connectionString))
            {
                EventOrganizerData WishsData = await con.QueryFirstOrDefaultAsync <EventOrganizerData>(
                    @"select s.TaskId,
                             s.CustomerId,
                             s.Task,
                             s.StateTask
                      from weddingplanner.vWish s
                      where s.TaskId = @TaskId;",
                    new { TaskId = taskId });

                if (WishsData == null)
                {
                    return(Result.Failure <EventOrganizerData>(Status.NotFound, "wish not found."));
                }
                return(Result.Success(WishsData));
            }
        }