public ClanarinaPage(Model.Requests.ClanViewRequest clan)
        {
            InitializeComponent();

            _clan          = clan;
            BindingContext = model = new ClanarinaViewModel(_clan);
        }
        public TreningPage(Model.Requests.ClanViewRequest clan)
        {
            InitializeComponent();

            _clan          = clan;
            BindingContext = model = new TreningViewModel(clan);
        }
        public TreningDetalji(Wellness.Model.Trening trening, Wellness.Model.Requests.ClanViewRequest clan)
        {
            InitializeComponent();

            _clan = clan;
            _apiService_Trening       = new APIService("Trening");
            _apiService_ClanPrisustvo = new APIService("ClanPrisustvo");
            BindingContext            = new TreningDetaljiViewModel(trening, clan);
        }
        public MainPage(Model.Requests.ClanViewRequest clan)
        {
            InitializeComponent();

            _clan = clan;

            MasterBehavior = MasterBehavior.Popover;

            MenuPages.Add((int)MenuItemType.Opis, (NavigationPage)Detail);
        }
예제 #5
0
        public ClanarinaViewModel(Model.Requests.ClanViewRequest clan)
        {
            _apiService = new APIService("Clanarina");
            _clan       = clan;

            #region filters
            //UplataZaGodinu.Add(0);
            //UplataZaMjesec.Add(0);
            SortirajPo.Add("Cijena rast.");
            SortirajPo.Add("Cijena opad.");
            SortirajPo.Add("Datum uplate rast.");
            SortirajPo.Add("Datum uplate opad.");


            List <int> upG             = new List <int>();
            List <int> upM             = new List <int>();
            var        clanarinaFilter = AsyncHelpers.RunSync <List <Wellness.Model.Clanarina> >(() => _apiService.Get <List <Model.Clanarina> >(null));

            clanarinaFilter = clanarinaFilter.OrderBy(c => c.UplataZaGodinu).ToList();
            upG             = clanarinaFilter.Select(c => c.UplataZaGodinu).Distinct().ToList();

            clanarinaFilter = clanarinaFilter.OrderBy(c => c.UplataZaMjesec).ToList();
            upM             = clanarinaFilter.Select(c => c.UplataZaMjesec).Distinct().ToList();


            foreach (int x in upG)
            {
                UplataZaGodinu.Add(x);
            }

            foreach (int x in upM)
            {
                UplataZaMjesec.Add(x);
            }
            #endregion filters



            InitCommand = new Command(async() => await Init());


            if (UplataZaGodinu[0] != 0)
            {
                _SelectedUplataZaGodinu = UplataZaGodinu[0];
            }
            if (UplataZaMjesec[0] != 0)
            {
                _SelectedUplataZaMjesec = UplataZaMjesec[0];
            }
            _SelectedSortirajPo = SortirajPo[0];
        }
예제 #6
0
        private async void FrmClanarine_Load(object sender, EventArgs e)
        {
            var search = new Model.Requests.ClanarinaSearchRequest()
            {
                UplataZaGodinu = null,
                UplataZaMjesec = null,
                PaketID        = 0,
                ClanID         = 0
            };

            var result = await _apiService.Get <List <Model.Clanarina> >(search);

            dgvClanarina.DataSource = result;
            var defaultClan = new Model.Requests.ClanViewRequest()
            {
                Id      = 0,
                Ime     = "Svi",
                Prezime = ""
            };
            var clanovi = await _apiService_Clan.Get <List <Model.Requests.ClanViewRequest> >(null);

            clanovi.Insert(0, defaultClan);
            cbClan.DataSource    = clanovi;
            cbClan.DisplayMember = "Display";
            cbClan.ValueMember   = "Id";
            cbClan.DropDownStyle = ComboBoxStyle.DropDownList;

            var defaultPaket = new Model.Paket()
            {
                Id    = 0,
                Naziv = "svi"
            };
            var paketi = await _apiService_Paket.Get <List <Model.Paket> >(null);

            paketi.Insert(0, defaultPaket);
            cbPaket.DataSource    = paketi;
            cbPaket.DisplayMember = "Display";
            cbPaket.ValueMember   = "Id";
            cbPaket.DropDownStyle = ComboBoxStyle.DropDownList;

            foreach (DataGridViewRow row in dgvClanarina.Rows)
            {
                Model.Clanarina obj = (Model.Clanarina)row.DataBoundItem;
                row.Cells[4].Value = Math.Round(obj.IznosUplate, 2);
                row.Cells[5].Value = obj.Clan.Osoba.Ime + " " + obj.Clan.Osoba.Prezime + " #" + obj.Clan.Id;
                row.Cells[6].Value = obj.Paket.Naziv;
            }
        }
 public RegisterViewModel(ClanViewRequest clan = null)
 {
     _apiService      = new APIService("Osoba");
     _apiService_Clan = new APIService("Clan");
     registerModel    = new RegisterModel();
     RegisterCommand  = new Command(async() => await Register());
     if (clan != null)
     {
         var Osoba = AsyncHelpers.RunSync <Wellness.Model.Osoba>(() => _apiService.GetById <Wellness.Model.Osoba>(clan.OsobaId));
         _osoba                      = Osoba;
         _clan                       = clan;
         registerModel.Ime           = Osoba.Ime;
         registerModel.Prezime       = Osoba.Prezime;
         registerModel.KorisnickoIme = Osoba.KorisnickoIme;
         registerModel.BrojTelefona  = Osoba.BrojTelefona;
         registerModel.Email         = Osoba.Email;
         registerModel.JMBG          = Osoba.Jmbg;
     }
 }
        public TreningViewModel(Model.Requests.ClanViewRequest clan)
        {
            _apiService               = new APIService("trening");
            _apiService_TipTreninga   = new APIService("TipTreninga");
            _apiService_ClanPrisustvo = new APIService("ClanPrisustvo");
            _clan = clan;
            //--------------------------------------------------------
            Trening      = new ObservableCollection <Wellness.Mobile.Models.TreningModel>();
            TipTreninga  = new ObservableCollection <Model.TipTreninga>();
            SearchFilter = new ObservableCollection <string>();


            InitCommand = new Command(async() => await Init());


            SearchFilter.Add("Svi");
            SearchFilter.Add("Prijavljeni");
            SearchFilter.Add("Ne prijavljeni");
            _selectedSearchFilter = SearchFilter[0];


            var SviTipTreninga = new TipTreninga()
            {
                Id           = 0,
                TipTreninga1 = "Svi"
            };

            TipTreninga.Add(SviTipTreninga);

            var listTipTreninga = AsyncHelpers.RunSync <List <Wellness.Model.TipTreninga> >(() => _apiService_TipTreninga.Get <List <Model.TipTreninga> >(null));

            foreach (Model.TipTreninga x in listTipTreninga)
            {
                TipTreninga.Add(x);
            }

            _selectedTipTreninga = TipTreninga[0];
        }