Base solution for your next web application

Activities of "panic"

Hello, I am using the Asp.Net Core+JQuery, full .net. Should we manually add code to include (or not) minified versions of js/css files in our views? Additionally, I noticed that for modal views (like _CreateOrEditModal.cshtml) you already generate minified versions of their js files (_CreateOrEditModal.min.js). Below code is to define a js variable for the modal. Can I select js file for scriptUrl according to value of env.name variable ASPNETCORE_ENVIRONMENT?

var _createOrEditModal = new app.ModalManager({
            viewUrl: abp.appPath + 'App/Languages/CreateOrEditModal',
            scriptUrl: abp.appPath + 'view-resources/Areas/App/Views/Languages/_CreateOrEditModal.js',  //Can I select minified js according to env.name variable ASPNETCORE_ENVIRONMENT if set to Development or Production
            modalClass: 'CreateOrEditLanguageModal'
        });

Many thanks,

P.

* How to handle loading minified versions if on Dev or Prod environments.

@section Scripts
    {
    <environment names="Development">
        <script src="~/view-resources/Areas/App/Views/Banking/Create.js" asp-append-version="true"></script>
    </environment>
    <environment names="Production;Staging">
        <script src="~/view-resources/Areas/App/Views/Banking/Create.min.js" asp-append-version="true"></script>
    </environment>
}
@section Styles
    {
    <environment names="Development">
        <link rel="stylesheet" href="~/view-resources/Areas/App/Views/Banking/Create.css" asp-append-version="true" />
    </environment>
    <environment names="Production;Staging">
        <link rel="stylesheet" href="~/view-resources/Areas/App/Views/Banking/Create.min.css" asp-append-version="true" />
    </environment>
}

Hello, I have successfully deployed a release of the admin web application, however, I don't know how I should deploy the public website on the same domain like the admin website. Both admin and public websites should be under the same domain, same ip and same port, right? ..but this is not accepted by IIS. What do you suggest? Many thanks,

Panayiotis.

