Example #1
0
        public async static Task <LG.Data.Models.Users.UserModel> UpdateClientUser(LG.Data.Models.Users.UserModel entity)
        {
            var   result = LG.Data.Core.Users.UsersDataService.UpdateAsync(entity);
            await result;

            if (result.IsCompleted)
            {
                return(result.Result);
            }
            return(null);
        }
Example #2
0
        public async static Task <LG.Data.Models.Users.UserListModel> AddClientUser(LG.Data.Models.Users.UserModel entity)
        {
            var result
                = LG.Data.Core.Users.UsersDataService.CreateAsync(entity);

            await result;

            if (result.IsCompleted)
            {
                var result2 = LG.Data.Core.Users.UsersDataService.UpdateAsync(
                    entity, result.Result.UserRID, LG.Data.Models.Enums.Action.Add);

                await result2;

                entity.UserRID = result.Result.UserRID;
                LG.Data.Core.Users.UsersDataService.AddUser(entity);
                return(await LG.Data.Core.Users.UsersDataService.GetListAsync(entity));
            }
            return(await LG.Data.Core.Users.UsersDataService.GetListAsync(entity));
        }
Example #3
0
        public async static Task <LG.Data.Models.Users.UserListModel> AddCorporationUser(LG.Data.Models.Users.UserModel entity)
        {
            var result
                = LG.Data.Core.Users.UsersDataService.CreateAsync(entity);

            await result;

            if (result.IsCompleted)
            {
                var result2 = LG.Data.Core.Users.UsersDataService.UpdateAsync(
                    entity, result.Result.UserRID,
                    LG.Data.Models.Enums.Action.Add);

                await result2;

                entity.UserRID = result.Result.UserRID;

                if (result2.IsCompleted)
                {
                    return(await LG.Data.Core.Users.UsersDataService.AddUserToCorporation(
                               entity));
                }
                if (result2.IsFaulted)
                {
                    return(await LG.Data.Core.Users.UsersDataService.GetCorporationListAsync());
                }
            }
            if (result.IsFaulted)
            {
                return(null);
            }
            return(null);
        }
Example #4
0
 public static async Task <UserListModel> LinkToCorporation(LG.Data.Models.Users.UserModel user)
 {
     return(await LG.Data.Core.Users.UsersDataService.AddUserToCorporation(user));
 }
Example #5
0
 public async static Task <LG.Data.Models.Users.UserModel> GetUser(LG.Data.Models.Users.UserModel entity)
 {
     return(await LG.Data.Core.Users.UsersDataService.Get(entity));
 }
Example #6
0
 public static async Task <LG.Data.Models.Users.UserModel> CreateAndSavePrimaryAsync(
     LG.Data.Models.Users.UserModel entity)
 {
     return(await LG.Data.Core.Users.UsersDataService.CreateAndSavePrimaryAsync(entity));
 }
Example #7
0
 public static UserModel AddToClient(LG.Data.Models.Users.UserModel entity)
 {
     return(LG.Data.Core.Users.UsersDataService.AddUser(entity));
 }
Example #8
0
 public async static Task <LG.Data.Models.Users.UserListModel> GetClientUsers(LG.Data.Models.Users.UserModel entity)
 {
     return(await LG.Data.Core.Users.UsersDataService.GetListAsync(entity));
 }
Example #9
0
        public async static Task <LG.Data.Models.Users.UserListModel> RemoveClientUser(LG.Data.Models.Users.UserModel entity)
        {
            var result = LG.Data.Core.Users.UsersDataService.RemoveAsync(entity);

            if (!result.IsError)
            {
                return(await GetClientUsers(entity));
            }
            return(null);
        }
Example #10
0
        public async static Task <LG.Data.Models.Users.UserListModel> UpdateCorporateUserAsync(LG.Data.Models.Users.UserModel entity)
        {
            var   result = LG.Data.Core.Users.UsersDataService.UpdateCorporateUserAsync(entity);
            await result;

            if (result.IsCompleted)
            {
                return(await LG.Data.Core.Users.UsersDataService.GetCorporationListAsync());
            }
            else if (result.IsFaulted)
            {
                return(await LG.Data.Core.Users.UsersDataService.GetCorporationListAsync());
            }
            return(null);
        }
Example #11
0
 public static async Task <BaseModel> SaveEmail(LG.Data.Models.Users.UserModel entity)
 {
     return(await LG.Data.Core.Shared.SaveContactInformation.SaveEmailTask(entity));
 }