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

Activities of "easyest"

Please excuse me, I may have asked wrong question. The question would be - how to extend organization unit entity? I can extend it as I want, but will OrganizationUnitManager use it? I can extend Tenant, because AbpTenantManager takes class as parameter, but this is not the case with OrganizationUnit , Edition, Language, LanguageText, Notification. So my question is how to extend those?

Could You please point me to the right direction on how to add navigational properties to non-abstract entities, for example organization unit? If I would like to show the count of shops in this organization unit, it would be easiest to count it's ICollection<Shop> navigational property?

Currently every edit form in ASP.NET Zero is shown in a modal using $uibModal and is only one controller. Following this sample is really easy. But what if I would like to show "edit" form that would have two controllers and their views? For example 1 controller is a controller for shop entities and shows shop list. Second controller is a controller for item prices in that shop and shows item price list. This second controller is reused elsewhere, so should be separated from shop controller. My questions would be: How should I open view with multiple controllers and their views? How should I pass ID of the shop, that is selected in the first controller for the second controller to show correct price list?

And another situation - there is a list of shops, when clicked on an entry in this list another page with shop's edit form and a list of it's prices should be shown. How many controllers should there be and how navigation should be done, if price list and editing code is intended to be reused elsewhere?

Please search this forum - I have already posted such attributes with some comments to them.

You cannot authorize "nothing". So, there needs to be a user that You can authorize. If You don't want to send user details - no problem with that, just check and authorize the default user. So, You need to have this default user in Your system - just create a tenant "guest" and admin user for this tenant with any password. Then create new method for login without model:

[HttpPost]
        public async Task<AjaxResponse> Authenticate()
        {
            CheckModelState();

            var loginResult = await GetLoginResultAsync(
                "admin",
                "adminpassword",
                "guest"
                );

            var ticket = new AuthenticationTicket(loginResult.Identity, new AuthenticationProperties());

            var currentUtc = new SystemClock().UtcNow;
            ticket.Properties.IssuedUtc = currentUtc;
            ticket.Properties.ExpiresUtc = currentUtc.Add(TimeSpan.FromMinutes(30));

            return new AjaxResponse(OAuthBearerOptions.AccessTokenFormat.Protect(ticket));
        }

The only difference is that You use predefined values for GetLoginResultAsync instead of values from login model.

Question

Let's say in the application there will be lot's of drop-downs with values Yes/No, so I think it would be good to put such an object somewhere for angular's select to use. There are two ways I can do that - angular constants (using appModule.constant) and global javascript variables (in \Common\Scripts). Using first way, I will need to inject it to my controller, using the second one - no need for that. What would You suggest?

Hasan, I don't think they can answer Your question, as there is no question about ASP.NET Zero actually. There are only two ways to access a resource - with or without authorization. If You want You resource to be accessible without authorization - remove AbpAuthorize tag from Your method. If You want authorization, You will need to send something from Your Android app for the system to authorize. The method Authenticate gives You a token, that You will need to send with Your requests later and it's up to Your Android application to make sure this token is send with later requests. Another way would be to send basic authenticate header with Your api requests, but I am not sure if ASP.NET Zero supports that. On the other hand, this way is a really bad way, so You should not use it.

+1 for such feature.

In my test project, that was based on Abp 0.6.3 I used custom attributes for that (please check attached file).

Few notes on those:

  1. This was done before localization was moved to Core project, so localization source name was set using configuration, now You should be able to get it directly.
  2. There are Display and DisplayName attributes - Display attribute cannot be extended, so You will need to use DisplayName attribute.
  3. For localized validation attributes to work You will need to register them in You Global.asax:
DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(LocalizedRequiredAttribute), typeof(RequiredAttributeAdapter));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(LocalizedStringLengthAttribute), typeof(StringLengthAttributeAdapter));
  1. LocalizedDisplayName attribute can be used on enums also, original DisplayName attribute can not.

Hope that helps :) Attributes.zip

In ITenantAppService there are methods, that do not have return value:

Task CreateTenant(CreateTenantInput input);
        Task UpdateTenant(TenantEditDto input);

But in IOrganizationUnitAppService the same methods do have a return value:

Task<OrganizationUnitDto> CreateOrganizationUnit(CreateOrganizationUnitInput input);
        Task<OrganizationUnitDto> UpdateOrganizationUnit(UpdateOrganizationUnitInput input);

I do no see any difference in usage of those methods from angular. Could You explain, why they are different?

Showing 21 to 30 of 40 entries