Beispiel #1
0
        public static async Task SaveUserChanges()
        {
            MethodInformation info = null;

            CurrentUser = ControllerRepository.Db(x => x.SaveUser(CurrentUser), (u, i) => { info = u; });
            await info?.ExecuteTrigger();
        }
Beispiel #2
0
        /// <summary>
        ///     Save VideoCategory
        /// </summary>
        /// <param name="videoCategories"></param>
        public static async Task <long> SaveCategory(VideoCategory videoCategory)
        {
            MethodInformation info = null;

            if (videoCategory.State == State.Removed)
            {
                UserData.DirectoryManager.Folder(videoCategory.Name).Delete();
            }
            var id = ControllerRepository.Db(x => x.SaveCategory(videoCategory), (i, x) => info = i).Await();

            LoadUserData(true);
            await info.ExecuteTrigger();

            return(await Task.FromResult(id));
        }
Beispiel #3
0
        public static async Task LogIn(string email, string password = null, string imageUrl = "")
        {
            if (string.IsNullOrWhiteSpace(password))
            {
                password = "******";
            }
            DirectoryManager = null;
            MethodInformation info = null;

            ControllerRepository.Db(x => x.LogIn(email, imageUrl, password), (x, data) => { CurrentUser = data; info = x; });
            if (CurrentUser != null)
            {
                Methods.AppSettings.UserLocalSettings.UserName = CurrentUser.Email;
                Methods.AppSettings.UserLocalSettings.Password = CurrentUser.Password;
                Methods.AppSettings.UserLocalSettings.Image    = CurrentUser.Picture;
                Methods.AppSettings.Logger.CurrentUserEmail    = CurrentUser.Email;
            }


            LoadUserData(true);
            await info.ExecuteTrigger();
        }