Base solution for your next web application

Activities of "[email protected]"

There also appears to be a bug with templating as noted in the attached image. The variable dateRange is being used before its declaration.

Here is the contents of the JSON file. { "IsRegenerate": false, "MenuPosition": "main", "RelativeNamespace": "Swine", "EntityName": "PigGrowthRate", "EntityNamePlural": "PigGrowthRates", "TableName": "PigGrowthRates", "PrimaryKeyType": "int", "BaseClass": "Entity", "EntityHistory": true, "AutoMigration": true, "UpdateDatabase": true, "CreateUserInterface": true, "CreateViewOnly": false, "CreateExcelExport": true, "IsNonModalCRUDPage": false, "IsMasterDetailPage": false, "GenerateOverridableEntity": false, "GenerateUnitTest": true, "GenerateUiTest": true, "PagePermission": { "Host": true, "Tenant": true }, "Properties": [ { "Name": "Photo", "Type": "file", "MaxLength": 0, "MinLength": 0, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": true, "Regex": "", "UserInterface": { "AdvancedFilter": false, "List": true, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": {} }, { "Name": "DateOfAssessment", "Type": "DateTime", "MaxLength": 0, "MinLength": 0, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": false, "Regex": "", "UserInterface": { "AdvancedFilter": false, "List": true, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": {} }, { "Name": "Weight", "Type": "double", "MaxLength": 0, "MinLength": 0, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": false, "Regex": "", "UserInterface": { "AdvancedFilter": false, "List": true, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": { "Precision": "2" } }, { "Name": "Length", "Type": "double", "MaxLength": 0, "MinLength": 0, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": false, "Regex": "", "UserInterface": { "AdvancedFilter": false, "List": true, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": { "Precision": "2" } }, { "Name": "Girth", "Type": "double", "MaxLength": 0, "MinLength": 0, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": false, "Regex": "", "UserInterface": { "AdvancedFilter": false, "List": true, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": { "Precision": "2" } }, { "Name": "MarketScore", "Type": "int", "MaxLength": 0, "MinLength": 0, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": true, "Regex": "", "UserInterface": { "AdvancedFilter": false, "List": true, "CreateOrUpdate": true }, "ViewType": null, "AdditionalData": {} } ], "NavigationProperties": [], "NavigationPropertyOneToManyTables": [], "EnumDefinitions": [], "DbContext": null }

Hi,

Just to confirm, this happens when you genrate a new entity using Power Tools, is that right ? If so, could you share generated entity json file ?

Thanks,

This is in the controller that is built after creating the entity using Power Tools.

I'm using AspNetZero 12.4.0, I've also tried this with the latest release and I get the same results. When I create an entity "GrowthRates" in the GrowthRatesController there are two errors. The first is with var hasFileProp = True;, this should be var hasFileProp = true;. The second is with var projectType = Angular;, this looks like it should be a string or enum and it is not. and therefore must be manually changed.

Question

I was hoping someone would be able to offer some assistance with having base classes in AspNetZero. AspNetZero Version: latest Tech Stack: Asp .Net Core w\ MVC & jQuery

I need to have a base class “Animal” which will contain properties that are relevant to ALL species of animals. An example would be that I have a “PIGS” entity which must inherit from “AnimalBase”.

I’m not too sure how to accomplish this in AspNetZero. I would greatly appreciate a “dumbed-down” response. I have a learning disability which doesn’t make things impossible just takes me longer to catch on.

Thanks

I have ran everything prior to opening the solution in VS. I’m really struggling to understand what’s going on here.

I will attempt to record for you, however, other than showing it isn’t working not sure of the benefit. I’ve followed instructions 100% to the letter. Am I to understand that you have no problems using Power Tools, creating an entity with a file data type and upload works?

Thanks for your response. It seems that either I’m missing something or there’s a bug with Power Tools then. I create an entity property named Photo with the data type of “file” from Power Tools. I then complete the rest of the entity design and click the generate button. All goes well. Now, when I run the application, go to the new entity and chose a file to upload. All that happens is I’m prompted to select my file and then click open. I finish entering in all the rest of the fields and click save. The file is not saved anywhere. I checked the location you specified in your response as well. Now, if I select a new profile image and save it, it works. So I’m wondering if there’s a bug with Power Tools generation?

@ismcagdas

I tried that inside of the Index.js file. This did not work. I tried removing the entire rowActions to see if the Actions button would be gone and to my surprise it was still there. I double and triple checked the file(s) I was working with as well. Here is a portion of the code that I have with your suggestion implemented. This still is not working.

rowAction: { cssClass: 'btn btn-brand dropdown-toggle', text: '<i class="fa fa-cog"></i> ' + app.localize('Actions') + ' <span class="caret"></span>', items: [ { text: app.localize('View'), action: function (data) { _viewPigModal.open({ id: data.record.pig.id }); }, }, { text: app.localize('GoToMwxAction'), visible: function () { return true; }, action: function (data) { document.location.href = '/Mwx/Controller/Action?id=' + data.record.id }, }, { text: app.localize('Edit'), visible: function () { return _permissions.edit; }, action: function (data) { _createOrEditModal.open({ id: data.record.pig.id }); }, }, { text: app.localize('History'), iconStyle: 'fas fa-history mr-2', visible: function () { return entityHistoryIsEnabled(); }, action: function (data) { _entityTypeHistoryModal.open({ entityTypeFullName: _entityTypeFullName, entityId: data.record.pig.id, }); }, }, { text: app.localize('Delete'), visible: function () { return _permissions.delete; }, action: function (data) { deletePig(data.record.pig); }, }, ],

Hey Team,

The project template I'm working with is as follows:

  • ANZ 12.0.0*
  • Template - MVC Core & jQuery*
  • Database - MSSQL*
  • ORM - EF Core

I think I've completely misconstrued the "file" datatype option using Power Tools. I was expecting to be able to upload a file or image and that datatype be of varbinary(max) or something similar. When looking at the entity there is just a virtual property set to a Guid, Int or whatever option I select as the PK. Ultimately, what I'm needing is to figure out a way that I can have 4 images associated with a single animal. So, in other words, the user will select their animal and upload 1 - 4 images which will be stored in the database and associated with that animal. I hope I'm making sense in all this. Again, thank in advance for your help.

Showing 1 to 10 of 12 entries