Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "sbenfares"

Thanks

Is it possible to have an example of file uploading in a form using Application Service Layer ?

I have a form with an input type=file, and in my jquery file :

` // My Application Service var candidatService = abp.services.app.candidat;

// Form submission $formInscription.submit(function (e) { e.preventDefault();

        if (!$formInscription.valid()) {
            return;
        }

        var formData = $formInscription.serializeFormToObject();

        // Call Service
        candidatService.register(formData)
            .done(function () {
                window.location.href = "/confirmation-inscription-candidat";
            });
    });

`

How can i retrieve my file in the candidatService ?

What should my inputDto be ?

I can't access the Request for getting the file...

Thanks :)

Hi,

I would like to register users with a form displaying a SetBusy indicator when the form is submitted.

In ANZ default project the register method is done in the controller, and there is no way to use Ajax for registering and display an setBusy animation.

What is the best practice to add a setBusy indicator for registration in Asp.net core + Jquery ?

Thanks

Thanks, i removed bootstrap-rtl and corrected jquery ui

Hi,

When i do a "npm run create-bundles" for installing my project on a new pc i have this error :

Error: File not found with singular glob: D:/Src/A2JOB/A2JOB.Platform/src/A2JOB.Platform.Web.Mvc/node_modules/bootstrap-rtl/bootstrap-rtl.css

When i remove bootstrap-rtl from package-mapping-config i still have an error but with jquery-ui

And when i also remove jquery ui from package-mapping-config, then it's ok.

Can you help, what is wrong ?

Version of ANZ used is V.5.6

Thanks it helped !

Hi,

I would like to add a custom "Link" field in a User Notification.

I've created a class MessageAndLinkNotificationData :

[Serializable]
    public class MessageAndLinkNotificationData : MessageNotificationData
    {
        public string Link { get; set; }

        public MessageAndLinkNotificationData(string message, string link) : base(message)
        {
            Link = link;
        }
    }

When i try to retrieve the data in my controller :

var dto = await _userNotificationManager.GetUserNotificationAsync(AbpSession.TenantId, userNotificationId);
var model = new MessageDetailViewModel(dto.Notification.Data.Properties["Message"].ToString(), 
                                                    dto.Notification.Data.Properties["Link"].ToString(), 
                                                    dto.Notification.CreationTime);

I have an error : ** 'NotificationData' does not contain a definition for 'Link' and no accessible extension method 'Link' accepting a first argument of type 'NotificationData' could be found **

What is the best practise to customise User Notification ?

Thanks

Hi,

I have a DTO & ViewModel with a boolean fields. (MyData)

I'm using a checkbox on my razor view :

<input type="checkbox" id="myCheckBox" name="myCheckBox" value="@Model.MyData" checked="@Model.MyData" />

When i try to call my service :

                        myService.myMethod($form.serializeFormToObject())
                            .done(function () {
                                // Todo notify
                            });

I have an error which explain me that the serializeFormToObject() method cannot bind checkbox string to bool :

Could not convert string to boolean: value

Hi,

Can you explain the difference between the AbpSettings table and AppSettingProvider.

What is the best practice for storing settings ?

I have settings which are in the AppSettingProvider, but i can't see them in the table AbpSettings is it normal ?

Shoulh i put all my settings in the table using AddSettingIfNotExists() or is it ok to store some only in the AppSettingProvider ?

Thanks for the explanation :)

Finally, when i use an int? array it's working...

public class GetCandidatsInput : PagedAndSortedInputDto, IShouldNormalize
    {
        public string Filter { get; set; }

        [CanBeNull] public int?[] Metiers { get; set; }

        [CanBeNull] public int?[] Statuts { get; set; }

        public int? PourcentageMini { get; set; }

        public int? PourcentageMaxi { get; set; }

        public string Region { get; set; }

        public void Normalize()
        {
            if (string.IsNullOrEmpty(Sorting))
            {
                Sorting = "Name,Surname";
            }
        }
    }

I don't really understand why...

Here is my AppService code :

public async Task<PagedResultDto<CandidatListDto>> GetCandidats(GetCandidatsInput input)
        {
            var query = UserManager.Users
                .Where(u => u.CandidatId.HasValue)
                .WhereIf((input.Metiers ?? throw new InvalidOperationException()).Any(x=>x.HasValue) , u => input.Metiers.Contains(u.Candidat.MetierCode))
                .WhereIf((input.Statuts ?? throw new InvalidOperationException()).Any(x => x.HasValue), u => input.Statuts.Contains(u.Candidat.StatutInscriptionCode))
                .WhereIf(input.PourcentageMini.HasValue, u => u.Candidat.PourcentageCompletudeProfil >= input.PourcentageMini.Value)
                .WhereIf(input.PourcentageMaxi.HasValue, u => u.Candidat.PourcentageCompletudeProfil <= input.PourcentageMaxi.Value)
                .WhereIf(!input.Region.IsNullOrWhiteSpace(), u => u.Candidat.Adresse.Region.Equals(input.Region))
                .WhereIf(
                    !input.Filter.IsNullOrWhiteSpace(),
                    u =>
                        u.Name.Contains(input.Filter) ||
                        u.Surname.Contains(input.Filter) ||
                        u.UserName.Contains(input.Filter) ||
                        u.PhoneNumber.Contains(input.Filter) ||
                        u.EmailAddress.Contains(input.Filter)
                );

            var candidatsCount = await query.CountAsync();

            var candidats = await query
                .OrderBy(input.Sorting)
                .PageBy(input)
                .Select(x => new CandidatListDto
                {
                    Id = x.Id,
                    PhotoUrl = x.PhotoUrl.IsNullOrEmpty() ? BlobConsts.Avatars.DefaultImageFilePath : $"{_appConfiguration["App:AzureContainerUrlBase"] + _appConfiguration["App:AzureAvatarContainerName"]}/{x.PhotoUrl}",
                    FullName = x.FullName,
                    CreationTime = x.CreationTime,
                    Statut = StatutInscriptionCandidatsConsts.StatutsInscriptionKeyValuePairs.FirstOrDefault(p => p.Key.Equals(x.Candidat.StatutInscriptionCode)).Value,
                    Metier = x.Candidat.MetierAutre.IsNullOrEmpty() ? MetiersConsts.MetiersKeyValuePairs.FirstOrDefault(p => p.Key.Equals(x.Candidat.MetierCode)).Value  : x.Candidat.MetierAutre
                })
                .ToListAsync();

            var candidatsListDtos = ObjectMapper.Map<List<CandidatListDto>>(candidats);

            return new PagedResultDto<CandidatListDto>(
                candidatsCount,
                candidatsListDtos
                );
        }
Showing 11 to 20 of 53 entries