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

Activities of "mamak"

Hi, I have a simple service method that getting binary obejcts from db.

public async Task<BinaryObject> GetBinaryObj(Guid Id) { BinaryObject binObj = await _binaryObjectManager.GetOrNullAsync(Id); return binObj; }

but when i call this service from chrome its response is nothing.

But In ProfileController :

private async Task<FileResult> GetProfilePictureById(Guid profilePictureId) { var file = await _binaryObjectManager.GetOrNullAsync(profilePictureId); if (file == null) { return GetDefaultProfilePicture(); }

        return File(file.Bytes, MimeTypeNames.ImageJpeg);
    }

this code works fine. But when i want to make it a service in application layer, there is no response.

Controller: HastaTakip, Action: MuayeneModal

var _muayeneModal = new app.ModalManager({ modalId: "modalMuayene", viewUrl: abp.appPath + 'Mpa/HastaTakip/MuayeneModal',
modalClass: 'MuayeneModal', modalData: hastaId }); _muayeneModal.open();

It is ok : "Abp.Authorization.AbpAuthorizationException: Required permissions are not granted. At least one of these permissions must be granted: *** "

But message shown on alert is like "an internal error occured during your request"

Nothing changed. I still get that general message. "an internal error occured during your request"

If user hasn't permission for any Service Method, error msg is ok, is about permission. ("Required permissions were not met...") But for Controller method (returns PartialView) error msg is "an internal error occured..". Not about permission.

I want Controller to show error msg about permission as Service. what can I do?

You say that this is out of scope of Asp.Net Zero framework but my linq query is converted to below sql sentence by Asp.Net Zero framework isn't?

SELECT [Extent1].[Id] AS [Id], [Extent1].[TcKimlikNo] AS [TcKimlikNo], [Extent1].[Adi] AS [Adi], [Extent1].[Soyadi] AS [Soyadi], [Extent1].[DogumTarihi] AS [DogumTarihi], [Extent1].[EvTel] AS [EvTel], [Extent1].[CepTel] AS [CepTel], [Extent2].[Id] AS [Id1], [Extent2].[Muayene_Tarihi] AS [Muayene_Tarihi], [Extent2].[Sikayet] AS [Sikayet], [Extent2].[Deri] AS [Deri], [Extent2].[Bas_Boyun] AS [Bas_Boyun], [Extent2].[Solunum_Sistemi] AS [Solunum_Sistemi], [Extent2].[Sindirim_Sistemi] AS [Sindirim_Sistemi], [Extent2].[Kardiyovaskuler_Sistem] AS [Kardiyovaskuler_Sistem], [Extent2].[Norolojik_Muayene] AS [Norolojik_Muayene], [Extent2].[Kas_Eklem_Sistemi] AS [Kas_Eklem_Sistemi], [Extent2].[Genel] AS [Genel], [Extent2].[Hasta_Durumu] AS [Hasta_Durumu], [Extent2].[Tani] AS [Tani], [Extent3].[Buyuk_Tansiyon] AS [Buyuk_Tansiyon], [Extent3].[Kucuk_Tansiyon] AS [Kucuk_Tansiyon], [Extent3].[Nabiz] AS [Nabiz], [Extent3].[Solunum_Sayisi] AS [Solunum_Sayisi], [Extent3].[Kan_Sekeri] AS [Kan_Sekeri], [Extent3].[Sonuc] AS [Sonuc], [Extent3].[Karar] AS [Karar], [Extent5].[Parametre_Adi] AS [Parametre_Adi], [Extent7].[Ihtiyac_Adi] AS [Ihtiyac_Adi] FROM [dbo].[HstTkp_Hasta] AS [Extent1] INNER JOIN [dbo].[HstTkp_Muayene] AS [Extent2] ON [Extent1].[Id] = [Extent2].[HastaId] INNER JOIN [dbo].[HstTkp_Yapilan_Islem_Hasta] AS [Extent3] ON [Extent2].[Id] = [Extent3].[MuayeneId] LEFT OUTER JOIN [dbo].[HstTkp_Yapilan_Islem_Iliski] AS [Extent4] ON (([Extent4].[IsDeleted] = @DynamicFilterParam_000001) OR (@DynamicFilterParam_000002 IS NOT NULL)) AND ([Extent3].[Id] = [Extent4].[Yapilan_Islem_Hasta_Id]) INNER JOIN [dbo].[HstTkp_Yapilan_Islem_Parametre] AS [Extent5] ON [Extent4].[Yapilan_Islem_Parametre_Id] = [Extent5].[Id] LEFT OUTER JOIN [dbo].[HstTkp_Ihtiyac_Muayene_Iliski] AS [Extent6] ON (([Extent6].[IsDeleted] = @DynamicFilterParam_000001) OR (@DynamicFilterParam_000002 IS NOT NULL)) AND ([Extent2].[Id] = [Extent6].[Muayene_Id]) INNER JOIN [dbo].[HstTkp_Ihtiyac] AS [Extent7] ON [Extent6].[Ihtiyac_Id] = [Extent7].[Id]

WHERE (([Extent1].[IsDeleted] = @DynamicFilterParam_000001) OR (@DynamicFilterParam_000002 IS NOT NULL)) AND (([Extent2].[IsDeleted] = @DynamicFilterParam_000001) OR (@DynamicFilterParam_000002 IS NOT NULL)) AND (([Extent3].[IsDeleted] = @DynamicFilterParam_000001) OR (@DynamicFilterParam_000002 IS NOT NULL)) AND (([Extent5].[IsDeleted] = @DynamicFilterParam_000001) OR (@DynamicFilterParam_000002 IS NOT NULL)) AND (([Extent7].[IsDeleted] = @DynamicFilterParam_000001) OR (@DynamicFilterParam_000002 IS NOT NULL))

