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

Activities of "marble68"

Quick update - I've think I've addressed this by using .ToString("s") for these fields.

It appears moment's parsing is to blame.

I'll let you know.

I'm having to do this to avoid that happening. Is the the correct way?

var data = this.dataTable.data().toArray();
            this.dataTable.clear();
            this.dataTable.draw();
            for (var i = 0; i < departmentList.length; i++) {
                data.push(departmentList[i]);
            }
            for (var i = 0; i < data.length; i++) {
                this.dataTable.row.add(data[i]);   
            }
            this.dataTable.draw();

This seems counterintuitive.

As usual, as soon as I post the question - I find what I think is the answer.

The answer is to push the array to the table, then call it's draw().

            for (var i = 0; i < departmentList.length; i++) {
              this.dataTable.row.add(departmentList[i]);   
            }
            this.dataTable.draw();

However, this is result I'm getting? Any ideas what I'm doing wrong?

I've resolved this. Thank you.

Thank you - this worked.

I had a few issues because I forgot to inherit from ISingletonDependency - but as soon as I did that, the job started correctly.

Certainly.

On my viewModel, I have something like: public DateTime SundayStartUTC { get; set; }

In the view, I set it as follows:

                                <div class="form-group position-relative">
                                    <label for="CompanyDefault_SundayStartUTC">@L("SundayStartUTC")</label>
                                    <input class="form-control m-input date-picker" id="CompanyDefault_SundayStartUTC" type="text" name="sundayStartUTC" value="@Model.CompanyDefault.SundayStartUTC" />
                                </div>

In javascript, I set it as such:

    $('.date-picker').datetimepicker({
        locale: abp.localization.currentLanguage.name,
        format: 'LT'
    });
    

I'm doing anything too crazy, I don't think?

Yes. But I'm still working it out.

I read through that - was just wondering if there's a more efficent way to flatten results.

This will work

For a domain service? It doesn't have a reference to my DbContext which is in Framework core.

Ok - the Rad tool only does one-to-one.

Examining the MS documents - I see I can add, for example List<Department> Departments to my Employee entity.

However, I think this will break migrations.

Thus, I'm looking at the User and Roles - it seems the netZero / ABP way is to:

  • Have a role table
  • Have a UserRoles Table
  • Have a Users table

On the GetUserForEditOutput class has an Array of UserRoleDto.

When GetUserForEdit is call - it goes to the RoleManager which gets all roles, then it selects those into a UserRoleDto.

Then it adds that to the GetUserForEditOutput class and returns it.

On Update or Save - it uses CreateOrUpdateUserInput, which has role names as an array of Strings[].

On update, it sets the roles via the UserManager, which leans on the RoleManager - and it does all this by the role name.

Internally, this takes this array string, finds each role by normalized name, finds the role, then deletes it from UserRoleDto by the Role.Id, or adds it to the UserRoleDto table.

In the modal create or edit js - on save, it goes through the list of checked roles, and builds a string by name, assigns the model, and that's posted back.

This list are the checkboxes under the wrapper div of class user-role-checkbox-list.

The view model is CreateOrEditUserModalViewModel, which is inheriting from GetUserForEditOutput, which has the UserRoleDto array (as mentioned above.

The User inherits from AbpUser which is based on AbpUserBase, which has ICollection<UserRole> Roles.

For mapping, in the customDtoMapper - there's configuration.CreateMap<Role, OrganizationUnitRoleListDto>(); Under the User object, which seems to have more to do the OUs than the actual Roles' ICollection<UserRole>.

The object mapper does not handle roles, instead it leans on the UserManager. It goes through each role, and calls IsInRoleAsync from the userManager, which then goes to our UserRole table and queries it, returning a bool if the list of roles the user has contains the passed name.

It does this each time (inefficient, IMHO, but irrelevant).

So, based on this - to accomplish what I would need to do the following:

I create an Entity for Employee Department membership I modify the DTOs for my employee to have an Arrays / Lists for the EmployeeDepartment entity. Then, in my Employee App Service, I populate the EmployeeDepartment list / array on the Employee DTOs. In the view model, I add this array of EmployeeEntityDTOs, rendering it however I wish (perhaps a modal). Then, on post back, when saving the employee, I also have to update my EmployeeDepartment entity, adding new entries and removing the old ones.

So, in summary, my requirements are:

  • A relationship entity
  • Modify DTOs
  • Modify View Models
  • Modify client side scripts to populate Models
  • Modify App service to handle the Lists/Arrays of the primary Entity.

Am I missing anything?

Showing 91 to 100 of 170 entries