Exemplo n.º 1
0
        public Config Load()
        {
            var c = _configRepository.Get(VirtualCityApp.Ditributr);
            if (c == null)
            {

                Config c1 = new Config()
                {
                    CostCentreId = Guid.Empty,
                    CostCentreApplicationId = Guid.Empty,
                    CostCentreApplicationDescription = "",
                    DateInitialized = DateTime.Now,//DateTime.MinValue,
                    IsApplicationInitialized = false,
                    WebServiceUrl = "",
                    ApplicationStatus = 0,
                    AppId = VirtualCityApp.Ditributr
                };
                Save(c1);
                c = _configRepository.Get(VirtualCityApp.Ditributr);

            }
            return new Config
            {
                CostCentreId = c.CostCenterId,
                DateInitialized = c.DateInitialized,
                IsApplicationInitialized = c.IsApplicationInitialized,
                CostCentreApplicationDescription = c.CostCentreApplicationDescription,
                CostCentreApplicationId = c.CostCentreApplicationId,
                WebServiceUrl = c.WebServiceUrl,
                ApplicationStatus = c.ApplicationStatus,
                AppId = (VirtualCityApp)c.VirtualCityApp,

            };
        }
Exemplo n.º 2
0
 public void Save(Config config)
 {
     var c = _configRepository.Get(config.AppId);
     if (c == null)
         c = new ConfigLocal();
     c.CostCenterId = config.CostCentreId;
     c.DateInitialized = config.DateInitialized;
     c.IsApplicationInitialized = config.IsApplicationInitialized;
     c.CostCentreApplicationDescription = config.CostCentreApplicationDescription;
     c.CostCentreApplicationId = config.CostCentreApplicationId;
     c.WebServiceUrl = config.WebServiceUrl;
     c.ApplicationStatus = config.ApplicationStatus;
     c.VirtualCityApp = (int)config.AppId;
     _configRepository.Save(c);
     
 }