public UnitOfWorkBase(ILocalData <string, IUnitOfWork> localData, string factorykey, IsolationLevel isolationLevel = IsolationLevel.Unspecified)
 {
     successHandlers      = new List <Action>();
     this.localData       = localData;
     this.IsInTransaction = false;
     this.FactoryKey      = factorykey;
 }
Esempio n. 2
0
        public DashboardViewModel()
        {
            _nav  = AppContainer.Instance.GetInstance <INavigationService>();
            _data = new DataService();

            ButtonCommand = new Command <string>(DoButtonCommand);
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(ILocalData dataBase)
        {
            LocalDataGenerator.CreateInitialDb(true);

            this.dataBase = dataBase;
            this.dataBase.Initialize();

            this.mangaGroups = new ObservableCollection<MangaGroupViewModel>();
            LoadMangaList();
        }
Esempio n. 4
0
 public UnitOfWorkFactory(ISessionFactory sessionFactory, ILocalData localData)
 {
     if (sessionFactory == null)
         throw new ArgumentNullException("sessionFactory");
     if (localData == null)
         throw new ArgumentNullException("localData");
     _currentUnitOfWorkKey = "CurrentUnitOfWork.Key\\" + Guid.NewGuid().ToString("N");
     _sessionFactory = sessionFactory;
     _localData = localData;
 }
Esempio n. 5
0
        public MySettingsViewModel()
        {
            _db = DependencyService.Get <ILocalData>();
            var user = _db.GetUserInfo();

            if (user != null)
            {
                id                  = user.Id;
                lastName            = user.LastName;
                firstName           = user.FirstName;
                email               = user.Email;
                phone               = user.Phone;
                mobile              = user.Mobile;
                receiveEmail        = user.ReceiveEmail;
                receiveNotification = user.ReceiveNotification;
                token               = user.Token;
                serverEndPoint      = user.ServerEndPoint;
            }

            this.SaveCommand = new Command(() =>
            {
                if (SaveUser() > 0)
                {
                    ReturnMessage = "Saved";
                }
            });
            this.CancelCommand = new Command(() =>
            {
                LastName            = null;
                FirstName           = null;
                Email               = null;
                Phone               = null;
                Mobile              = null;
                ReceiveEmail        = false;
                ReceiveNotification = false;
                if (SaveUser() > 0)
                {
                    ReturnMessage = "Canceled";
                }
            });
        }
Esempio n. 6
0
 public SessionStore(ILocalData localData)
 {
     this.localData = localData;
 }
Esempio n. 7
0
        public MangaDetailViewModel(IWebData service, ILocalData dataBase)
        {
            this.service = service;
            this.dataBase = dataBase;

            /* MOCKING! */
            //Manga = new Manga()
            //{
            //    Title = "Awesome manga",
            //    LocalSummaryImage = "ms-appx:/Assets/SOUL_EATER-Portada.jpg",
            //    ArtistsDb = string.Join("#", new List<string>() { "Awesome author 1", "Awesome author 2", "Awesome author 1" }),
            //    Description = "You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man. /nYou think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man.",
            //    YearOfRelease = 9999,
            //    LastChapter = 10,
            //    StatusDb = 1,
            //};

            //var chapters = new List<Chapter>();
            //for (int i = 1; i <= 50; i++)
            //    chapters.Add(new Chapter() { Title = "Chapter" + i, Number = i });
            //this.dataBase.CreateInitialDb();
            Manga = dataBase.MangaList.First();
            service.GetMangaChapters(Manga);

            //LoadData();
        }
Esempio n. 8
0
 public UnitOfWorkStore(ILocalData localData)
 {
     this.localData = localData;
 }
Esempio n. 9
0
 static UnitOfWorkFactory()
 {
     UnitOfWorkLocalData = LocalDataFactory <string, IUnitOfWork> .GetOrAdd(LOCAL_DATA_REGION);
 }
Esempio n. 10
0
 public static void Init(IWmsEnvironmentInfoProvider provider, ILocalData localData)
 {
     _provider  = provider;
     _localData = localData;
 }
Esempio n. 11
0
 public UnitOfWork(ISession session, ILocalData <string, IUnitOfWork> localData, string factoryKey, IsolationLevel isolationLevel) : base(localData, factoryKey, isolationLevel)
 {
     this.Session        = session;
     this.IsolationLevel = isolationLevel;
 }