public IHttpActionResult AddCampBooking(BookingPresentationModel campBookingPresentationObject, int id)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }
                campBookingPresentationObject.CampId = id;

                // Mapping From CampPresentationModel to CampBussinessEntityModel

                BookingBussinessEntity campBussinessObject = MapperFromPresenationtoBL.Mapping <BookingPresentationModel, BookingBussinessEntity>(campBookingPresentationObject);

                string result = CampBookingServiceforBL.CampBooking(campBussinessObject);

                if (result != null)
                {
                    return(Ok(result));
                }
                else
                {
                    throw new Exception();
                }
            }
            catch (Exception e)
            {
                return(Ok(e.ToString()));
            }
        }
        public BookingPresentationModel GetBookingDetailsByReferenceID(string referenceid)
        {
            BookingBussinessEntity campBussinessObject = CampBookingServiceforBL.GetBookingDetailsByReferenceID(referenceid);


            BookingPresentationModel campofPL = MapperFromPresenationtoBL.Mapping <BookingBussinessEntity, BookingPresentationModel>(campBussinessObject);

            return(campofPL);
        }
예제 #3
0
        public BookingBussinessEntity GetBookingDetailsByReferenceID(string referenceid)
        {
            BookingDataEntity bookingDataAccessObject = GetBookingCampDataServices.GetBookingDetailsByReferenceID(referenceid);



            BookingBussinessEntity bookingBussinessObject = MapperFromBLtoDA.Mapping <BookingDataEntity, BookingBussinessEntity>(bookingDataAccessObject);

            return(bookingBussinessObject);
        }
예제 #4
0
        public string CampBooking(BookingBussinessEntity bookingBussinessObject)
        {
            Guid   obj = Guid.NewGuid();
            string var = obj.ToString();
            string str = var.Substring(0, 8);

            bookingBussinessObject.ReferenceId = str;



            BookingDataEntity bookingDAL = MapperFromBLtoDA.Mapping <BookingBussinessEntity, BookingDataEntity>(bookingBussinessObject);

            int NumberOfRowsAffected = GetBookingCampDataServices.CreateBooking(bookingDAL);

            //bool result = false;

            if (NumberOfRowsAffected == 0)
            {
                throw new Exception("Something Went Wrong");
            }
            return(bookingBussinessObject.ReferenceId);
        }