Exemple #1
0
        private void CreateUser()
        {
            if (ValidateData())
            {
                string rootDirectoryPath   = DirectoriesController.GetUserRootFolder(login);
                string ezkoAvatarImagePath = DirectoriesController.GetEzkoUserImagePath(login, avatarImagePath);

                //if creation of new user is succesful, we need co create EZKO directory
                //structure for newly created user and copy image to that location
                if (ezkoController.CreateUser(login, email, roleID, password, rootDirectoryPath, ezkoAvatarImagePath) &&
                    DirectoriesController.CreateUserFolderStructure(login) &&
                    DirectoriesController.CopyFile(avatarImagePath, ezkoAvatarImagePath))
                {
                    BasicMessagesHandler.ShowInformationMessage("Požívateľ bol úspešne vytvorený");
                }
                else
                {
                    BasicMessagesHandler.ShowErrorMessage("Pri vytváraní požívateľa sa vyskytla chyba");
                }
            }
            else
            {
                DialogResult = DialogResult.None;
            }
        }
Exemple #2
0
        private void EditUser()
        {
            if (ValidateData())
            {
                string rootDirectoryPath   = user.RootDirectoryPath;
                string ezkoAvatarImagePath = DirectoriesController.GetEzkoUserImagePath(user.Login, avatarImagePath);

                //if editing of the user is succesful, we need to copy choosen image into users EZKO root folder
                if (ezkoController.EditUser(user, email, roleID, password, ezkoAvatarImagePath) &&
                    DirectoriesController.CopyFile(avatarImagePath, ezkoAvatarImagePath))
                {
                    //BasicMessagesHandler.ShowInformationMessage("Požívateľ bol úspešne upravený");
                }
                else
                {
                    BasicMessagesHandler.ShowErrorMessage("Pri editovaní požívateľa sa vyskytla chyba");
                }
            }
            else
            {
                DialogResult = DialogResult.None;
            }
        }