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

Activities of "adamphones"

Hi

I would like to enable stick head and sticky portlet [https://keenthemes.com/metronic/preview/demo1/components/portlets/sticky-head.html](see here) for metronic template.

I tried to add data-sticky="true" as it described in the doc but no success.

Any idea how this would be achieved?

Regards,

When RAD is used to generate fields for DateTime the client side code generated something like below assuming that date fields are called EffectiveFrom and EffectiveTo:

In angular create-edit component class:

effectiveFrom: Date; effectiveTo: Date;

in the save method:

if (this.effectiveTo) { if (!this.product.effectiveTo) { this.product.effectiveTo = moment(this.effectiveTo).startOf('day'); } else { this.product.effectiveTo = moment(this.effectiveTo); } } else { this.product.effectiveTo = null; } ... //similar for effective from

The problem is that when we are in a different time zone (GMT) then and we want to auto populate 'Effective To' once user selects a date for Effecitve From as below:

effectiveFromChanged(newValue): void { this.effectiveFrom = newValue; this.effectiveTo = moment(this.effectiveFrom).add(12, 'M').toDate();
} } This sets the effective to 1 day before the actual expected date. For example if the user selects effective from 01/04/2020 then effective to should be set to 01/04/2021 instead of 31/03/2021.

I guess this is happening due the fact that conversation takes the timezone into account. But we do not want that! How can we over come this sort of date issues? Any option that would disable this behaviour? Maybe the date pickers should return moment object instead of a date?

Note: Clock.Provider = ClockProviders.Utc; is set in the core module.

Just noticed an issue with not nullable numeric types when editing.

When creating a new entity with RAD generated ui allows us to leave numeric (int, decimal etc) blank and when you save the content as those blank properties are not included in the request payload the backend uses the default values for those properties to save them in the db without any exception. However when it comes to edit the entity those properties are filled with default values (0). When you clear those default values (leave the fields blank) then hit the save button you get the exception as something like "Error converting value {null} to type 'System.Decimal'. "

What would be the best way to ignore those little annoying execptions? I assume that if the UI wouldn't let us click the "Save" button when those fields are empty (form is not valid by adding required) that would be a solution. But somehow even those fields are required it allows to save them in the first instance as empty. Maybe RAD generator should be changed to make those fields required?

Regards

When advanced filter section is used to filter grid by any date time filter(min, max etc) then the filters are cleared to hit search or enter the client side throws exception as 'The parameter 'minDateFromFilter' cannot be null.'.

I think the date should be set to undefined when cleared instead as the generated 'service-proxies.ts' checks for dates against null and throws the exception.

Reproduce step:

1- Use RAD tool to generate an Entity (make sure to select filters by a property that type is date) 2- Once the pages are created go the list of entities 3- Expend the 'Advanced filters' on the page 4- Filter by a date property and hit the enter. 5- Remove the date field and hit the enter

Now you will see a spinner on the page and when you view the F12 you will see the error on the console that shows you that the date is null.

Is there any way to apply migration to multiple db context by using Migrator tool? I don't mean for multi tenant applicaiton. In the application we disabled multi tenant but we have another dbcontext that we would like to apply migration through Migrator.

I would appriciate if you could point me right direction or anyone has this issue.

I have seen here Ismail suggested adding another tenant but I don't find this a good way as this requires storing connection string in database.

version: asp zero 8.1 angular

`public class Schedule{

public DateTime EffectiveFrom {get;set;}

public DateTime EffectiveTo {get;set;} } ` We would like to enforce user to enter EndDate greater than StartDate. We tried ICustomValidate interface as below.

public void AddValidationErrors(CustomValidationContext context) { if (EffectiveTo.HasValue && EffectiveTo.Value.Date < EffectiveFrom.Date) { context.Results.Add(new ValidationResult("Effective To must be greater than Effective From date.")); } }

The validation seems work but on the client side we get an exception as 'Method arguments are not valid! See ValidationErrors for details.' But the client cannot really see which field has the issue or whether the EffectiveTo date should be greater than Effective From date.

One way to fix this issue would be to implement validation on angular in the client side. However we were wonder whether there is a better way to represent these validation issues to the client?

Regarding to this we could only see this document https://aspnetboilerplate.com/Pages/Documents/Validating-Data-Transfer-Objects#introduction-to-validation

Do you have any other documentation which explains data validation?

My second question which relates to this is that whether it is possible to generically create validations? What I mean by this is that instead of having validation on each class to implement "AddValidationErrors" seperate that outside of the class. The reason being is that we have a lot of entities that has the properties EffectiveFrom and EffectiveTo and they all need validation as EffectiveTo> EffectiveFrom. It would be nice to have single validation for those properties and automatically plug it into each class through interface maybe? Any idea on this?

I would appriciate your help on this topic.

Regards,

What we would like is to be able to send friendly message back to client for all Microsoft.EntityFrameworkCore.DbUpdateException instead of sending back 500 invalid exception message : "An error occurred while updating the entries. See the inner exception for details."

Showing 11 to 17 of 17 entries