Base solution for your next web application

Activities of "HCCNOV"

Perfect. I have moved my data request inside the JS file to point to a separate service. Thank you for the guidance.

Version 8.1 Core MVC/JQuery

Is there an example for extending the TenantDashboardAppService so that I can call a Service within Asp.Net Zero (that i created) to generate/return data for the widget? All examples I have found rely solely on GetMemberActivityOutput or DashboardRandomDataGenerator.

I went ahead and crearted a constructor for TenantDashboardAppService and injected my service. This works but want to make sure this is the correct pattern.

The Audit feature DOES work but I have to have the ABP/Zero tables in the older database AS WELL AS the Asp.Net Zero db. Is it possible to have one database (the original older SQL database) and not create the Asp.Net Zero database with all the ABP/Zero tables? Is that the pattern I should have followed?

Hello.

It inherits from AbpDbContext.

I changed our second DbContext to AbpZeroDbContext and added all the ABP/Zero tables to that DB and I have the Auditing working. I don't understand this paradigm as I'm not sure why I would have 2 AbpLanguageTexts in my application (one for each db)

Does that seem right? (our second DB is a very old SQL database and knows nothing about Zero as it was originally connected to an AccessApp and now connected to Zero)

Using version 8.x MVC JQuery.

Also, I have seen this post: StackOVerflow from last year: ASP.NET Boilerplate multiple databases and DbContexts

namespace NOVZERO.EntityFrameworkCore
{
    public class Data70DbContext : AbpDbContext
    {
        public Data70DbContext(DbContextOptions<Data70DbContext> options)
           : base(options)
        {
        }

Is there an example of how to provision the Audited Entity model for another db that is not the main asp.net Zero db? I've followed the instructions which show how to set up the tracked entities in the "Default" db within the {YourProjectName}EntityFrameworkCoreModule.cs

I've set the class up properly using [Audited] and FullAuditedEntity.

This of course will not track audit class because this class belongs to the 2nd dbContext (not ABP/Asp.Net Zero)

Do I need to create the "{YourProjectName}EntityFrameworkCoreModule.cs" type file for the other DB and if so, how?

Thank you

Here is my {YourProjectName}EntityFrameworkCoreModule.cs

 public override void PreInitialize()
        {
            if (!SkipDbContextRegistration)
            {
                //SAR
                Configuration.ReplaceService<IConnectionStringResolver, MyConnectionStringResolver>();

                Configuration.Modules.AbpEfCore().AddDbContext<NOVZERODbContext>(options =>
                {
                    if (options.ExistingConnection != null)
                    {
                        NOVZERODbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
                    }
                    else
                    {
                        NOVZERODbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
                    }
                });

                // Configure second DbContext
                Configuration.Modules.AbpEfCore().AddDbContext<Data70DbContext>(options =>
                {
                    if (options.ExistingConnection != null)
                    {
                        Data70DbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
                    }
                    else
                    {
                        Data70DbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
                    }
                });
            }

            // Set this setting to true for enabling entity history.
            Configuration.EntityHistory.IsEnabled = true;

            // Uncomment below line to write change logs for the entities below:
             Configuration.EntityHistory.Selectors.Add("NOVZEROEntities", EntityHistoryHelper.TrackedTypes);
             Configuration.CustomConfigProviders.Add(new EntityHistoryConfigProvider(Configuration));
        }

Here are my TrackedTypes (CustomersAndAcccount.Property is in the 2nd dbContext)

  public static readonly Type[] HostSideTrackedTypes =
        {
            typeof(OrganizationUnit),
            typeof(Role),
            typeof(Tenant)
        };

        public static readonly Type[] TenantSideTrackedTypes =
        {
            typeof(CustomersAndAccounts.Property),
            typeof(OrganizationUnit),
            typeof(Role)
        };

        public static readonly Type[] TrackedTypes =
            HostSideTrackedTypes
                .Concat(TenantSideTrackedTypes)
                .GroupBy(type => type.FullName)
                .Select(types => types.First())
                .ToArray();

And the Model I wish to track:

namespace NOVZERO.CustomersAndAccounts
{
    [Table("tblPropertyInformation")]
    [Audited]
    public class Property : Entity
    {

