Esempio n. 1
0
        private void GetMoneyClick()
        {
            _progressLoaderService.ShowProgressBar();
            var     records = _dataLoaderService.GetMoneyMaster(StartDate, EndDate, _user.id);
            var     list    = new List <ListMoney>();
            decimal money   = 0;

            foreach (var record in records)
            {
                string photoClient;
                if (record.IdClient == _user.id)
                {
                    photoClient = _user.photo_100;
                }
                else if (ListFriends.items.Where(t => t.id == record.IdClient).FirstOrDefault() != null)
                {
                    photoClient
                        = ListFriends.items.Where(t => t.id == record.IdClient).FirstOrDefault().photo_100;
                }
                else
                {
                    photoClient = "http://guiaexcelenciascuba.com/Images/Utils/icon-user.png";
                }
                money += record.Money;
                list.Add(new ListMoney(record.Money.ToString(), photoClient, record.Service));
            }
            All   = money.ToString();
            Items = new List <ListMoney>(list);
            _progressLoaderService.HideProgressBar();
        }
Esempio n. 2
0
        public async void Init(string idRecord)
        {
            _progressLoaderService = Mvx.Resolve <IProgressLoaderService>();
            _progressLoaderService.ShowProgressBar();
            _idRecord          = Guid.Parse(idRecord);
            _dataLoaderService = Mvx.Resolve <IDataLoaderService>();
            _profileService    = Mvx.Resolve <IProfileService>();
            try
            {
                Record      = _dataLoaderService.GetRecord(Guid.Parse(idRecord));
                CurrentUser = await _profileService.GetUser();

                MasterUser = await _profileService.GetUserById(IdMaster);

                ClientUser = await _profileService.GetUserById(IdClient);

                //if (CurrentUser != null & CurrentUser.id == IdMaster)
                //{
                //    MasterUser = await Mvx.Resolve<IProfileService>().GetUser();
                //    Client = await Mvx.Resolve<IProfileService>().GetFriend(IdClient);
                //}
                //else if (CurrentUser.id == IdClient)
                //{
                //    ClientUser = await Mvx.Resolve<IProfileService>().GetUser();
                //    Master = await Mvx.Resolve<IProfileService>().GetFriend(IdMaster);
                //}
            }
            catch (Exception ex)
            {
                _progressLoaderService.HideProgressBar();
            }
            _progressLoaderService.HideProgressBar();
        }
Esempio n. 3
0
        private void CalendarOnDateChange(object sender, CalendarView.DateChangeEventArgs e)
        {
            _progressLoaderService.ShowProgressBar();
            tabSelect.Check(Resource.Id.schedule_view_segment_free);
            _calendarDate = new DateTime(e.Year, e.Month + 1, e.DayOfMonth);
            ViewModel.ReloadRecord(_calendarDate);

            _progressLoaderService.HideProgressBar();
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            _progressLoaderService = Mvx.Resolve <IProgressLoaderService>();
            _progressLoaderService.ShowProgressBar();
            var fab = FindViewById <FloatingActionButton>(Resource.Id.fab);
            var addNewRecordButoon = FindViewById <FloatingActionButton>(Resource.Id.addNewRecord);

            var toolbar = FindViewById <V7Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            var callButton    = FindViewById <ImageButton>(Resource.Id.button_open_call);
            var sheduleButton = FindViewById <Button>(Resource.Id.shedule_button);

            sheduleButton.Click += OnButtonForShedule;

            var collapsingToolbar = FindViewById <CollapsingToolbarLayout>(Resource.Id.collapsing_toolbar);

            var set = this.CreateBindingSet <MasterView, MasterViewModel>();

            set.Bind(collapsingToolbar).For(ctb => ctb.Title).To(vm => vm.FullName);

            callButton.Click         += OnButtonFoCall;
            addNewRecordButoon.Click += OnAddNewRecord;
            try
            {
                set.Bind(callButton).For(ctb => ctb.Visibility).To(vm => vm.IsPhone).WithConversion("MyVisibility");
                set.Bind(addNewRecordButoon).For(ctb => ctb.Visibility).To(vm => vm.IsMy).WithConversion("MyVisibilityFalse");
            }
            catch (Exception e)
            {
                _progressLoaderService.HideProgressBar();
                Console.WriteLine(e);
                throw;
            }


            this.CreateBinding().For("Title").To <MasterViewModel>(vm => vm.FullName).Apply();
            set.Apply();
            if (ViewModel.Master != null && ViewModel.Master.IsRegistration)
            {
                var draw = GetDrawable(Resource.Drawable.ic_done);
                fab.SetImageDrawable(draw);
            }
            else
            {
                var draw = GetDrawable(Resource.Drawable.ic_clear);
                fab.SetImageDrawable(draw);
            }
            _progressLoaderService.HideProgressBar();
            //if (ViewModel.HomePhone == null & ViewModel.MobilePhone == null)
            //{
            //    callButton.Visibility = ViewStates.Invisible;
            //}
        }
Esempio n. 5
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            _progressLoaderService = Mvx.Resolve <IProgressLoaderService>();
            _progressLoaderService.ShowProgressBar();
            _imageLoader = ImageLoader.Instance;

            if (!_imageLoader.IsInited)
            {
                _imageLoader.Init(ImageLoaderConfiguration.CreateDefault(this));
            }

            IProfileService profileService;
            var             service = Mvx.TryResolve(out profileService);

            var user = await profileService.GetUser();

            var title    = user.first_name + " " + user.last_name;
            var birthday = user.bdate;

            title = string.IsNullOrWhiteSpace(title) ? "New Friend" : title;
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            var collapsingToolbar = FindViewById <CollapsingToolbarLayout>(Resource.Id.collapsing_toolbar);

            collapsingToolbar.SetTitle(title);
            collapsingToolbar.SetCollapsedTitleTextColor(Color.White);
            collapsingToolbar.SetExpandedTitleColor(Color.White);
            try
            {
                _imageLoader.DisplayImage(user.photo_100, FindViewById <ImageView>(Resource.Id.imageView1));
            }
            catch (Exception ex)
            {
                var m = ex.Message;
            }
            _buttonForCategory        = (Button)FindViewById(Resource.Id.category);
            _buttonForShedule         = (Button)FindViewById(Resource.Id.schedule);
            _buttonForCategory.Click += OnCategoryClick;
            _buttonForShedule.Click  += OnSheduleClick;
            _saveButton        = FindViewById <Button>(Resource.Id.save_button);
            _saveButton.Click += SaveButtonOnClick;
            _progressLoaderService.HideProgressBar();
        }
 private void VkLoginButtonOnClick(object sender, EventArgs eventArgs)
 {
     _progressLoaderService.ShowProgressBar();
     ShowLogin();
     _progressLoaderService.HideProgressBar();
 }