Exemplo n.º 1
0
        public api.getdelays.POCO.User DeleteFollowConnection(string userid, string idConnection)
        {
            IFollowedConnection followedConnection = new DALFollowedConnection();
            IUser userDAL = new DALUser();

            api.getdelays.POCO.User u = userDAL.GetUser(Convert.ToInt32(userid));
            if (u != null)
            {
                api.getdelays.POCO.FollowedConnection f = followedConnection.GetFollowedConnection(Convert.ToInt32(idConnection));
                followedConnection.DeleteFollowedConnection(f);
                u.followedConnections = followedConnection.GetFollowedConnections(u);
                return(u);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        public api.getdelays.POCO.User FollowConnection(string arrival, string departure, string time, string userid, string repeat)
        {
            IFollowedConnection followedConnection = new DALFollowedConnection();
            IUser userDAL = new DALUser();

            api.getdelays.POCO.User u = userDAL.GetUser(Convert.ToInt32(userid));
            if (u != null)
            {
                followedConnection.AddFollowedConnection(new api.getdelays.POCO.FollowedConnection {
                    departure = departure, arrival = arrival, DateTime = Convert.ToDateTime(time), repeat = Convert.ToBoolean(repeat), user = u
                });
                u.followedConnections = followedConnection.GetFollowedConnections(u);
                return(u);
            }
            else
            {
                return(null);
            }
        }