Esempio n. 1
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Resource.Id.refresh:
                var progressDialog = ProgressDialog.Show(this, null, "", true);
                new Thread(new ThreadStart(() =>
                {
                    repo = new ApprovalRepository();

                    List <ApprovalDetailsModel> aprovalList = repo.GetPOApprovalDetails(bitopiApplication.User.UserCode, bitopiApplication.ApprovalRoleType,
                                                                                        bitopiApplication.ApprovalType).Result;

                    _approvalList.Clear();
                    aprovalList.ForEach(s => _approvalList.Add(s));


                    RunOnUiThread(() =>
                    {
                        _approvalListAdapter.NotifyDataSetChanged();
                        progressDialog.Dismiss();
                    });
                })).Start();
                return(true);

            case Resource.Id.about:
                bitopiApplication.ShowAboutDialog(this);
                return(true);
            }
            return(base.OnOptionsItemSelected(item));
        }
Esempio n. 2
0
        protected async override void OnStart()
        {
            bitopiApplication.CurrentActivity = "Approval Detail Activity";
            base.OnStart();
            var progressDialog = ProgressDialog.Show(this, null, "", true);

            repo = new ApprovalRepository();

            List <ApprovalDetailsModel> aprovalList = await repo.GetPOApprovalDetails(bitopiApplication.User.UserCode, bitopiApplication.ApprovalRoleType,
                                                                                      bitopiApplication.ApprovalType);

            _approvalList.Clear();
            aprovalList.ForEach(s => _approvalList.Add(s));
            _approvalListAdapter = new ApprovalDetalisListAdapter(_approvalList, lvApprovalDetailList, this);
            lvApprovalDetailList.SetAdapter(_approvalListAdapter);
            _approvalListAdapter.NotifyDataSetChanged();
            _chkApproveAll.Click += (s, e) =>
            {
                _approvalList.ForEach(t => t.isApproved = _chkApproveAll.Checked);
                _approvalListAdapter.SetData(_approvalList);
                _approvalListAdapter.NotifyDataSetChanged();
            };
            lvApprovalDetailList.SetGroupIndicator(null);
            progressDialog.Dismiss();
        }