예제 #1
0
        public async Task <bool> UpdateUser(FMPCustomFields User)
        {
            var result = await _updatecustomfields.Handle(
                UpdateCustomFieldsCommand
                .WithFilter(CustomFieldsFilter
                            .UserName(User.UserName)
                            )
                .SetExistingColumns(User)
                );

            return(result);
        }
예제 #2
0
        public static CustomFieldsFilter UserName(string userName)
        {
            var obj = new CustomFieldsFilter();

            var filter1 = obj.FilterBuilder.Where(
                f => f.UserName == userName
                );

            obj.Filters.Add(filter1);

            return(obj);
        }
예제 #3
0
        public async Task <User> GetUserById(string UserId)
        {
            var data = await _customfields.Handle(
                CustomFieldsFilter.UserName(UserId)
                );

            if (data.Count() > 0)
            {
                return(data.ToList()[0]);
            }

            return(null);
        }
예제 #4
0
        public async Task <bool> createUser(FMPCustomFields saveCustomColumnRequestData)
        {
            var Isexist = await _customFieldsExists.Handle(
                CustomFieldsFilter.UserName(saveCustomColumnRequestData.UserName)
                );

            if (Isexist)
            {
                return(false);
            }
            else
            {
                var customFieldsData = FMPCustomFields.From(
                    saveCustomColumnRequestData);
                await _createCustomFields.Handle(
                    CreateCommand <FMPCustomFields> .From(customFieldsData));
            }
            return(true);
        }