Hello, According to this publish guide, [https://www.aspnetzero.com/Documents/Step-by-step-publish-to-azure-core-mvc]), we need to issue command gulp -prod to bundle and minify the js/css files. However, I noticed the change in latest version 5.50 of running command: npm run create-bundles. Is this command for both dev and production bundling and minification? Is there any other settings that have changed in regards to production publishing? Many thanks,

Panayiotis.

Hello, I have a model PropertyBlock which has a parent called PropertyMaster, and also has child models called PropertyUnits. When I call

var propertyBlock = await _propertyBlockRepository.GetAsync(input.Id);

then the parent PropertyMaster is not loaded and also the children collection of PropertyUnits is empty. How can I ask to explicitly load these? Can you please give me some examples of the repository extension methods: EnsureCollectionLoaded<TEntity, TPrimaryKey, TProperty> EnsureCollectionLoadedAsync<TEntity, TPrimaryKey, TProperty> EnsurePropertyLoaded<TEntity, TPrimaryKey, TProperty> EnsurePropertyLoadedAsync<TEntity, TPrimaryKey, TProperty>

Many thanks!

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities.Auditing;
using System.Collections.Generic;

namespace MyPropMan.Entities
{
	[Table("PropertyBlock")]
    public partial class PropertyBlock : FullAuditedEntity
    {
		public const int MaxShortidLength     = 55;
		public const int MaxPropnameLength    = 155;
		public const int MaxTypeofLength   	  = 65;
        public const int MaxAddressLength     = 655;
		public const int MaxPostalAreaLength  = 115;
		public const int MaxPostalCodeLength  = 25;
		public const int MaxCityCountryLength = 95;
        public const int MaxTextLength 	 	  = 555;

        public PropertyBlock()
        {
            Banking = new HashSet<Banking>();
            Bill = new HashSet<Bill>();
            Fee = new HashSet<Fee>();
            Journal = new HashSet<Journal>();
            Payment = new HashSet<Payment>();
            PropertyAccount = new HashSet<PropertyAccount>();
            PropertyExpenditure = new HashSet<PropertyExpenditure>();
            PropertyBudget = new HashSet<PropertyBudget>();
            PropertyExpense = new HashSet<PropertyExpense>();
            PropertyUnit = new HashSet<PropertyUnit>();
            PropertyVendor = new HashSet<PropertyVendor>();
            Receipt = new HashSet<Receipt>();
            Statement = new HashSet<Statement>();
        }

        public int Propertymasterid { get; set; }

		[MaxLength(MaxShortidLength)]
        public string Shortid { get; set; }

		[MaxLength(MaxPropnameLength)]
        public string Name { get; set; }

		[MaxLength(MaxAddressLength)]
        public string Address { get; set; }

		[MaxLength(MaxPostalAreaLength)]
        public string Postalarea { get; set; }

		[MaxLength(MaxPostalCodeLength)]
        public string Postalcode { get; set; }

		[MaxLength(MaxCityCountryLength)]
        public string City { get; set; }

		[MaxLength(MaxCityCountryLength)]
        public string Country { get; set; }

		[MaxLength(MaxTypeofLength)]
        public string Typeof { get; set; }

        public short Blockunits { get; set; }

        public bool? Isowncostcentre { get; set; }

        public bool? Isactive { get; set; }

		[MaxLength(MaxTextLength)]
        public string Textnote { get; set; }

        public PropertyMaster Propertymaster { get; set; }
        public ICollection<Banking> Banking { get; set; }
        public ICollection<Bill> Bill { get; set; }
        public ICollection<Fee> Fee { get; set; }
        public ICollection<Journal> Journal { get; set; }
        public ICollection<Payment> Payment { get; set; }
        public ICollection<PropertyAccount> PropertyAccount { get; set; }
        public ICollection<PropertyExpenditure> PropertyExpenditure { get; set; }
        public ICollection<PropertyBudget> PropertyBudget { get; set; }
        public ICollection<PropertyExpense> PropertyExpense { get; set; }
        public ICollection<PropertyUnit> PropertyUnit { get; set; }
        public ICollection<PropertyVendor> PropertyVendor { get; set; }
        public ICollection<Receipt> Receipt { get; set; }
        public ICollection<Statement> Statement { get; set; }
    }
}

Hello, As taken from DemoUiComponents page, the below javascript is used to initialize a datetime-picker input. Now, I would like to apply a specific display format but I cannot do it because the option is already assigned value 'L'. How can I apply "dd/mm/yyyy HH:MM"?

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

Additionally, just to mention that I tried to use the date-picker component and it would not work because file "bootstrap-datepicker.min.js" was not included in bundle.config.js. Below entries had to be added, to copy file under wwwroot/lib and then to bundle it in "app-layout-libs.js".

under mappings: "node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js": "bootstrap-datepicker/dist/js",
.
.
.
and then:
            outputFileName: 'wwwroot/view-resources/Areas/App/Views/_Bundles/app-layout-libs.js',
            inputFiles: [
                "wwwroot/lib/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js",
Question

Hello, I would like your recommendation on how to incorporate new version 5.06 of Metronic theme to my existing project. I am using the version 5.05 of Metronic. I really need to use the new wizard feature that they have provided with this version. What would be the most appropriate way to update to 5.06? I am using Full.Net Core + JQuery MPA. Many thanks!

Hello, Is there a way to get the primary key (id) of the just inserted record, from java-script side? Let's say I have a database table Contact, and below is the java-script code of the modal that i use to create a new contact record. After I click the save button, I use _contactService.createContact to create the new record in the database. Right after this step I need to get the value of the primary key of the new record. Thank you.

_CreateContactModal.js

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

        var _modalManager;
        var _contactService = abp.services.app.contact;
        var _$form = null;

        this.init = function (modalManager) {
            _modalManager = modalManager;

            _$form = _modalManager.getModal().find('form');
            _$form.validate();
        };

        this.save = function () {
            if (!_$form.valid()) {
                return;
            }

            var contact = _$form.serializeFormToObject();

            _modalManager.setBusy(true);
            _contactService.createContact(contact).done(function () {
                abp.notify.info(app.localize('SavedSuccessfully'));
                _modalManager.close();
                
                //Here I need to get the id of the newly inserted record

                abp.event.trigger('app.createOrEditUserModalSaved');
            }).always(function () {
                _modalManager.setBusy(false);
            });
        };
    };
})(jQuery);

Hello, I have installed stimulsoft trial for Asp.net Core, and I cannot view a simple report in my web application (.Net Core Core MPA, JQuery). When the page starts loading, the report viewer throws "bad request 400" when it comes to call action GetReport of the controller. see images below. The same report shows ok in a new asp .net core web application. Any ideas? I suspect it may have to do with the json naming or something. Many thanks.

Hello, I have created a new _editModal.cshtml, but when I use it to edit a record the padding is zero. How do you recommend to fix this? Many thanks,

P.

Hello, If I add then below line of code in method ConfigureServices (in Startup.cs), the system cannot login and cannot render any records in screens like users, languages. I had to add this line of code as it is recommended to do so when you use Kendo UI for Asp .Net Core. If i remove this line of code then there is no problem. Can you explain why this is happening? Many thanks,

P.

    public IServiceProvider ConfigureServices(IServiceCollection services)
    {
        //MVC
        services.AddMvc(options =>
        {
            options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute());
        }).&lt;ins&gt;AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());&lt;/ins&gt;

        // Add Kendo UI services to the services container
        services.AddKendo();

        var identityBuilder = IdentityRegistrar.Register(services);
            
        //Identity server
        if (bool.Parse(_appConfiguration["IdentityServer:IsEnabled"]))

Showing 1 to 10 of 10 entries