Ejemplo n.º 1
0
        public string LogIn(Login loginData)
        {
            string status = "Ok";

            var user = userRepositories.FindUserByLogin(loginData.LoginName);

            if (user == null)
            {
                return("Errore");
            }
            return(status);
        }
Ejemplo n.º 2
0
        public int CreateChat(Chat newChat, string loginCreator)
        {
            var idCreated = 0;

            if (newChat != null && loginCreator != null)
            {
                var creator = userRepositories.FindUserByLogin(loginCreator);
                newChat.CreatorID = creator.Id;
                newChat.Users     = creator.Id.ToString();

                ChatRepositiries.AddNewChat(newChat);


                var chats = ChatRepositiries.GetChats(creator.Id) as List <Chat>;
                idCreated = chats[chats.Count - 1].ID;
            }
            return(idCreated);
        }
Ejemplo n.º 3
0
        public void CreateMessage(Message newMessage, string userName)
        {
            var user = userRepositories.FindUserByLogin(userName);

            newMessage.UserName = user.FirstName;

            newMessage.PablishingData = DateTime.UtcNow;

            messageRepositories.AddMessage(newMessage);
        }
Ejemplo n.º 4
0
        public User GetUser(string login)
        {
            var user = userRepositories.FindUserByLogin(login);

            return(user);
        }