Base solution for your next web application

Activities of "razieh69"

hi, i write YearAppService in my application layer and i want to use from this service in my angularjs controller:

(function () {

    var controllerId = 'YearCtrl';
    angular.module('app').controller(controllerId, [
       '$scope', '$location', '$filter', 'abp.services.app.year',
       function ($scope, $location, $filter, yearService) {
           console.log(yearService);

           var vm = this;  
           vm.DataList = [];

           vm.GetDataList = function () {
               var skipeCount = (vm.currentPage - 1) * vm.pageSize;
               if (skipeCount < 0)
                   skipeCount = 0;

               var input = {
                   maxResultCount: vm.pageSize,
                   skipCount: (skipeCount)
               };

               abp.ui.setBusy(
                       null,
                       yearService.getPage(input).success(function (data) {
                           vm.DataList = data.items;
                          vm.total = data.totalCount;       
                       })
               );
           }

vm.GetDataList();

                  
           }



       }]);

})();

when i log yearService in browser console, i get this result: deleteAsync:function (input, httpParams) getList:function (input, httpParams) getListAsync:function (input, httpParams) getPage:function (input, httpParams) getPageAsync:function (input, httpParams) saveAsync:function (input, httpParams) </span>

but when i call GetDataList function i get this error in browser console:

<span style="color:#FF0000">TypeError: yearService.getPage(...).success is not a function at Object.vm.GetDataList (YearCtrl.js:55) </span>

please help me :cry: :cry: :cry:

Hello,

I Enable AuditLog in my project, but i want to save only Exceptions in abpAuditLog Table. Beacuse the number of rows is too high and my database grows very fast.

how can i do this?

please help me :cry: :cry:

Answer

Thanks for your reply.

Question

hi to All.

i want to log only errors that occur. and disable logging of warning, info and etc.

how can i do this?

hi and thank you for reply. i solve this error.

but i have another problem. in PermissionAppService i want to load only parent permissions with childrens of this parents.

and i write this code:

var permissions = _permissionManager.GetAllPermissions(true).Where(a=>a.Parent==null).ToList();

when i write this where condition, only parent permissions returned, but childrens of parent permissions are null and does not load. and when i remove where condition,all parents and childerens are load together and my program display incorrect tree. how can i solve this problem?

hi, i want to get all parent permissions with childs to create permission tree by jstree.

this is my code in permissionAppService:

public virtual List<PermissionListDto> GetAllPermissionList()
{
 var permissions = _permissionManager.GetAllPermissions(true).Where(a=>a.Parent==null).ToList();
            return permissions.MapTo<List<PermissionListDto>>();
}

and my PermissionListDto:

[AutoMapFrom(typeof(Permission))]
    public class PermissionListDto 
    {
        public virtual ICollection<PermissionListDto> Children { get; }
        public virtual string Description { get; set; }
       public virtual string DisplayName { get; set; }
        public virtual string Name { get; set; }

        public virtual string Text { get; set; }

        public virtual PermissionListDto Parent { get; set; }
    }

but when i call my function in javacsript, i get this error in browser console:

There is an action GetAllPermissionList defined for api controller app/permission but with a different HTTP Verb. Request verb is GET. It should be Post

i think that, automap from IReadonlylist to ICollection (for childrens) is the problem, but i dont khnow how to solve it. please help me, :cry:

hi, i want to get all parent permissions with childs to create permission tree by jstree.

this is my code in permissionAppService:

public virtual List<PermissionListDto> GetAllPermissionList()
{
 var permissions = _permissionManager.GetAllPermissions(true).Where(a=>a.Parent==null).ToList();
            return permissions.MapTo<List<PermissionListDto>>();
}

and my PermissionListDto:

[AutoMapFrom(typeof(Permission))]
    public class PermissionListDto 
    {
        public virtual ICollection<PermissionListDto> Children { get; }
        public virtual string Description { get; set; }
       public virtual string DisplayName { get; set; }
        public virtual string Name { get; set; }

        public virtual string Text { get; set; }

        public virtual PermissionListDto Parent { get; set; }
    }

but when i call my function in javacsript, i get this error in browser console:

There is an action GetAllPermissionList defined for api controller app/permission but with a different HTTP Verb. Request verb is GET. It should be Post

i think that, automap from IReadonlylist to ICollection (for childrens) is the problem, but i dont khnow how to solve it. please help me, :cry:

hi, i write this code to create permissions in tenant side:

var BaseInfo = context.GetPermissionOrNull(PermissionNames.BaseInfo);
            var Documents = context.GetPermissionOrNull(PermissionNames.Documents);
            var Reports = context.GetPermissionOrNull(PermissionNames.Reports);
           
            if (BaseInfo == null)
                BaseInfo = context.CreatePermission(PermissionNames.BaseInfo, L("BaseInfo"));

            if (Documents == null)
                Documents = context.CreatePermission(PermissionNames.Documents, L("Documents"));

            if (Reports == null)
                Reports = context.CreatePermission(PermissionNames.Reports, L("Reports"));

           var Documents_NormalDocuments = Documents.CreateChildPermission(PermissionNames.Documents_NormalDocuments, L("NormalDocuments"), multiTenancySides: MultiTenancySides.Tenant);

i create a child permission in host side with no error, but when i create a child permission in tenant side, i get 500 internal server error in browser console (javascript error: <a class="postlink" href="http://localhost/Accounting/AbpScripts/GetScripts?v=636177502537502113">http://localhost/Accounting/AbpScripts/ ... 2537502113</a> ) and my app dosent work correctly.

please help me.

Showing 1 to 8 of 8 entries