Base solution for your next web application

Activities of "Bernard"

Hi,

I encounter a issue when I want to save my data the following error is displayed :

IThe JSON value could not be converted to System.Collections.Generic.List

Here is my payload:

{ "id": "2", "Questions": { "0.Text": "DDD", "0.Type": "Radio", "0.Answers": { "0.Text": "DDD", "1.Text": "DDDD" } }, "intitule": "DEMO", "descriptif": "", "dateDebut": "09/10/2024 09:54:05", "dateFin": "09/10/2024 09:54:05" }

The js code : ` var questionnaire = _$questionnaireInformationForm.serializeFormToObject();

abp.ui.setBusy();
_questionnairesService
    .createOrEdit(questionnaire)
    .done(function () {
        abp.notify.info(app.localize('SavedSuccessfully'));

        abp.event.trigger('app.createOrEditQuestionnaireModalSaved');
    })
    .always(function () {
        abp.ui.setBusy();
    });

};`

app service public virtual async Task CreateOrEdit(CreateOrEditQuestionnaireDto input) { if (input.Id == null) { await Create(input); } else { await Update(input); } }

The model CreateOrEditQuestionnaireDto :

` public class CreateOrEditQuestionnaireDto : EntityDto<int?> {

  [Required]
  [StringLength(QuestionnaireConsts.MaxIntituleLength, MinimumLength = QuestionnaireConsts.MinIntituleLength)]
  public string Intitule { get; set; }

  [StringLength(QuestionnaireConsts.MaxDescriptifLength, MinimumLength = QuestionnaireConsts.MinDescriptifLength)]
  public string Descriptif { get; set; }

  public DateTime DateDebut { get; set; }

  public DateTime DateFin { get; set; }

  public QuestionDto Question { get; set; }
  public List<QuestionDto> questions { get; set; }

}`

List question class :

` public class QuestionDto : EntityDto { public string Text { get; set; }

 public bool Obligatoire { get; set; }

 public string Type { get; set; }

 public string Image { get; set; }

 [NotMapped]
 public int Index { get; set; }

 public virtual int Number { get; set; }

 public int Score { get; set; }

 public int SurveyId { get; set; }

 public List<AnswerResponseDto> Answers { get; set; }

}`

Thks for help Bernard

Question

Hi,

I add following implementation : https://docs.aspnetzero.com/en/aspnet-core-mvc/latest/Feature-Dynamic-Entity-Parameters-Custom-Input-Types-Mvc

But how does this field work is asp Core project any example ?

Thks

Question

Hi,

I have a many to many relation entity for Person and Tache (task in English) but the Persons data in not displayed when calling the task entity ?

Person Entity : ...... public List<Tache> Taches { get; set; }

Tache Entity

public List<Person> Persons { get; set; }

Request :

var dbList = _tacheRepository.GetAllIncluding(x => x.Persons).Where(x => x.Id == tache.Id); var dbList2 = _tacheRepository.GetAll().Include(x => x.Persons).Where(x => x.Id == tache.Id);

the model creating

` modelBuilder.Entity

     modelBuilder.Entity<Tache>()
     .HasMany(e => e.Persons)
    .WithMany(e => e.Taches)
    .UsingEntity("PersonTache");
    
    `
    

database

Any idea ?

Thks

Question

HI,

is possible to get Id of new recorded entity in call back ? ` _personsService.createOrEdit( person ).done(function () { abp.notify.info(app.localize('SavedSuccessfully')); abp.event.trigger('app.createOrEditPersonModalSaved');

 if (typeof (successCallback) === 'function') {
     successCallback();
 }

}).always(function () { abp.ui.clearBusy(); });`

Question

Hi,

is it possible to create permissions for an entity with doesn't exist in database ? For example i have an entity Persons with child Controller Named Contact and like to create permissions for contacts with own controller and views

Question

Hi,

I follow the same method as displaying a user's photo but my code does not work, it's been several days and many tries, do you have an idea of ​​the origin of the issue ?

in view ` @if (Model.Person.PictureId !=null) { <img src="@Url.Action("GetPersonPictureByIdInternal", "Persons", new { area = string.Empty})?pictureId=@(Model.Person.PictureId)" width="128" height="128" class="img-thumbnail img-rounded user-edit-dialog-profile-image" />

} else { <img src="@Url.Content($"{ApplicationPath}Common/Images/default-profile-picture.png")" width="128" height="128" class="img-thumbnail img-rounded user-edit-dialog-profile-image" /> }`

In personsappservices

` public async Task

 var file = await _binaryObjectManager.GetOrNullAsync(picture);

 return new GetProfilePictureOutput(Convert.ToBase64String(file.Bytes));
  

} `

Thks for help

Question

Hi,

Could you tell me please how you're saving image profile in aspnet zero ?

And in file link or byte in database Thks

Question

Hi,

Do you have an example in your application of a view with a non-modal partial view inside ?

I think I must delete some lines with a partial view like BreadcrumbItem

Thks

Question

Hi,

Metronic 8 is delivred with Formrepeater js components

https://preview.keenthemes.com/html/metronic/docs/forms/formrepeater/basic

I'm not able to make the component work with aspnet zero

Any idea or sample

Thks very much

Question

Hi

Is it possible to customize dropdown like this sample :

Thks

Showing 1 to 10 of 42 entries