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

Activities of "abdourahmani"

<cite>ismcagdas: </cite> Hi @abdourahmani,

Can you share your app service method's full code ? AspNet Zero already contains entities with different PK than integer and there is no problem with that. Maybe you have another problem.

Thanks.

Hi ! Here it is :

using System.Linq;
using Abp.Domain.Repositories;
using Abp.EntityFrameworkCore.Repositories;
using Lbi.RapproDab.AppBusiness;
using Lbi.RapproDab.AppEntities;
using Microsoft.EntityFrameworkCore;

namespace Lbi.RapproDab.AppService.Rappro
{
    public class RapproAppService : RapproDabAppServiceBase, IRapproAppService
    {
        private readonly IRepository<Agence> _branchRepository;
        private readonly IRepository<AtmTerminal> _atmRepository;
        private readonly IReconciliationManager _rapproManager;
        private readonly IRepository<AtmTransaction, long> _atmTransRepository;
        private readonly IRepository<Acquereur, long> _acqRepository;
        private readonly IRepository<Emetteur, long> _emtRepository;
        private readonly IRepository<CaisseAtm, long> _caiTransRepository;
        private readonly IRepository<ReconciledTrans, long> _recTransRepository;

        public RapproAppService(IReconciliationManager rapproManager,
            IRepository<AtmTerminal> atmRepository, IRepository<Agence> branchRepository,
            IRepository<AtmTransaction, long> atmTransRepository, IRepository<CaisseAtm, long> caiseRepository,
            IRepository<ReconciledTrans, long> recTransRepository, IRepository<Emetteur, long> emtRepository,
            IRepository<Acquereur, long> acqRepository)
        {
            _rapproManager = rapproManager;
            _atmTransRepository = atmTransRepository;
            _caiTransRepository = caiseRepository;
            _atmRepository = atmRepository;
            _branchRepository = branchRepository;
            _recTransRepository = recTransRepository;
            _emtRepository = emtRepository;
            _acqRepository = acqRepository;
        }

        public void ReconcileAll(bool initDb = true)
        {
            var branches = _branchRepository
                .GetAll()
                .Include(p => p.AtmTerminals);
            foreach (var agc in branches)
            {
                ReconcileBranch(agc.BranchCode, initDb);
                initDb = false;
            }
        }

        public void ReconcileBranch(string branchCode, bool initDb = true)
        {
            var atms = _atmRepository.GetAll()
                .Include(p => p.BranchId)
                .Where(a => a.BranchId.BranchCode == branchCode)
                .ToList();
            foreach (var atm in atms)
            {
                ReconcileAtm(branchCode, atm.AtmCode, initDb);
                initDb = false;
            }
        }

        public void ReconcileAtm(string branchCode, string terminalId, bool initDb = true)
        {
            var atmTrans = _atmTransRepository.GetAll()
                .Where(a => a.TerminalId.Equals(terminalId));

            var caiTrans = _caiTransRepository.GetAll()
                .Where(a => a.CaTermId.Equals(terminalId)).ToList();

            var recData = _rapproManager.CustomerTrans(atmTrans, caiTrans);

            var emtTrans = _emtRepository.GetAll().Where(a => a.CaTermId == terminalId);
            recData = _rapproManager.EmetteurTrans(recData, emtTrans);

            var acqTrans = _acqRepository.GetAll().Where(a => a.CaTermId == terminalId);
            recData = _rapproManager.AcquereurTrans(recData, acqTrans);

            recData = _rapproManager.CancelledTrans(recData);

            var db = _recTransRepository.GetDbContext();
            if (initDb)
            {
                const string sql = "Delete from ReconciledTrans;";
                db.Database.ExecuteSqlCommand(sql);
            }

            db.AddRange(recData);
            db.SaveChanges();
        }
    }
}

Regards.

Just to add than I'm using the latest Asp.net core (v4.5.1) with angular

Hi, I have a problem retrieving data.

<ins>Entity definition</ins>

public class AtmData : FullAuditedEntity<long>
    { 
       [Required]
        public virtual DateTime TransDate { get; set; }

        /// <summary>
        /// Montant de la transaction
        /// </summary>
        public virtual decimal TransAmount { get; set; }
}

<ins>DbContext :</ins>

public virtual DbSet<AtmData> AtmTrans { get; set; }

<ins>Application Service</ins>

private readonly IRepository<AtmData, long> _atmTransRepository;

        var atmTrans = _atmTransRepository.GetAll() ;

But GetAll() always returns nothing. I have the same problem with all tables defines with PK other then the default type int. All tables defined with default Pk int work fine.

Please help, I'm unable to see the problem for 2 days now.

Regards Abdourahmani

Hi ,

After running "Yarn upgrade" on my project, I started getting errors in this "feature-tree.component.ts" component.

var $combobox = $('<select class="feature-tree-combobox" />');
                    let inputType = feature.inputType as any;
                    _.each(inputType.itemSource.items, function(opt) {
                        $("<option></option>")
                            //.attr('value', opt.value)
                            //.text(opt.displayText)
                            .appendTo($combobox);
                    });

The commented lines show : <<Property 'value' does not exist on type 'string'>> and <<Property 'displayText' does not exist on type 'string'>>.

After commenting out these lines, the app runs fine, so far.

Can you please point me to how to correct these errors ?

Regards, Abdourahmani

Hi, inspired by this post [https://forum.aspnetboilerplate.com/viewtopic.php?f=5&t=9847]) I solved the problem by adding "System.ComponentModel.TypeConverter" from nugget in all the projects.

Abdourahmani

Hi ,

Every was ok with VS 15.2 until I upgraded VS 15.3.0.

Now getting this "Castle.Core 4.0.0 depends on System.ComponentModel.TypeConverter (>= 4.0.1) but System.ComponentModel.TypeConverter 4.0.1 was not found. An approximate best match of System.ComponentModel.TypeConverter 4.1.0 was resolved." on all projects.

I cleared nuget cache but it did'nt help.

Please help.

Abdourahmani

Hi !

Plaease run the web.host project at least once before running web.public.

Abdourahmani

<cite>ismcagdas: </cite> Hi @abdourahmani,

So, is there any records on AbpLanguages table when you browse it with sql server management studio or with a similar tool ?

Thanks.

It's Ok now. I was running the "public" application. When I switched to the "Host", everything work fine.

Thanks

<cite>ismcagdas: </cite> Hi @abdourahmani,

So, is there any records on AbpLanguages table when you browse it with sql server management studio or with a similar tool ?

Thanks.

No, the table AbpLanguages is empty.

<cite>ismcagdas: </cite> Hi @abdourahmani,

Do you use Sql Server ?

Thanks.

Yes, I'm using Sql Server.

Showing 41 to 50 of 52 entries