In my left outer join; when I update all of right table's(Ihtiyac_Muayene_Iliski) IsDeleted = True, no Result returns. But I have a record in my left table(Muayene), so it must return my left table's rows...

My query:

var query = from HstTkp_Hasta in _hastaRepository.GetAll() join HstTkp_Muayene in _muayeneRepository.GetAll() on new { Id = HstTkp_Hasta.Id } equals new { Id = HstTkp_Muayene.HastaId } join HstTkp_Yapilan_Islem_Hasta in _yapilanIslemHastaRepository.GetAll() on new { Id = HstTkp_Muayene.Id } equals new { Id = HstTkp_Yapilan_Islem_Hasta.MuayeneId } join HstTkp_Yapilan_Islem_Iliski in _yapilanIslemIliskiRepository.GetAll() on new { Id = HstTkp_Yapilan_Islem_Hasta.Id } equals new { Id = HstTkp_Yapilan_Islem_Iliski.Yapilan_Islem_Hasta_Id } into HstTkp_Yapilan_Islem_Iliski_join from HstTkp_Yapilan_Islem_Iliski in HstTkp_Yapilan_Islem_Iliski_join.DefaultIfEmpty() join HstTkp_Yapilan_Islem_Parametre in _yapilanIslemParametreRepository.GetAll() on new { Id = HstTkp_Yapilan_Islem_Iliski.Yapilan_Islem_Parametre_Id } equals new { Id = HstTkp_Yapilan_Islem_Parametre.Id } join HstTkp_Ihtiyac_Muayene_Iliski in _ihtiyacMuayeneIliskiRepository.GetAll() on new { Id = HstTkp_Muayene.Id } equals new { Id = HstTkp_Ihtiyac_Muayene_Iliski.Muayene_Id } into HstTkp_Ihtiyac_Muayene_Iliski_join from HstTkp_Ihtiyac_Muayene_Iliski in HstTkp_Ihtiyac_Muayene_Iliski_join.DefaultIfEmpty() join HstTkp_Ihtiyac in _ihtiyacRepository.GetAll() on new { Id = HstTkp_Ihtiyac_Muayene_Iliski.Ihtiyac_Id } equals new { Id = HstTkp_Ihtiyac.Id }

                    select new MuayeneDetayliListDto
                    {
                        HastaId = HstTkp_Hasta.Id,
                        TcKimlikNo = HstTkp_Hasta.TcKimlikNo,
                        Adi = HstTkp_Hasta.Adi,
                        Soyadi = HstTkp_Hasta.Soyadi,
                        DogumTarihi = HstTkp_Hasta.DogumTarihi,
                        EvTel = HstTkp_Hasta.EvTel,
                        CepTel = HstTkp_Hasta.CepTel,
                        MuayeneId = HstTkp_Muayene.Id,
                        Muayene_Tarihi = HstTkp_Muayene.Muayene_Tarihi,
                        Sikayet = HstTkp_Muayene.Sikayet,
                        Deri = HstTkp_Muayene.Deri,
                        Bas_Boyun = HstTkp_Muayene.Bas_Boyun,
                        Solunum_Sistemi = HstTkp_Muayene.Solunum_Sistemi,
                        Sindirim_Sistemi = HstTkp_Muayene.Sindirim_Sistemi,
                        Kardiyovaskuler_Sistem = HstTkp_Muayene.Kardiyovaskuler_Sistem,
                        Norolojik_Muayene = HstTkp_Muayene.Norolojik_Muayene,
                        Kas_Eklem_Sistemi = HstTkp_Muayene.Kas_Eklem_Sistemi,
                        Genel = HstTkp_Muayene.Genel,
                        Hasta_Durumu = HstTkp_Muayene.Hasta_Durumu,
                        Tani = HstTkp_Muayene.Tani,
                        Buyuk_Tansiyon = HstTkp_Yapilan_Islem_Hasta.Buyuk_Tansiyon,
                        Kucuk_Tansiyon = HstTkp_Yapilan_Islem_Hasta.Kucuk_Tansiyon,
                        Nabiz = HstTkp_Yapilan_Islem_Hasta.Nabiz,
                        Solunum_Sayisi  = HstTkp_Yapilan_Islem_Hasta.Solunum_Sayisi,
                        Kan_Sekeri = HstTkp_Yapilan_Islem_Hasta.Kan_Sekeri,
                        Sonuc = HstTkp_Yapilan_Islem_Hasta.Sonuc,
                        Karar = HstTkp_Yapilan_Islem_Hasta.Karar,
                        Yapilan_Islem_Adi = HstTkp_Yapilan_Islem_Parametre.Parametre_Adi,
                        Ihtiyac_Adi = HstTkp_Ihtiyac.Ihtiyac_Adi
                    };

        query = query
            .WhereIf(input.HastaId.HasValue, item => item.HastaId.Equals(input.HastaId))
            .AsQueryable();

        var results = query.ToList();

In my service method after getting data from db and mapping to my dto, I want my dto's some properties to be null or empty string if user doesn't have permission to see these. Can Abp do this automatically or should i do manually using PermissionChecker.IsGranted for each prop?

Showing 11 to 18 of 18 entries