예제 #1
0
        private void ReportList_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            if (listAdapter.GetItemViewType(e.Position) != 1)
            {
                var reportDataData = headerandItemsList[e.Position];
                if (Utility.IsInternetAvailable(Application.Context))
                {
                    sharedPreferencesEditor.PutInt(Resources.GetString(Resource.String.report_id), reportDataData.ReportDataId);
                    sharedPreferencesEditor.PutString(Resources.GetString(Resource.String.report_name), reportDataData.ReportName);
                    sharedPreferencesEditor.PutString(Resources.GetString(Resource.String.report_type), !reportDataData.IsArchived ? "draft" : "archive");
                    sharedPreferencesEditor.Commit();

                    Activity.StartActivity(typeof(FormActivity));
                }
                else
                {
                    Utility.DisplayToast(Application.Context, Application.Context.Resources.GetString(Resource.String.internettoreadreport));
                }
            }
        }
예제 #2
0
        public override void OnListItemClick(ListView l, View v, int position, long id)
        {
            if (listAdapter.GetItemViewType(position) != 1)
            {
                if (Utility.IsInternetAvailable(Application.Context))
                {
                    Report reportDataX  = headerandItemsList[position];
                    int    idReportData = reportDataX.ReportDataId;

                    sharedPreferencesEditor.PutInt("ReportID", idReportData);
                    sharedPreferencesEditor.PutString("ReportType", "archive");
                    sharedPreferencesEditor.PutString("ReportName", headerandItemsList[position].ReportName);
                    sharedPreferencesEditor.Commit();

                    Activity.StartActivity(typeof(FormActivity));
                }
                else
                {
                    Toast.MakeText(Application.Context, Resources.GetString(Resource.String.internettoreadreport), ToastLength.Long).Show();
                }
            }
        }