Esempio n. 1
0
        public List <BookingAppointmentDetailsResponse> bookingAppointmentDetails()
        {
            BookingAppointmentResponseModel          responseModel             = new BookingAppointmentResponseModel();
            List <BookingAppointmentDetailsResponse> bookingAppointmentDetails = new List <BookingAppointmentDetailsResponse>();

            using (MySqlConnection sqlConnection = new MySqlConnection(connectstring))
            {
                using (MySqlCommand mySqlCommand = sqlConnection.CreateCommand())
                {
                    try
                    {
                        mySqlCommand.CommandText = "SELECT *FROM tbl_book_appoinment WHERE fld_confirm=1 AND fld_booked_status=1";
                        mySqlCommand.CommandType = System.Data.CommandType.Text;
                        mySqlCommand.Connection  = sqlConnection;
                        sqlConnection.Open();
                        using (MySqlDataReader reader = mySqlCommand.ExecuteReader())
                        {
                            while (reader.Read())
                            {
                                bookingAppointmentDetails.Add(new BookingAppointmentDetailsResponse
                                {
                                    booking_ID                 = reader.GetString(reader.GetOrdinal("fld_id")),
                                    customer_ID                = reader.GetString(reader.GetOrdinal("fld_customer_id")),
                                    provider_ID                = reader.GetString(reader.GetOrdinal("fld_provider_id")),
                                    booking_status             = reader.GetString(reader.GetOrdinal("fld_booked_status")),
                                    call_duration              = reader.GetString(reader.GetOrdinal("fld_call_duration")),
                                    booking_Datetime           = reader.GetString(reader.GetOrdinal("fld_datetime")),
                                    custmer_message            = reader.GetString(reader.GetOrdinal("fld_customer_message")),
                                    appointment_type           = reader.GetString(reader.GetOrdinal("fld_appointment_type")),
                                    appointment_confirm_status = reader.GetString(reader.GetOrdinal("fld_confirm")),
                                    appointment_archive        = reader.GetString(reader.GetOrdinal("fld_archive")),
                                    provider_archive           = reader.GetString(reader.GetOrdinal("fld_provider_archive")),
                                    room_in       = reader.GetString(reader.GetOrdinal("fld_room_in")),
                                    app_time_slot = reader.GetString(reader.GetOrdinal("fld_app_time_slot")),
                                    random_id     = reader.GetString(reader.GetOrdinal("fld_random_id")),
                                });
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        responseModel.Messaage = e.Message.ToString();
                    }
                }
            }
            return(bookingAppointmentDetails);
        }
        public BookingAppointmentResponseModel bookingAppointment()
        {
            BookingAppointmentResponseModel          responseModel             = new BookingAppointmentResponseModel();
            List <BookingAppointmentDetailsResponse> bookingAppointmentDetails = new List <BookingAppointmentDetailsResponse>();
            BookingRepository bookingRepository = new BookingRepository();

            responseModel.bookingAppointmentDetails = bookingRepository.bookingAppointmentDetails();
            bookingAppointmentDetails = bookingRepository.bookingAppointmentDetails();
            if (bookingAppointmentDetails.Count <= 0)
            {
                responseModel.Messaage     = "No data found";
                responseModel.responseCode = "200";
            }
            else
            {
                responseModel.Messaage     = "Appointment Details";
                responseModel.responseCode = "200";
            }
            return(responseModel);
        }