public String AddBooking()
        {
            String idParam = Request.Params["pcid"];
            String useridParam = Request.Params["userid"];
            String date = Request.Params["date"];
            String time = Request.Params["time"];
            String duration = Request.Params["duration"];
            int pcid = int.Parse(idParam);
            int userid = int.Parse(useridParam);
               DateTime newDate = DateTime.ParseExact(date + " " + time, "dd/MM/yyyy HH:mm", null);
            int intDuration = int.Parse(duration);

            OrderService orderService = new OrderService();
            OrderStatus orderStatus = orderService.isCanOrder(pcid, newDate, intDuration, userid);
            if (orderStatus.status == OrderStatusCode.FAIL)
            {
                return orderStatus.message;
            }
            Order order = new Order();
            order.PCID = pcid;
            order.UserID = userid;
            order.StartTime = newDate;
            order.Duration = intDuration;
            order.OrderStatus = 0;
            // tru balance
            IRepository<Order> repository = new OrderRepository();
            repository.Add(order);
            return "true";
        }
        public String AddBookingForMobile(String idParam, String username, String password,
            String date, String time, String duration)
        {
            UserService userService = new UserService();
            int userid = userService.findAnUserByName(username).UserID;
            int pcid = int.Parse(idParam);
            DateTime newDate = DateTime.ParseExact(date + " " + time, "dd/MM/yyyy HH:mm", null);
            int intDuration = int.Parse(duration);

            OrderService orderService = new OrderService();
            OrderStatus orderStatus = orderService.isCanOrder(pcid, newDate, intDuration, userid);
            if (orderStatus.status == OrderStatusCode.FAIL)
            {
                return orderStatus.message;
            }
            Order order = new Order();
            order.PCID = pcid;
            order.UserID = userid;
            order.StartTime = newDate;
            order.Duration = intDuration;
            order.OrderStatus = 0;
            // tru balance
            IRepository<Order> repository = new OrderRepository();
            repository.Add(order);
            return "true";
        }
        public String getNearestNet()
        {
            double sLatitude = Double.Parse(Request.Params["latitude"]);
            double sLongitude = Double.Parse(Request.Params["longtitude"]);
            var sCoord = new GeoCoordinate(sLatitude, sLongitude);

            OrderService services = new OrderService();
            List<NetCafe> netcafes = services.getAllNetCafe();
            var firstCoord = new GeoCoordinate(netcafes[0].LocationX.Value, netcafes[0].LocationY.Value);
            string nearestNetName = netcafes[0].NetCafeName;
            double nearestDistance = sCoord.GetDistanceTo(firstCoord);

            foreach(NetCafe netCafe in netcafes)
            {
                var eCoord = new GeoCoordinate(netCafe.LocationX.Value, netCafe.LocationY.Value);
                if (eCoord != null)
                {
                    double currentDistance = sCoord.GetDistanceTo(eCoord);
                    if (nearestDistance > currentDistance)
                    {
                        nearestDistance = currentDistance;
                        nearestNetName = netCafe.NetCafeName;
                    }
                }
                else
                {
                    return nearestNetName;
                }

            }

            return nearestNetName;
        }