        [Key]
        public override int Id { get; set; }

I was also wondering, for the Change Tracking, does the class need to have "FullAuditedEntity" or "AuditedEntity" on it or will the [Audited] Property do the job?

Thank you for the quick confirmation that my code was correctly implemented. That led me to look elsewhere. I started first by removing columns in the DataTable (and adding them back in one at a time). The problem was that Modal JS TableB had a .click function on column 1 called "showDocument" and my Index.js for TableA had a jquery function by the same name. That was causing all kinds of weirdness on the DataTables.Net control.

I renamed the method in the Modal JQuery and problem solved.

thank you.

I really have no idea how to implement a DataTables.Net load routine in a Modal Init. Is there any examples in the base project for MVC/JQuery Core ?

Just to clarify, I only have one Modal. TableA is loaded on a regular page (non-Modal). I want to launch the Modal that contains TableB.

With the code below, the Modal pops up and the DataTables.Net result grid is empty and displays "loading" (never changes). If I change the "max entries" using the UI the results load (but the "loading" never goes away). So, I know service is connected and working, the table just isn't populating on load of modal.

My modal code:

(function ($) {
    app.modals.ViewDocumentsModal = function () {

        var _$clientnameDocumentsTable = $('#clientnameDocumentsTable');
        var _customerDocumentsService = abp.services.app.customerDocuments;
        var _novDocumentsService = abp.services.app.novDocuments;
        var _$documentsForm = null;


        var _modalManager;
        var _$documentsModalFormModalForm = null;


        this.init = function (modalManager) {
            _modalManager = modalManager;
            var modal = _modalManager.getModal();
            _$documentsForm = _modalManager.getModal().find('form[name=DocumentsModalForm]');
            refreshDocumentList();
        };


        function refreshDocumentList() {

            var dataTableDocuments = _$clientnameDocumentsTable.DataTable({
                paging: true,
                serverSide: true,
                processing: true,
                listAction: {
                    ajaxFunction: _customerDocumentsService.getAll,
                    inputFilter: function () {
                        return {
                            countyAccountNumber: $('#AccountNumber').val()
                        };
                    }
                },
                columnDefs: [
                    {
                        className: 'control responsive',
                        orderable: false,
                        render: function () {
                            return '';
                        },
                        targets: 0
                    },
                    {
                        targets: 1,
                        data: null,
                        orderable: false,
                        defaultContent: '',
                        rowAction: {
                            element: $("<div/>")
                                .addClass("text-center")
                                .append($("<button/>")
                                    .addClass("btn")
                                    .attr("title", app.localize("Open Document"))
                                    .append($("<i/>").addClass("la la-search"))
                                ).click(function () {
                                    showDocument($(this).data());
                                })
                        }
                    },
                    {
                        targets: 2,
                        data: "documentItems.fileName",
                        name: "fileName"
                    },
                    {
                        targets: 3,
                        data: "documentItems.classification",
                        name: "classification"
                    },
                    {
                        targets: 4,
                        data: "documentItems.description",
                        name: "description"
                    },
                    {
                        targets: 5,
                        data: "documentItems.documentMime",
                        name: "documentMime"
                    },
                    {
                        targets: 6,
                        data: "documentItems.source",
                        name: "source"
                    },
                    {
                        targets: 7,
                        data: "documentItems.dateCreated",
                        name: "dateCreated",
                        render: function (dateCreated) {
                            if (dateCreated) {
                                return moment(dateCreated).format('L');
                            }
                            return "";
                        }
                    },
                    {
                        targets: 8,
                        data: "documentItems.createdBy",
                        name: "createdBy"
                    }

                ]
            });
        }


        function showDocument(document) {

                event.preventDefault();
                if (document.documentItems.source == "TIFF") {
                    _novDocumentsService.getTiff(document.countyAccountNumber)
                        .done(function (result) {
                            app.downloadTempFile(result);
                        });
                } else {
                    _novDocumentsService.getDocument(document.documentItems.id)
                        .done(function (result) {
                            app.downloadTempFile(result);
                        });
                }
            }


    };
})(jQuery);

and my view:

@using Abp.Extensions
@using NOVZERO.Web.Areas.App.Models.Common.Modals
@model NOVZERO.Web.Areas.App.Models.NovDocuments.ViewDocumentsModalViewModel

@await Html.PartialAsync("~/Areas/App/Views/Common/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel("clientnameDocuments"))

@section Scripts
{
    <script abp-src="/view-resources/Areas/App/Views/NovDocuments/_ViewDocumentsModal.js" asp-append-version="true"></script>
}

<div class="modal-body">
    <form class="form-horizontal audit-log-detail-view" role="form" name="DocumentsModalForm">
        <div class="form-body">
            <input type="hidden" id="AccountNumber" value="@Model.countyAccountNumber" />
            <div class="row align-items-center" style="margin-top:20px;">
                <div class="col-lg-12">
                    <table id="clientnameDocumentsTable" class="display table table-striped table-bordered table-hover dt-responsive nowrap">
                        <thead>
                            <tr>
                                <th></th>
                                <th>@L("Description")</th>
                                <th>@L("Classification")</th>
                                <th>@L("FileType")</th>
                                <th>@L("DateCreated")</th>
                                <th>@L("CreatedBy")</th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </form>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">@L("Close")</button>
</div>

I have a DataTables.Net results table (Table A) on a screen. There is a button on each row that launches a modal containing a DataTables.Net results table (Table B). The button on Table A runs JQuery in the JS file on that page which launches the modal. When I first come to the page containing Table A I can click and launch the modal containing Table B and the table populates and functions perfectly. When I close out of the modal and click on another button on Table A the modal containing Table B does launch, runs the Controller method to populate the Modal ViewModel and returns the PatialView, but Table B is not populating and doesn't ever call the AppService (specified in the listAction of the DataTable.Net table).

My attempt to troubleshoot this led me to placing a button on the Modal screen above Table B which calls the Ajax reload...which in turn dismisses the Modal and reloads the underlying page containing Table A. That "button" on the Modal DOES work on the first load above (it refreshes Table B perfectly) so I know it works.

Everything breaks down when I try to launch that Modal a second time.

Any suggestions?

In past versions of .Net Framework ASP.Net Zero implementations we have used Reporting Services to populate an RDL and push out to browser as PDF. We are implementing the .Net Core version of ASP.Net Zero and cannot find the proper method for implementing this feature to move our code forward.

Since MS is not moving Reporting into .Net Core I am left to assume their recent acquisition from Forerunner Software will be their path forward. That technology will likely take another year or so to mature.

My intuition is leading me to build a separate "service" that can run on the server and respond to requests to bind data to RDLs. This service could be told to emit a PDF back into our file system or document management system and create an abp "alert" for the original user that requested the report. They in turn would go into the "Document Management" portion of the Asp.Net Zero app and download it. In addition to that we could use the same tool to "bulk" process hundreds of RDLs (Invoices) offline and parallelize the app for performance leaving the Asp.Net Zero app free to service the users and UI.

Has anyone else tackled this ?

Thank you for the support and direction. It is appreciated.

Showing 1 to 10 of 27 entries