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

Activities of "omital"

Hi, I have been trying to configure entityframework's initialize method to upgrade tenatns db to latest version in project startup, but upgrade does not happen except for host tenant. How can I solve this approach ?

Hi, I think that method "AddLanguageIfNotExists" in template with this code

private void AddLanguageIfNotExists(ApplicationLanguage language)
        {
            if (_context.Languages.Any(l => l.TenantId == language.TenantId && l.Name == language.Name))
            {
                return;
            }

            _context.Languages.Add(language);

            _context.SaveChanges();
        }

must be

private void AddLanguageIfNotExists(ApplicationLanguage language)
        {
            if (_context.Languages.Any(l => (l.TenantId == language.TenantId || (l.TenantId.HasValue==false && language.TenantId.HasValue==false)) && l.Name == language.Name))
            {
                return;
            }

            _context.Languages.Add(language);

            _context.SaveChanges();
        }

I recently update packages in my project. When I run project I got this error

Server Error in '/Azma.Web' Application.

Method not found: 'AutoMapper.IMappingExpression AutoMapper.Mapper.CreateMap(System.Type, System.Type)'. 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.MissingMethodException: Method not found: 'AutoMapper.IMappingExpression AutoMapper.Mapper.CreateMap(System.Type, System.Type)'.

Source Error:

How I can solve this problem?!

Hi, I download template with this option: Entity + MultiPage Application but when I run project I got this error

Unhandled exception at line 9, column 5 in http://localhost:61759/js/main.js

0x800a138a - JavaScript runtime error: Function expected

Hi, All js file in view folder (SPA Project) load in project startup. I think it is a impact performance in project with lot of js files. any solution?

Question

Hi, AzmaSettings declared in Core project and use it in PreInitialize method of CoreModule. I want to read/write setting from/to db. with this code

public class AzmaSettings : SettingProvider
    {
        private readonly IRepository<ACC.Formals.Formal> _formalRepo;

        public AzmaSettings(IRepository<ACC.Formals.Formal> formalRepo)
        {
            _formalRepo = formalRepo;
        }
        public override IEnumerable<SettingDefinition> GetSettingDefinitions(SettingDefinitionProviderContext context)
        {
            var v = _formalRepo.GetAll().FirstOrDefault().Name;

            return new[]
                {
                    new SettingDefinition(
                        "TestSetting",
                       v
                        )
                };

        }
    }

I got this error

The operation cannot be completed because the DbContext has been disposed.

where is the problem?

Question

Hi. I use this code for role permission

(function () {

    var app = angular.module('app');

    var controllerId = 'sts.views.role.edit';
    

    app.controller(controllerId, [
    '$scope', '$uibModal', '$location', '$stateParams', 'abp.services.isirids.role',
    function ($scope, $uibModal, $location, $stateParams, roleService) {
        var vm = this;
        vm.id = $stateParams.id;
        vm.permissionData = [];
        vm.treeData = [];
        $scope.animationsEnabled = false;   


        vm.initialTreeViewDate = function () {
            for (var i = 0; i < vm.role.permissions.length; i++) {
                var _itm = {
                    id: vm.role.permissions[i].name,
                    parent: vm.role.permissions[i].parentName != null ? vm.role.permissions[i].parentName : "#",
                    text: vm.role.permissions[i].displayName,
                    state: { opened: false}
                };

                if (vm.role.grantedPermissions.indexOf(vm.role.permissions[i].name) != -1) {
                    _itm.state.selected = true;
                }
                else
                    _itm.state.selected = false;

                vm.permissionData.push(_itm);
            }
            
            angular.copy(vm.permissionData, vm.treeData);

            vm.treeConfig = {
                core: {
                    multiple: false,
                    animation: true,
                    error: function (error) {
                        $log.error('treeCtrl: error from js tree - ' + angular.toJson(error));
                    },
                    check_callback: true,
                    worker: true
                },
                types: {
                    default: {
                        icon: 'glyphicon glyphicon-chevron-left'
                    },
                    star: {
                        icon: 'glyphicon glyphicon-chevron-left'
                    },
                    cloud: {
                        icon: 'glyphicon glyphicon-chevron-left'
                    }
                },
                version: 1,
                plugins: ['types', 'checkbox']
            };

            this.applyModelChanges = function () {
                return !vm.ignoreChanges;
            };

            this.createCB = function (e, item) {
                $timeout(function () { toaster.pop('success', 'Node Added', 'Added new node with the text ' + item.node.text) });
            };


        };
        
        vm.localize = abp.localization.getSource('ISD');

        if (vm.id > 0) {
            roleService.getRoleForEdit(vm.id)
            .success(function (data) {
                vm.role = data;
                vm.initialTreeViewDate();
            });
        }
        else {
            roleService.getRoleForEdit(-1)
             .success(function (data) {
                 vm.role = data;
                 vm.initialTreeViewDate();
             });
        }

       
        vm.deleteRole = function () {

            swal({
                title: vm.localize("AreYouSure"),
                text: vm.localize("RoleWillBeDeleted", vm.role.name),
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: vm.localize("YesDeleteIt"),
                cancelButtonText:vm.localize("Cancel"),
                closeOnConfirm: false,
                closeOnCancel: true,
            }, function (isConfirm) {
                if (isConfirm) {
                    abp.ui.setBusy(null,
                     roleService.deleteRole({id: vm.role.id }).success(function () {
                         swal(vm.localize("Deleted"), vm.localize("RoleDeleteSuccess"), "success");
                         $location.path('/labsCertificate/list');
                        }
                    ));
                } else { swal(vm.localize("Cancelled"), vm.localize("CancelDescription"), "error"); }
            });
        };
       
        vm.validationErrors = null;


        vm.saveRole = function () {

            //var selectedPermissions = [];


            var checkedItems = $("#jsTreePermission").jstree('get_checked');

            //for (var i = 0; i < checkedItems.length; i++) {
            //        selectedPermissions.push(checkedItems[i]);
            //}

            abp.ui.setBusy(
                null,
                roleService.upsertRole({
                    id: vm.role.id,
                    name: vm.role.name,
                    displayName: vm.role.displayName,
                    isDefault: vm.role.isDefault,
                    selectedPermissions: checkedItems
                    })
                .success(function () {
                    vm.validationErrors = null;
                    abp.notify.info(abp.utils.formatString(vm.localize("RoleEditedMessage"), vm.role.name ));
                    $location.path('/role/list');

                }).
                error(function (data) {

                })
                );
        };
    }]);
})();

most of time I recive thi error message

Hi. I have Application Service without any authorization requirement. How can I call AppService method form for example Fiddler or Postman (or from MobileApp)?

Hi, How can I use abp WebApi in windows form application ? :roll: How Sign in to application? :roll:

Question

Hi, Suppose we have person entity that use in different solution. How can I create a Module that contain person entity definition (Entity, AppService, Views and ...) to include in all solution?

Showing 21 to 30 of 43 entries