public PartnerService()
        {
            this.iPartnerDAO = this.Resolve<IPartnerDAO>();            
            this.iOfficerDAO = this.Resolve<IOfficerDAO>();
            this.iDocumentTypeDAO = this.Resolve<IDocumentTypeDAO>();

        }
Пример #2
0
        private static void AddInPartnerUpdates(IPartnerDAO partnerDao, IStoreDAO storeDao, SyncModel syncModel, int fromVersion)
        {
            // Get all the partners that have changed since the last sync with this specific cloud server
            List <AndroAdminDataAccess.Domain.Partner> partners = (List <AndroAdminDataAccess.Domain.Partner>)partnerDao.GetAfterDataVersion(fromVersion);

            foreach (AndroAdminDataAccess.Domain.Partner partner in partners)
            {
                // Add the partner
                Partner syncPartner = new Partner()
                {
                    Id         = partner.Id,
                    ExternalId = partner.ExternalId,
                    Name       = partner.Name
                };

                syncModel.Partners.Add(syncPartner);

                // Get the partner DAO
                IACSApplicationDAO acsApplicationDao = AndroAdminDataAccessFactory.GetACSApplicationDAO();
                if (SyncHelper.ConnectionStringOverride != null)
                {
                    acsApplicationDao.ConnectionStringOverride = SyncHelper.ConnectionStringOverride;
                }

                // Get all the applications that have changed for this partner since the last sync with this specific cloud server
                IList <AndroAdminDataAccess.Domain.ACSApplication> acsApplications = acsApplicationDao.GetByPartnerAfterDataVersion(partner.Id, fromVersion);
                foreach (AndroAdminDataAccess.Domain.ACSApplication acsApplication in acsApplications)
                {
                    // Add the application
                    Application syncApplication = new Application()
                    {
                        Id = acsApplication.Id,
                        ExternalApplicationId = acsApplication.ExternalApplicationId,
                        Name = acsApplication.Name,
                        ExternalDisplayName = acsApplication.ExternalApplicationName
                    };
                    syncPartner.Applications.Add(syncApplication);

                    // Get all the application stores that have changed for this application since the last sync with this specific cloud server
                    StringBuilder siteIds = new StringBuilder();
                    IList <AndroAdminDataAccess.Domain.Store> acsApplicationStores = storeDao.GetByACSApplicationId(acsApplication.Id);
                    foreach (AndroAdminDataAccess.Domain.Store store in acsApplicationStores)
                    {
                        if (siteIds.Length > 0)
                        {
                            siteIds.Append(",");
                        }

                        siteIds.Append(store.AndromedaSiteId.ToString());
                    }

                    syncApplication.Sites = siteIds.ToString();
                }
            }
        }
Пример #3
0
        public static string TryGetExportSyncXml(int fromVersion, int masterVersion, out string syncXml)
        {
            SyncModel syncModel = new SyncModel();

            // The current data version
            syncModel.FromDataVersion = fromVersion;
            syncModel.ToDataVersion   = masterVersion;

            // Get the store DAO
            IStoreDAO storeDao = AndroAdminDataAccessFactory.GetStoreDAO();
            // Get the partner DAO
            IPartnerDAO partnerDao = AndroAdminDataAccessFactory.GetPartnerDAO();
            // Get the store payment provider DAO
            IStorePaymentProviderDAO storePaymentProviderDao = AndroAdminDataAccessFactory.GetStorePaymentProviderDAO();

            //get the list of hosts, host types and connections based on version.
            //var a = AndroAdminDataAccessFactory.gethost

            if (SyncHelper.ConnectionStringOverride != null)
            {
                storeDao.ConnectionStringOverride   = SyncHelper.ConnectionStringOverride;
                partnerDao.ConnectionStringOverride = SyncHelper.ConnectionStringOverride;
                storePaymentProviderDao.ConnectionStringOverride = SyncHelper.ConnectionStringOverride;
            }

            AndroAdminSyncHelper.AddInStoreUpdates(storeDao, syncModel, fromVersion);

            AndroAdminSyncHelper.AddInPartnerUpdates(partnerDao, storeDao, syncModel, fromVersion);

            AndroAdminSyncHelper.AddInStorePaymentProviders(storePaymentProviderDao, syncModel, fromVersion);

            AndroAdminSyncHelper.AddInHubTasks(syncModel, fromVersion);

            //Menu updates as pushed on by MyAndromeda.
            AndroAdminSyncHelper.AddinMenuUpdates(syncModel, fromVersion);

            //Host V2 changes
            AndroAdminSyncHelper.AddInHostV2List(syncModel, fromVersion);

            AndroAdminSyncHelper.AddInStoreDevices(syncModel, fromVersion);
            // Serialize the sync model to XML

            ////add delivery areas to sync model
            //AndroAdminSyncHelper.AddDeliveryAreas(syncModel, fromVersion);

            //add postcodeSectors to sync model
            AndroAdminSyncHelper.AddPostCodeSectors(syncModel, fromVersion);

            AndroAdminSyncHelper.AddLoyalty(syncModel, fromVersion);

            syncXml = SerializeHelper.Serialize <SyncModel>(syncModel);

            return(string.Empty);
        }
 public QuotaService()
 {
     this.iQuotaDAO = this.Resolve<IQuotaDAO>();
     this.iGeneratedPeriodDAO = this.Resolve<IGeneratedPeriodDAO>();
     this.iPartnerDAO = this.Resolve<IPartnerDAO>();
 }