For MVC project;
Create a new application service and write the method below. On the client
public async Task<GetUserOrganizationOutput> GetUserNotifications()
{
var userIdentifier = new UserIdentifier(AbpSession.TenantId, AbpSession.UserId.Value);
var organizationUnits= AsyncHelper.RunSync(() => UserManager.GetOrganizationUnitsAsync(UserManager.GetUser(userIdentifier)));
var firstOrganization = organizationUnits.FirstOrDefault();
if (firstOrganization != null)
{
//you have to map firstOrganization to dto and send the dto to client.
return new GetUserOrganizationOutput() {Organization = firstOrganization};
}
return null;
}
If you are using MVC project, Call this application service in _Header.js and set to html with jquery. If you are using angular, you can call the service from header.component.ts
can you provide the console log output of IE11?
hi
Why don't you use DTO. Just create a new class (dto) with the properties you want to update. At your controller or application service method use this dto as parameter. When you map dto to database entity, only the properties in the dto object will be updated and rest will be the same. This is simple and good practise.
Note: I assume you know and use dto mapping (eg: automapper)
hi,
Using tranlation xml files is not suitable for this kind of development. Because translation files are purposed to localize UI texts not client entry data.
I'd go like this, let's say you have Question entity. I'd create QuestionTranslations with columns (QuestionId, LanguageCode, Text) And you can allow admins to enter translations. (better way is integrating with google translate to help the admins for inspiring) When a new language comes, the problem is still there with the 2 approaches . Somebody must translate the old questions.
Hi My answers;
[Column(Order = 1), Key, ForeignKey("MyForeignKey")]
public int Field1 { get; set; }
[Column(Order = 2), Key, ForeignKey("MyForeignKey")]
public string Field2 { get; set; }
Id column is required to use some rich features with IRepository<T>... If you don't want to use ABP's built-in repository features then there's no requirement for Id field.
Hi, Answers to your questions;
Question 1) Are multiple app service calls permitted by the ABP template from a modal? Answer 1) Yes! There's no limit to call different app services in the modal.
Question 2) Do i need to wrap all the sections, address, personal and contact into one view model and then use the single save button for the modal to post the data back to each respective app service for each section? Answer 2) If you want to focus on performance, you should create one app service method for all your savings. But if you want reusablity then you should create different app services for your each sub entities. (Btw if the sub entities need to get a parent entity id, you have to consider the priority of ajax calls.)
Hi,
This enhancement has been completed. You can check out how to overcome the issue. Head to the link below <a class="postlink" href="https://github.com/aspnetboilerplate/module-zero/issues/352">https://github.com/aspnetboilerplate/mo ... issues/352</a>