public static RestaurantDataAccessLayer.Review RevLibToDataConverion(BusinessLayer.Reviews.Review p) { RestaurantDataAccessLayer.Review temp = new RestaurantDataAccessLayer.Review(); temp.Rating = p.rating; temp.RestaurantID = p.RestaurantID; temp.written = p.written; temp.rownumber = new Crud <RestaurantDataAccessLayer.Review>().ToList().Count + 1; return(temp); }
public static RestaurantDataAccessLayer.Restaurant RestLibToDataConversion(BusinessLayer.RestaurantComp.Restaurant p) { RestaurantDataAccessLayer.Restaurant r = new RestaurantDataAccessLayer.Restaurant(); r.RName = p.name; r.Cuisine = p.cuisine; r.RestAddress = p.restAddress; r.PhoneNumber = p.phoneNumber; foreach (BusinessLayer.Reviews.Review y in p.reviews) { if (y.RestaurantID == r.RestaurantID) { RestaurantDataAccessLayer.Review temp = new RestaurantDataAccessLayer.Review(); temp.Rating = y.rating; temp.RestaurantID = y.RestaurantID; temp.written = y.written; r.Reviews.Add(temp); } } return(r); }
public static BusinessLayer.Reviews.Review RevDataToLibConversion(RestaurantDataAccessLayer.Review p) { return(new BusinessLayer.Reviews.Review((double)p.Rating, p.written, p.RestaurantID)); }