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

Activities of "sago"

<cite>alper: </cite> try injecting the IAbpSession

public class MyClass : ITransientDependency
{
   public IAbpSession AbpSession { get; set; }

   public MyClass()
   {
       AbpSession = NullAbpSession.Instance;
   }

   public void MyMethod()
   {
       var currentUserId = AbpSession.UserId;
       //...
   }
}

Injection is already exists through Base class

it's worked when i replaced (from ) to join :

public PagedResultDto<SalesInvoiceListingDto> InvoicesList(FilterDto input)
        {
            try
            {

                var query = from inv in _txSalesInfo.GetAll()
                              .WhereIf(
                 !input.Filter.IsNullOrWhiteSpace(),
                 u =>
                     u.Invoicenumber.Contains(input.Filter) ||
                     u.CustomerName.Contains(input.Filter) ||
                     u.Refrencenumber.Contains(input.Filter))
                            join org in _organizationUnitRepository.GetAll()
                            .WhereIf(
                            !input.Filter.IsNullOrWhiteSpace(),
                            u =>
                                u.DisplayName.Contains(input.Filter)
                                  )

                            on inv.SationId equals org.Id

                            join op in _PartyRepo.GetAll()
                            .WhereIf(
                    !input.Filter.IsNullOrWhiteSpace(),
                       u =>
                       u.JsonName.Contains(input.Filter)
                         )

                            on inv.OperatorId equals op.Id


                            select new SalesInvoiceListingDto
                            {
                                Id = inv.Id,
                                CustomerRefrenceNumber = inv.CustomerRefrenceNumber,
                                DueDate = inv.DueDate,
                                InvoiceDate = inv.InvoiceDate,
                                Invoicenumber = inv.Invoicenumber,
                                Refrencenumber = inv.Refrencenumber,
                                StatusId = inv.StatusId,
                                Operator = op.JsonName,
                                Station = org.DisplayName,
                                Customer = inv.CustomerName
                            };


                var desiredItems = query
                .OrderByDescending(u => u.InvoiceDate)
                .PageBy(input)
                .ToList();
                var TotalCount = query.Count();

                return new PagedResultDto<SalesInvoiceListingDto>(
                TotalCount,
                  desiredItems
                   );
            }
            catch (Exception ex)
            {

                return null;
            }
        }

<cite>ismcagdas: </cite> @sago you don't have to upgrade to ASP.NET Core 2.0.

What is the abp-ng2-module version in your Angular project ? If it is not the latest one, try to upgrade it. Latest version is 2.1.0, see <a class="postlink" href="https://www.npmjs.com/package/abp-ng2-module?activeTab=versions">https://www.npmjs.com/package/abp-ng2-m ... b=versions</a>.

Thanks !! I everything looks working fine.

I installed abp-ng2-module and its version is 2.1.0, however I still have the same error Unexpected authenticateResult!

The AuthenticateResultModel have all results undefined. Please advise.

Thanks alot,this was my problem

RemoveOldgarntedPermissionAsync is in application layer how can i call savechanges, i tried to call it from my custom repositry but it didn't removes the records till the end also.

this is the function in my custom repo. public async Task<string> RemoveGrantedPermessionsForRole(int id) { EnsureConnectionOpen();

        using (var command = CreateCommand("Core_Remove_permessions_By_RoleId", CommandType.StoredProcedure, new SqlParameter("@roleId", id)))
        {
            using (var dataReader = await command.ExecuteReaderAsync())
            {
                var result = "";

                while (dataReader.Read())
                {
                    result = (dataReader["roleId"].ToString());
                }
                 
                Context.SaveChanges();
                return result;
            }
        }

i expected when updating permessions for arole or user

first removes old roles with my custom stored procedure then set the new permessions with setgrantedpermessions function

but what happening now it removes the permessions at the end of the function although i put await befor my custom function the result is the whole permessions removed for this role

here is my code

private async Task UpdateGrantedPermissionsAsync(Role role, List<string> grantedPermissionNames) {

        var grantedPermissions = PermissionManager.GetPermissionsFromNamesByValidating(grantedPermissionNames);
        List&lt;Permission&gt; customList = new List&lt;Permission&gt;();
        foreach (var item in grantedPermissions)
        {
            customList.Add(item);
        }
        var additionalPermessions = await GetGrantedPermessionsFromSystemObjectsAsync(grantedPermissionNames);
        customList.AddRange(additionalPermessions);
        await RemoveOldgarntedPermissionAsync(role.Id);
        await _roleManager.SetGrantedPermissionsAsync(role, customList);
    }
    private async Task RemoveOldgarntedPermissionAsync(int id)
    {
        var oldpermessionsToBeDeleted = await _sysobjectCustomRepo.RemoveGrantedPermessionsForRole(id);
    }

RemoveOldgarntedPermissionAsync:this function call stored procedure to delete but it doesn't execute till the end of function UpdateGrantedPermissionsAsync so it deletes after setting new permessions i don't know how to make it executes before setting the new permessions

the strored procedure doesnt executed ,it started and never ended

create PROCEDURE [dbo].[Core_Remove_permessions_By_RoleId] @roleId int AS BEGIN SET NOCOUNT ON; -- Insert statements for procedure here delete AbpPermissions where RoleId=@roleId END

Answer

i have the same problem any solution !!!

Showing 11 to 20 of 28 entries