Esempio n. 1
0
		public  VTSListPresenter (Factory factory, ILocalizeService localaize)
		{	
			_vtsListViewModel = factory.Get<VTSViewModel> ();
			_vtsListViewModel.Server = ConfigurationManager.SERVER;

			Label header = new Label {
				Text = localaize.Data.vacations,// "Vacations",
				Font = Font.SystemFontOfSize (30),
				TextColor = Color.FromHex ("#000"),
				HorizontalOptions = LayoutOptions.Center
			};

			_listView = new ListView {
				ItemsSource = null,
				ItemTemplate = new DataTemplate (typeof(VTSListViewTemplate))
			};

			this.Padding = new Thickness (10, Device.OnPlatform (20, 0, 0), 10, 5);

			this.Content = new StackLayout {
				BackgroundColor = Color.FromHex ("#FFF"),
				Children = {
					header,
					_listView
				}
			};

			changeListView();
		}
Esempio n. 2
0
		public async void StartTestVTSViewModel()
		{			
			VTSViewModel vtsViewModel = new VTSViewModel (_fileSystem, _localizer,new SQLitePlatformWin32());
			vtsViewModel.Server = _testServer;

			List<VTSModel> vtsList = await vtsViewModel.GetVTSList ();
			Assert.IsNotNull (vtsList, "Message GetVTSList error");
		}
Esempio n. 3
0
		public async override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			_vtsViewModel = FactorySingleton.Factory.Get<VTSViewModel> ();
			_vtsViewModel.Localaizer = new Localizer ();
			_vtsViewModel.Server = ConfigurationManager.SERVER;

			_listVTSModel = await _vtsViewModel.GetVTSList ();

			_doneTableBtn = new UIBarButtonItem(UIBarButtonSystemItem.Done, OnDoneTableBtnClick);
			_editTableBtn = new UIBarButtonItem(UIBarButtonSystemItem.Edit, OnEditTableBtnClick);

			NavigationItem.RightBarButtonItem = _editTableBtn;
			NavigationItem.LeftBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Action, OnMenuBtnClick);
		}
Esempio n. 4
0
		public async void Integration ()
		{
			_localizeService = new LocalizeService(_localizer);
			_localizeService.Data = new LocalizeModel ();

			LoginViewModel loginViewModel = new LoginViewModel (_localizer,_platformException);
			VTSViewModel vtsViewModel = new VTSViewModel (_fileSystem, _localizer,new SQLitePlatformWin32());
			LoginMockModel loginData = new LoginMockModel ();
			vtsViewModel.Server = _testServer;

			var isValid =await loginViewModel.CheckLoginData (loginData, _testServer);
			Assert.IsTrue (isValid, "Message: error login data");

			List<VTSModel> vtsList = await vtsViewModel.GetVTSList ();
			Assert.IsNotNull (vtsList, "Message GetVTSList error");

		}
Esempio n. 5
0
        protected async override void OnCreate(Bundle bundle)
		{
			base.OnCreate (bundle);

			SetContentView (Resource.Layout.Main);

			_vtsViewModel = FactorySingleton.Factory.Get<VTSViewModel> ();
			_vtsViewModel.Localaizer = new Localizer (Application.Context);
			_vtsViewModel.Server = ConfigurationManager.SERVER;

			_listVTSModel = await _vtsViewModel.GetVTSList ();

			_listAdapter = new VTSListAdapter (this, _listVTSModel);
			_listView = FindViewById<ListView> (Resource.Id.VTSListView);
			_listView.Adapter = _listAdapter;

			_listView.ItemClick += OnListItemClick;
			_listView.ItemLongClick += OnListItemLongClick;

			_toolbar = FindViewById<SupportToolbar> (Resource.Id.toolbar);
			_drawerLayout = FindViewById<DrawerLayout> (Resource.Id.drawer_layout);

			_leftDrawer = FindViewById<ListView> (Resource.Id.left_drawer);
			_rightDrawer = FindViewById<ListView> (Resource.Id.right_drawer);

			_leftDrawer.Tag = 0;
			_rightDrawer.Tag = 1;

			_leftDrawer.ItemClick += OnLeftDrawerItemClick;

			SetSupportActionBar (_toolbar);

			_leftDataSet = new List<string> ();
			_leftDataSet.Add (_vtsViewModel.Localaizer.Localize("addVacation"));
			_leftAdapter = new ArrayAdapter<string> (this, Android.Resource.Layout.SimpleListItem1, _leftDataSet);
			_leftDrawer.Adapter = _leftAdapter;

			_rightDataSet = new List<string> ();
			_rightDataSet.Add (_vtsViewModel.Localaizer.Localize("helpOVT"));
			_rightDataSet.Add (_vtsViewModel.Localaizer.Localize("helpILL"));
			_rightDataSet.Add (_vtsViewModel.Localaizer.Localize("helpVAC"));
			_rightDataSet.Add (_vtsViewModel.Localaizer.Localize("helpPOV"));
			_rightDataSet.Add (_vtsViewModel.Localaizer.Localize("helpEXV"));
			_rightAdapter = new ArrayAdapter<string> (this, Android.Resource.Layout.SimpleListItem1, _rightDataSet);
			_rightDrawer.Adapter = _rightAdapter;


			_drawerToggle = new MainDrawerToggle (
				this,							
				_drawerLayout,					
				Resource.String.openDrawer,		
				Resource.String.closeDrawer		
			);

			_drawerLayout.SetDrawerListener (_drawerToggle);
			SupportActionBar.SetHomeButtonEnabled (true);
			SupportActionBar.SetDisplayShowTitleEnabled (true);
			_drawerToggle.SyncState ();

			if (bundle != null) {
				if (bundle.GetString ("DrawerState") == "Opened") {
					SupportActionBar.SetTitle (Resource.String.openDrawer);
				} else {
					SupportActionBar.SetTitle (Resource.String.closeDrawer);
				}
			} else {
				SupportActionBar.SetTitle (Resource.String.closeDrawer);
			}
		}