Esempio n. 1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.frequent, container, false);

            gv          = rootView.FindViewById <GridView>(Resource.Id.gv);
            prefs       = PreferenceManager.GetDefaultSharedPreferences(Activity);
            desig_Id    = prefs.GetString("DesignationId", "");
            geo         = new Geolocation();
            db          = new DbHelper();
            con         = new InternetConnection();
            geolocation = geo.GetGeoLocation(Activity);

            Boolean connectivity = con.connectivity();

            if (connectivity)
            {
                getData();
            }
            else
            {
                freq = db.GetFrequentList();
                if (freq.Count > 0)
                {
                    adapter = new FrequentAdapter(Activity, freq);
                }
                else
                {
                    Toast.MakeText(Activity, "Couldn't find data for frequents. Please connect to the internet", ToastLength.Long).Show();
                }
                gv.Adapter = adapter;
            }

            return(rootView);
        }
Esempio n. 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.taskin_layout, null);

            recyclerview = view.FindViewById <RecyclerView>(Resource.Id.recyclerview1);
            linearLayout = view.FindViewById <LinearLayout>(Resource.Id.linearlayout1);
            prefs        = PreferenceManager.GetDefaultSharedPreferences(Activity);
            u_id         = prefs.GetString("DesignationId", "");

            geo         = new Geolocation();
            geolocation = geo.GetGeoLocation(Activity);


            HasOptionsMenu = true;
            //DividerItemDecoration itemDecor = new DividerItemDecoration(Activity, Orientation.Horizontal);
            //recyclerview.AddItemDecoration(itemDecor);
            DividerItemDecoration horizontalDecoration = new DividerItemDecoration(recyclerview.Context,
                                                                                   DividerItemDecoration.Vertical);
            Drawable horizontalDivider = ContextCompat.GetDrawable(Activity, Resource.Drawable.divider);

            horizontalDecoration.SetDrawable(horizontalDivider);
            recyclerview.AddItemDecoration(horizontalDecoration);
            search = view.FindViewById <Android.Widget.SearchView>(Resource.Id.searchview);


            search.QueryTextChange += sv_QueryTextChange;

            getData();
            return(view);
        }
Esempio n. 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.switchuser_layout);
            loginModel  = new List <LoginModel>();
            db          = new DbHelper();
            restService = new ServiceHelper();
            geo         = new Geolocation();
            prefs       = PreferenceManager.GetDefaultSharedPreferences(this);
            version     = Android.App.Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Android.App.Application.Context.ApplicationContext.PackageName, 0).VersionName;
            geolocation = geo.GetGeoLocation(this);

            licenceid  = prefs.GetString("LicenceId", "");
            npid       = prefs.GetString("NaturalPersonId", "");
            loginModel = db.getDetail();
            bool isRegistered = prefs.GetBoolean("IsRegistered", false);

            //if (isRegistered)
            //{
            //    Intent intent = new Intent(this, typeof(MainActivity));
            //    intent.AddFlags(ActivityFlags.NewTask);
            //    StartActivity(intent);
            //    Finish();

            //}

            userlist = FindViewById <ListView>(Resource.Id.listview1);

            switchdata = new SwitchUser_Adapter(this, loginModel);
            userlist.SetAdapter(switchdata);

            userlist.ItemClick += ItemSelected;

            // Create your application here
        }
        public async Task getextensionmethodAsync(string filetype)
        {
            try
            {
                if (ic.connectivity())
                {
                    geolocation = geo.GetGeoLocation(Context);
                    string file_extension = await restservice.FileExtension(Activity, filetype, geolocation);

                    List <FileExtension> fileExtensions = JsonConvert.DeserializeObject <List <FileExtension> >(file_extension);
                    db.insertfileextension(fileExtensions);
                    fileextgetlist.Add(new FileExtension {
                        Text = "Select Extension", Value = "0"
                    });
                    for (int i = 0; i < fileExtensions.Count; i++)
                    {
                        fileextgetlist.Add(new FileExtension {
                            Text = fileExtensions[i].Text, Value = fileExtensions[i].Value
                        });
                    }
                    spinnerextension.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(Spinnertype_ItemSelected2);
                    ArrayAdapter adapter1 = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, fileextgetlist);
                    spinnerextension.Adapter = adapter1;
                }
                else
                {
                    List <FileExtension> fileExtensions = db.getfileextension(filetype);
                    fileextgetlist.Add(new FileExtension {
                        Text = "Select Extension", Value = "0"
                    });
                    for (int i = 0; i < fileExtensions.Count; i++)
                    {
                        fileextgetlist.Add(new FileExtension {
                            Text = fileExtensions[i].Text, Value = fileExtensions[i].Value
                        });
                    }
                    spinnerextension.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(Spinnertype_ItemSelected2);
                    ArrayAdapter adapter1 = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, fileextgetlist);
                    spinnerextension.Adapter = adapter1;
                }
            }
            catch (Exception ex)
            {
            }
        }
 public override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     geo         = new Geolocation();
     restservice = new ServiceHelper();
     location    = geo.GetGeoLocation(Activity);
     orgmodel    = new List <OrgModel>();
     orgname     = new List <OrgModel>();
     // Create your fragment here
 }
Esempio n. 6
0
 // public static List<SubmitModel> summarydata = new List<SubmitModel>();
 public override void OnCreate(Bundle savedInstanceState)
 {
     StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
     im_model = new List <TaskOutboxModel>();
     StrictMode.SetVmPolicy(builder.Build());
     StrictMode.ThreadPolicy.Builder builder1 = new StrictMode.ThreadPolicy.Builder().PermitAll();
     StrictMode.SetThreadPolicy(builder1.Build());
     geo         = new Geolocation();
     geolocation = geo.GetGeoLocation(Activity);
     base.OnCreate(savedInstanceState);
 }
Esempio n. 7
0
        async Task <JsonValue> nextActivity(string un, string p)
        {
            licenceid = prefs.GetString("LicenceId", "");
            if (licenceid == null || licenceid == "")
            {
                await Get_Licence_Id();

                licenceid = prefs.GetString("LicenceId", "");
            }

            geolocation = geo.GetGeoLocation(this);
            dynamic value = new ExpandoObject();

            value.UserId   = un;
            value.Password = p;
            value.gcmid    = "";
            string json = JsonConvert.SerializeObject(value);

            JsonValue item = await restService.LoginUser2(this, version, un, json, geolocation).ConfigureAwait(false);

            return(item);
        }
Esempio n. 8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // GetPermissionAsync();
            isRecording = false;
            SetContentView(Resource.Layout.compliance_layout2);
            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.SetVmPolicy(builder.Build());
            StrictMode.ThreadPolicy.Builder builder1 = new StrictMode.ThreadPolicy.Builder().PermitAll();
            StrictMode.SetThreadPolicy(builder1.Build());

            AudioSavePathInDevice = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + "/AudioRecording.mp3";
            geolocation           = geo.GetGeoLocation(this);
            prefs = PreferenceManager.GetDefaultSharedPreferences(this);

            tap = geolocation.Split(",");

            //task_id = Intent.GetStringExtra("task_id") ?? string.Empty;
            //task_description = Intent.GetStringExtra("task_descrip") ?? string.Empty;
            //deadline = Intent.GetStringExtra("deadline") ?? string.Empty;
            //task_name = Intent.GetStringExtra("task_name") ?? string.Empty;
            //markby = Intent.GetStringExtra("mark_by") ?? string.Empty;
            //creationdate = Intent.GetStringExtra("creation_date") ?? string.Empty;
            //taskcreatedby = Intent.GetStringExtra("created_by") ?? string.Empty;

            camera        = FindViewById <ImageButton>(Resource.Id.imageButton1);
            videobutton   = FindViewById <ImageButton>(Resource.Id.imageButton2);
            location      = FindViewById <ImageButton>(Resource.Id.imageButton4);
            mike          = FindViewById <ImageButton>(Resource.Id.imageButton3);
            imagecaptured = FindViewById <ImageView>(Resource.Id.imageView1);
            description   = FindViewById <EditText>(Resource.Id.ed2);
            rl2           = FindViewById <LinearLayout>(Resource.Id.rl2);
            rl3           = FindViewById <LinearLayout>(Resource.Id.rl3);
            rl4           = FindViewById <LinearLayout>(Resource.Id.rl4);
            mike.Click   += delegate
            {
                recording();
            };
            location.Click += delegate
            {
                //CheckForLocation();
            };

            string path = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + "/test.mp4";

            camera.Click      += BtnCamera_Click;
            videobutton.Click += VideoClick;
            getData();
        }
Esempio n. 9
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.public_login, null);

            method        = view.FindViewById <TextView>(Resource.Id.methodforlogin);
            phonenum      = view.FindViewById <EditText>(Resource.Id.phone_p);
            verify        = view.FindViewById <Button>(Resource.Id.verify_p);
            geolocation   = geo.GetGeoLocation(Activity);
            version       = Android.App.Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Android.App.Application.Context.ApplicationContext.PackageName, 0).VersionName;
            method.Click += delegate
            {
                FragmentManager.BeginTransaction().Replace(Resource.Id.container_mainlogin, new LoginFrag()).Commit();
            };

            prefs = PreferenceManager.GetDefaultSharedPreferences(Activity);
            string status = prefs.GetString("register_status", "");

            if (status.Contains("yes"))
            {
                //Intent intent = new Intent(Activity, typeof(DetailActivity));
                //StartActivity(intent);
                //Activity.Finish();
            }
            main_method();

            //location_geo = geo.GetGeoLocation(this);
            lice_id       = licenceId.ToString();
            verify.Click += delegate
            {
                if (phonenum.Text == null || phonenum.Text.Length < 10)
                {
                    Toast.MakeText(Activity, "Please enter the phone number correctly", ToastLength.Short).Show();
                }
                else
                {
                    number = phonenum.Text;

                    Send_Number();
                }
            };
            return(view);
        }
Esempio n. 10
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.SetVmPolicy(builder.Build());
            StrictMode.ThreadPolicy.Builder builder1 = new StrictMode.ThreadPolicy.Builder().PermitAll();
            StrictMode.SetThreadPolicy(builder1.Build());

            base.OnCreate(savedInstanceState);

            restService = new ServiceHelper();
            geo         = new Geolocation();
            db          = new DbHelper();
            ic          = new InternetConnection();
            blob        = new BlobFileUpload();

            geolocation = geo.GetGeoLocation(Activity);
            tap         = geolocation.Split(',');
            prefs       = PreferenceManager.GetDefaultSharedPreferences(Activity);
            isRecording = false;
        }
Esempio n. 11
0
        public void CreateTask()
        {
            Boolean connectivity = con.connectivity();

            if (connectivity)
            {
                geolocation = geo.GetGeoLocation(Context);
                CreatetaskService();
            }
            else
            {
                // db.InsertCreateTaskData(taskname, taskdescri, deadline,"mobile",markto,"no",listmapping2);
                Android.App.AlertDialog.Builder alertDiag = new Android.App.AlertDialog.Builder(Activity);
                alertDiag.SetTitle("You don't have Internet connection. Check your connection or Save Task for Later");
                alertDiag.SetMessage("press Ok to continue");
                alertDiag.SetPositiveButton("Save", (senderAlert, args) =>
                {
                    //markingtaskforlaterAsync();
                    db.InsertCreateTaskData(taskname, taskdescri, deadline, "mobile", markto, "unassign", listmapping2, CreateTaskFrag.modelsaddcompliance);
                    Toast.MakeText(Activity, "Task have been saved successfully. To assign Task manually sync the data. ", ToastLength.Long).Show();
                });
                alertDiag.SetNegativeButton("Cancel", (senderAlert, args) =>
                {
                    alertDiag.Dispose();
                });
                Android.App.Dialog diag = alertDiag.Create();
                diag.Show();

                tasknametext.Text    = null;
                taskdescription.Text = null;

                deadlinetext.Text = null;
                markedontext.Text = null;

                designationtext.Text = null;
                nametext.Text        = null;

                Toast.MakeText(Activity, "No Internet Connection. Data has been saved locally.", ToastLength.Long).Show();
            }
        }
Esempio n. 12
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.SetVmPolicy(builder.Build());
            StrictMode.ThreadPolicy.Builder builder1 = new StrictMode.ThreadPolicy.Builder().PermitAll();
            StrictMode.SetThreadPolicy(builder1.Build());
            base.OnCreate(savedInstanceState);
            prefs       = PreferenceManager.GetDefaultSharedPreferences(Activity);
            geo         = new Geolocation();
            ic          = new InternetConnection();
            restService = new ServiceHelper();
            version     = Android.App.Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Android.App.Application.Context.ApplicationContext.PackageName, 0).VersionName;
            geolocation = geo.GetGeoLocation(Activity);
            //if (permissionmethodAsync() == true)
            //{

            //}
            //else
            //{
            //    permissionmethodAsync();
            //}
        }
        public override void OnCreate(Bundle savedInstanceState)
        {
            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.SetVmPolicy(builder.Build());
            StrictMode.ThreadPolicy.Builder builder1 = new StrictMode.ThreadPolicy.Builder().PermitAll();
            StrictMode.SetThreadPolicy(builder1.Build());

            base.OnCreate(savedInstanceState);

            restService = new ServiceHelper();
            geo         = new Geolocation();
            db          = new DbHelper();
            ic          = new InternetConnection();
            //comp_AttachmentModels = new List<Comp_AttachmentModel>();
            blob            = new BlobFileUpload();
            datacomp        = new List <ComplianceModel>();
            taskuploaded    = new List <Comp_AttachmentModel>();
            task_id_to_send = Arguments.GetString("task_id") ?? string.Empty;
            geolocation     = geo.GetGeoLocation(Activity);
            prefs           = PreferenceManager.GetDefaultSharedPreferences(Activity);
            //isRecording = false;
        }
Esempio n. 14
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.SetVmPolicy(builder.Build());
            StrictMode.ThreadPolicy.Builder builder1 = new StrictMode.ThreadPolicy.Builder().PermitAll();
            StrictMode.SetThreadPolicy(builder1.Build());

            base.OnCreate(savedInstanceState);

            restService            = new ServiceHelper();
            geo                    = new Geolocation();
            db                     = new DbHelper();
            ic                     = new InternetConnection();
            initialTasks           = new List <InitialTaskModel>();
            initialtaskservicelist = new List <InitialTaskModel>();
            taskidmodel            = new List <CreateTaskLicenceIdReturnModel>();
            dbtasklist             = new List <InitialTaskModel>();
            blob                   = new BlobFileUpload();
            con                    = new InternetConnection();
            geolocation            = geo.GetGeoLocation(Activity);
            prefs                  = PreferenceManager.GetDefaultSharedPreferences(Activity);
            designationid          = prefs.GetString("DesignationId", "");
            taskidmodel            = CreateTaskFrag.licenceidmodel;
        }
Esempio n. 15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.layout_complaince);
            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.SetVmPolicy(builder.Build());
            StrictMode.ThreadPolicy.Builder builder1 = new StrictMode.ThreadPolicy.Builder().PermitAll();
            StrictMode.SetThreadPolicy(builder1.Build());

            restService           = new ServiceHelper();
            geo                   = new Geolocation();
            db                    = new DbHelper();
            ic                    = new InternetConnection();
            comp_AttachmentModels = new List <Comp_AttachmentModel>();

            geolocation = geo.GetGeoLocation(this);
            prefs       = PreferenceManager.GetDefaultSharedPreferences(this);
            isRecording = false;
            //AudioSavePathInDevice = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + "/AudioRecording.mp3";

            task_id_to_send = Intent.GetStringExtra("task_id") ?? string.Empty;
            //task_description = Intent.GetStringExtra("task_descrip") ?? string.Empty;
            //deadline = Intent.GetStringExtra("deadline") ?? string.Empty;
            //task_name = Intent.GetStringExtra("task_name") ?? string.Empty;
            //markby = Intent.GetStringExtra("mark_by") ?? string.Empty;
            //creationdate = Intent.GetStringExtra("creation_date") ?? string.Empty;
            //taskcreatedby = Intent.GetStringExtra("created_by") ?? string.Empty;
            tap = geolocation.Split(",");

            Description       = FindViewById <EditText>(Resource.Id.comment);
            descrip_text      = FindViewById <TextView>(Resource.Id.c_descrip);
            name_text         = FindViewById <TextView>(Resource.Id.c_name);
            detail_text       = FindViewById <TextView>(Resource.Id.c_detail);
            markby_text       = FindViewById <TextView>(Resource.Id.c_markby);
            deadline_text     = FindViewById <TextView>(Resource.Id.c_deadline);
            createdby_text    = FindViewById <TextView>(Resource.Id.c_createdby);
            creationdate_text = FindViewById <TextView>(Resource.Id.c_creationdate);
            camera            = FindViewById <ImageButton>(Resource.Id.camera_btn);
            video             = FindViewById <ImageButton>(Resource.Id.video_btn);
            microphone        = FindViewById <ImageButton>(Resource.Id.micro_btn);
            //holder = FindViewById<ImageButton>(Resource.Id.location_btn);
            linear1       = FindViewById <LinearLayout>(Resource.Id.ll1);
            linear2       = FindViewById <LinearLayout>(Resource.Id.ll2);
            linear3       = FindViewById <LinearLayout>(Resource.Id.ll3);
            Image_no      = FindViewById <TextView>(Resource.Id.image_no);
            Video_no      = FindViewById <TextView>(Resource.Id.video_no);
            Audio_no      = FindViewById <TextView>(Resource.Id.audio_no);
            comment_micro = FindViewById <ImageView>(Resource.Id.comment_micro);
            Submit_Btn    = FindViewById <Button>(Resource.Id.submit);
            Gridview1     = FindViewById <ExpandableHeightGridView>(Resource.Id.gridView1);
            Gridview2     = FindViewById <ExpandableHeightGridView>(Resource.Id.gridView2);
            Gridview3     = FindViewById <ExpandableHeightGridView>(Resource.Id.gridView3);

            getData();
            camera.Click += delegate
            {
                Click_Type = "Camera";
                CheckForShapeData_Camera();
            };

            video.Click += delegate
            {
                Click_Type = "Video";
                CheckForShapeData_Video();
            };

            microphone.Click += delegate
            {
                if (audioCount == audio_max)
                {
                    Toast.MakeText(this, "Reached Maximum Point", ToastLength.Long).Show();
                }
                else
                {
                    recording();
                }
            };

            Submit_Btn.Click += delegate
            {
                Submit_Method();
            };
            comment_micro.Click += delegate
            {
                CheckMicrophone();
            };
            // Create your application here
        }
Esempio n. 16
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = View;

            view        = inflater.Inflate(Resource.Layout.marking, container, false);
            restService = new ServiceHelper();
            con         = new InternetConnection();
            geo         = new Geolocation();
            db          = new DbHelper();
            prefs       = PreferenceManager.GetDefaultSharedPreferences(Activity);


            list   = view.FindViewById <ListView>(Resource.Id.listView1);
            audio  = view.FindViewById <ImageView>(Resource.Id.imageView1);
            search = view.FindViewById <SearchView>(Resource.Id.searchview);


            search.QueryTextChange += sv_QueryTextChange;
            location = geo.GetGeoLocation(Context);

            markinglist = new List <MarkingListModel>();

            list.ItemClick += ListItemSelected;
            Boolean connectivity = con.connectivity();

            if (connectivity)
            {
                getData();
            }
            else
            {
                markinglist = db.GetMarkingList();
                if (markinglist.Count != 0)
                {
                    marked = new MarkingListAdapter(Activity, markinglist);
                    list.SetAdapter(marked);
                }
                else
                {
                    Toast.MakeText(Activity, "Couldn't find data for marking. Please connect to the internet", ToastLength.Long).Show();
                }
            }

            string rec = Android.Content.PM.PackageManager.FeatureMicrophone;

            if (rec != "android.hardware.microphone")
            {
                // no microphone, no recording. Disable the button and output an alert
                var alert = new Android.App.AlertDialog.Builder(audio.Context);
                alert.SetTitle("You don't seem to have a microphone to record with");
                alert.SetPositiveButton("OK", (sender, e) =>
                {
                    //task_name.Text = "No microphone present";
                    audio.Enabled = false;

                    return;
                });

                alert.Show();
            }
            else
            {
                audio.Click += delegate
                {
                    // change the text on the button

                    isRecording = !isRecording;
                    if (isRecording)
                    {
                        // create the intent and start the activity
                        var voiceIntent = new Intent(RecognizerIntent.ActionRecognizeSpeech);
                        voiceIntent.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelFreeForm);

                        // put a message on the modal dialog
                        voiceIntent.PutExtra(RecognizerIntent.ExtraPrompt, Android.App.Application.Context.GetString(Resource.String.messageSpeakNow));

                        // if there is more then 1.5s of silence, consider the speech over
                        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputCompleteSilenceLengthMillis, 1500);
                        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputPossiblyCompleteSilenceLengthMillis, 1500);
                        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputMinimumLengthMillis, 15000);
                        voiceIntent.PutExtra(RecognizerIntent.ExtraMaxResults, 1);

                        // you can specify other languages recognised here, for example
                        // voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.German);
                        // if you wish it to recognise the default Locale language and German
                        // if you do use another locale, regional dialects may not be recognised very well

                        voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.Default);
                        StartActivityForResult(voiceIntent, VOICE);
                    }
                };
            }
            return(view);
        }
Esempio n. 17
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // GetPermissionAsync();

            isRecording = false;
            SetContentView(Resource.Layout.compaliance_layout);
            restService          = new ServiceHelper();
            dbHelper             = new DbHelper();
            con                  = new InternetConnection();
            geo                  = new Geolocation();
            geolocation          = geo.GetGeoLocation(ApplicationContext);
            compliance           = new Compliance();
            complianceJoinTables = new List <ComplianceJoinTable>();
            comp                 = new Compliance();
            tap                  = geolocation.Split(",");
            // tap = "26.449923,80.331871".Split(",");
            getData();
            ComplianceJoinTable comjoin = new ComplianceJoinTable();

            prefs1 = PreferenceManager.GetDefaultSharedPreferences(this);

            //  checkbox1 = prefs1.GetBoolean("checkboxvalue", true);
            // string position = Intent.GetStringExtra("Position")?? "Data not available...";
            // PostServiceComplianceAsync();
            camera      = FindViewById <ImageButton>(Resource.Id.imageButton1);
            videobutton = FindViewById <ImageButton>(Resource.Id.imageButton2);
            location    = FindViewById <ImageButton>(Resource.Id.imageButton4);
            mike        = FindViewById <ImageButton>(Resource.Id.imageButton3);
            //mikestop = FindViewById<ImageButton>(Resource.Id.imageButton5);
            //mikeplay = FindViewById<ImageButton>(Resource.Id.mikeplay);
            imagecaptured   = FindViewById <ImageView>(Resource.Id.imageView1);
            description     = FindViewById <EditText>(Resource.Id.ed2);
            taskdescription = FindViewById <TextView>(Resource.Id.taskdescription);
            taskname        = FindViewById <TextView>(Resource.Id.taskName);
            taskdetail      = FindViewById <TextView>(Resource.Id.taskDetail);
            deadlinedate    = FindViewById <TextView>(Resource.Id.deadlineDate);
            createdBy       = FindViewById <TextView>(Resource.Id.createdBy);
            creation_date   = FindViewById <TextView>(Resource.Id.creationDate);
            //imagelayout = FindViewById<LinearLayout>(Resource.Id.linearlayout1);
            rl1 = FindViewById <LinearLayout>(Resource.Id.rl1);
            rl2 = FindViewById <LinearLayout>(Resource.Id.rl2);
            rl3 = FindViewById <LinearLayout>(Resource.Id.rl3);
            rl4 = FindViewById <LinearLayout>(Resource.Id.rl4);
            //   getData();
            // taskname.Text = comp.task_name.ToString();
            taskdescription.Text = comp.description;
            createdBy.Text       = comp.task_created_by;
            creation_date.Text   = comp.task_creation_date;
            //markedto.Text = comp.markTo;
            creation_date.Text = comp.task_creation_date;
            submit             = FindViewById <Button>(Resource.Id.buttonSubmit);
            // taskname=

            submit.Click += SubmitCompliance;

            // seekbar = FindViewById<SeekBar>(Resource.Id.seekbar);
            //mike.Click += delegate
            //{
            //    audioplay();
            //};

            location.Click += delegate
            {
                if (shapes1.shapes[0].type == "polygon")
                {
                    polygon();
                }
                else if (shapes1.shapes[0].type == "circle")
                {
                    isMarkerOutsideCircle();
                    if (isMarkerOutsideCircle() == true)
                    {
                        Toast.MakeText(this, "Latitude-Longitude is inside the circle", ToastLength.Long).Show();
                    }
                    else
                    {
                        Toast.MakeText(this, "Latitude-Longitude is outside the circle", ToastLength.Long).Show();
                    }
                }
                else
                {
                    // map marked
                }
                //var geoUri = Android.Net.Uri.Parse("geo:26.8467,80.9462");
                //var mapIntent = new Intent(Intent.ActionView, geoUri);
                //StartActivity(mapIntent);
            };

            //if (imagelayout != null)
            //{
            //    imagelayout.RemoveView(i);
            //}

            //mike.Click += RecordAudio;
            string path = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + "/test.mp4";

            camera.Click      += BtnCamera_Click;
            videobutton.Click += VideoClick;
        }
Esempio n. 18
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.create_ref_layout, null);

            db             = new DbHelper();
            geo            = new Geolocation();
            geolocation    = geo.GetGeoLocation(Activity);
            HasOptionsMenu = true;
            isRecording    = false;
            prefs          = PreferenceManager.GetDefaultSharedPreferences(Activity);
            licenceId      = prefs.GetString("LicenceId", "");
            tempId         = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + licenceId;
            camera         = view.FindViewById <ImageButton>(Resource.Id.camera_btn);
            video          = view.FindViewById <ImageButton>(Resource.Id.video_btn);
            microphone     = view.FindViewById <ImageButton>(Resource.Id.micro_btn);
            Gridview_1     = view.FindViewById <ExpandableHeightGridView>(Resource.Id.grid);
            Grid_attach    = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridattachment);
            Gridview_2     = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView2);
            Gridview_3     = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView3);
            attachment_btn = view.FindViewById <ImageButton>(Resource.Id.attachment);
            // Gridview_1 = view.FindViewById<ExpandableHeightGridView>(Resource.Id.gridView1);
            //Grid_attach = view.FindViewById<ExpandableHeightGridView>(Resource.Id.gridattachment);
            //Gridview_2 = view.FindViewById<ExpandableHeightGridView>(Resource.Id.gridView2);
            //Gridview_3 = view.FindViewById<ExpandableHeightGridView>(Resource.Id.gridView3);
            //title = view.FindViewById<ImageView>(Resource.Id.imageView1);
            //   listmapping = new List<TaskFileMapping_Model>();
            desc = view.FindViewById <ImageView>(Resource.Id.imageView3);

            if (image_list.Count > 0)
            {
                adapter_1          = new GridImageAdapterCreatetask(Activity, image_list);
                Gridview_1.Adapter = adapter_1;
                Gridview_1.setExpanded(true);
                Gridview_1.ChoiceMode = (ChoiceMode)AbsListViewChoiceMode.MultipleModal;
                Gridview_1.SetMultiChoiceModeListener(new MultiChoiceModeListener1(Activity));
            }
            if (video_list.Count > 0)
            {
                adapter_2          = new GridVideoAdapterCreateTask(Activity, video_list);
                Gridview_2.Adapter = adapter_2;
                Gridview_2.setExpanded(true);
                Gridview_2.ChoiceMode = (ChoiceMode)AbsListViewChoiceMode.MultipleModal;
                Gridview_2.SetMultiChoiceModeListener(new MultiChoiceModeListener2(Activity));
            }
            if (audio_list.Count > 0)
            {
                adapter_3          = new GridAudioCreateTask(Activity, audio_list);
                Gridview_3.Adapter = adapter_3;
                Gridview_3.setExpanded(true);
                Gridview_3.ChoiceMode = (ChoiceMode)AbsListViewChoiceMode.MultipleModal;
                Gridview_3.SetMultiChoiceModeListener(new MultiChoiceModeListener3(Activity));
            }
            if (listmapping.Count > 0)
            {
                forCreate           = new GridAttachmentForCreate(Activity, listmapping);
                Grid_attach.Adapter = forCreate;
                Grid_attach.setExpanded(true);
            }
            attachment_btn.Click += delegate
            {
                attachmentClick();
            };
            camera.Click += delegate
            {
                BtnCamera_Click();
            };

            video.Click += delegate
            {
                VideoClick();
            };
            microphone.Click += delegate
            {
                recording();
            };
            string rec = Android.Content.PM.PackageManager.FeatureMicrophone;

            if (rec != "android.hardware.microphone")
            {
                // no microphone, no recording. Disable the button and output an alert
                var alert = new Android.App.AlertDialog.Builder(title.Context);
                alert.SetTitle("You don't seem to have a microphone to record with");
                alert.SetPositiveButton("OK", (sender, e) =>
                {
                    task_name.Text    = "No microphone present";
                    title.Enabled     = false;
                    task_comment.Text = "No microphone present";
                    desc.Enabled      = false;
                    return;
                });

                alert.Show();
            }
            else
            {
                //title.Click += delegate
                //{
                //    // change the text on the button

                //    isRecording = !isRecording;
                //    if (isRecording)
                //    {
                //        // create the intent and start the activity
                //        var voiceIntent = new Intent(RecognizerIntent.ActionRecognizeSpeech);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelFreeForm);

                //        // put a message on the modal dialog
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraPrompt, Android.App.Application.Context.GetString(Resource.String.messageSpeakNow));

                //        // if there is more then 1.5s of silence, consider the speech over
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputCompleteSilenceLengthMillis, 1500);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputPossiblyCompleteSilenceLengthMillis, 1500);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputMinimumLengthMillis, 15000);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraMaxResults, 1);


                //        voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.Default);
                //        StartActivityForResult(voiceIntent, VOICE);
                //    }
                //  };
                //desc.Click += delegate
                //{
                //    isRecording = !isRecording;
                //    if (isRecording)
                //    {
                //        // create the intent and start the activity
                //        var voiceIntent = new Intent(RecognizerIntent.ActionRecognizeSpeech);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelFreeForm);

                //        // put a message on the modal dialog
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraPrompt, Android.App.Application.Context.GetString(Resource.String.messageSpeakNow));

                //        // if there is more then 1.5s of silence, consider the speech over
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputCompleteSilenceLengthMillis, 1500);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputPossiblyCompleteSilenceLengthMillis, 1500);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputMinimumLengthMillis, 15000);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraMaxResults, 1);

                //        // you can specify other languages recognised here, for example
                //        // voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.German);
                //        // if you wish it to recognise the default Locale language and German
                //        // if you do use another locale, regional dialects may not be recognised very well

                //        voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.Default);
                //        StartActivityForResult(voiceIntent, DESC);
                //    }
                //};
            }
            return(view);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            rootView = inflater.Inflate(Resource.Layout.gstn_verification, container, false);

            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.SetVmPolicy(builder.Build());
            StrictMode.ThreadPolicy.Builder builder1 = new StrictMode.ThreadPolicy.Builder().PermitAll();
            StrictMode.SetThreadPolicy(builder1.Build());


            con = new InternetConnection();

            searchGST            = (TextInputEditText)rootView.FindViewById(Resource.Id.searchGSTN);
            gstnProgress         = (ProgressBar)rootView.FindViewById(Resource.Id.progressGST);
            tradeName1           = (TextView)rootView.FindViewById(Resource.Id.tradeName);
            gstnIdText1          = (TextView)rootView.FindViewById(Resource.Id.gstnId);
            regDate1             = (TextView)rootView.FindViewById(Resource.Id.regDate);
            mobileNumber1        = (TextView)rootView.FindViewById(Resource.Id.mobileNumberVer);
            linear1              = (LinearLayout)rootView.FindViewById(Resource.Id.linearQuestion1);
            linear2              = (LinearLayout)rootView.FindViewById(Resource.Id.linearQuestion2);
            linear3              = (LinearLayout)rootView.FindViewById(Resource.Id.linearQuestion3);
            gridLayout           = (LinearLayout)rootView.FindViewById(Resource.Id.gridVer);
            submitDataVer        = (Button)rootView.FindViewById(Resource.Id.submitVerification);
            cameraVer            = (ImageButton)rootView.FindViewById(Resource.Id.cameraVer);
            gridViewVer          = (GridView)rootView.FindViewById(Resource.Id.gridViewVer);
            checkValidate        = (CheckBox)rootView.FindViewById(Resource.Id.checkVerification);
            rg1                  = (RadioGroup)rootView.FindViewById(Resource.Id.myRadioGroup1);
            rg2                  = (RadioGroup)rootView.FindViewById(Resource.Id.myRadioGroup2);
            rg3                  = (RadioGroup)rootView.FindViewById(Resource.Id.myRadioGroup3);
            rg4                  = (LinearLayout)rootView.FindViewById(Resource.Id.myRadioGroup4);
            Yes1                 = (RadioButton)rootView.FindViewById(Resource.Id.yes1);
            Yes2                 = (RadioButton)rootView.FindViewById(Resource.Id.yes2);
            Yes3                 = (RadioButton)rootView.FindViewById(Resource.Id.yes3);
            No1                  = (RadioButton)rootView.FindViewById(Resource.Id.no1);
            No2                  = (RadioButton)rootView.FindViewById(Resource.Id.no2);
            No3                  = (RadioButton)rootView.FindViewById(Resource.Id.no3);
            Manufacturer         = (CheckBox)rootView.FindViewById(Resource.Id.manufacturer);
            Trader               = (CheckBox)rootView.FindViewById(Resource.Id.trader);
            ServiceDealer        = (CheckBox)rootView.FindViewById(Resource.Id.serviceDealer);
            turnoverText         = (TextInputEditText)rootView.FindViewById(Resource.Id.turnOver);
            otherText            = (TextInputEditText)rootView.FindViewById(Resource.Id.otherText1);
            areaBusiness         = (TextInputEditText)rootView.FindViewById(Resource.Id.area1);
            businessSelectButton = (Button)rootView.FindViewById(Resource.Id.mySelection);

            grid_adapter        = new GridAdapter(Activity, Utilities.imageList);
            gridViewVer.Adapter = grid_adapter;

            tradeName1.Visibility  = ViewStates.Gone;
            gstnIdText1.Visibility = ViewStates.Gone;
            regDate1.Visibility    = ViewStates.Gone;

            mobileNumber1.Visibility = ViewStates.Gone;

            gridLayout.Visibility = ViewStates.Gone;

            submitDataVer.Visibility = ViewStates.Gone;

            cameraVer.Visibility     = ViewStates.Gone;
            gridViewVer.Visibility   = ViewStates.Gone;
            checkValidate.Visibility = ViewStates.Gone;

            linear1.Visibility = ViewStates.Gone;
            linear2.Visibility = ViewStates.Gone;
            linear3.Visibility = ViewStates.Gone;

            otherText.Visibility            = ViewStates.Gone;
            areaBusiness.Visibility         = ViewStates.Gone;
            turnoverText.Visibility         = ViewStates.Gone;
            rg4.Visibility                  = ViewStates.Gone;
            businessSelectButton.Visibility = ViewStates.Gone;


            Yes1.Click += RadioButtonClick;
            No1.Click  += RadioButtonClick;
            Yes2.Click += RadioButtonClick;
            No2.Click  += RadioButtonClick;
            Yes3.Click += RadioButtonClick;
            No3.Click  += RadioButtonClick;

            businessSelectButton.Click += delegate
            {
                try
                {
                    Intent i = new Intent(Activity, typeof(BusinessTypeFragment));
                    Activity.StartActivity(i);

                    //FragmentTransaction ft = FragmentManager.BeginTransaction();
                    //BusinessTypeFragment f4 = new BusinessTypeFragment();
                    //ft.Replace(Resource.Id.container, f4);
                    //ft.AddToBackStack("BusinessTypeFragment");
                    //ft.Commit();
                    // FragmentManager.BeginTransaction().Add(Resource.Id.container, new BusinessTypeFragment()).Commit();
                }catch (Exception ex)
                {
                }
            };



            mobileNumber1.Click += delegate
            {
                AlertDialog.Builder alertDiag = new AlertDialog.Builder(Activity);
                alertDiag.SetTitle("Call Dialog");
                alertDiag.SetMessage("Do you want to call?");
                alertDiag.SetPositiveButton("Call", (senderAlert, args) => {
                    try
                    {
                        var uri    = Android.Net.Uri.Parse("tel:" + phoneNumber);
                        var intent = new Intent(Intent.ActionDial, uri);
                        StartActivity(intent);
                    }catch (Exception e)
                    {
                    }
                });
                alertDiag.SetNegativeButton("Cancel", (senderAlert, args) => {
                    alertDiag.Dispose();
                });
                Android.App.Dialog diag = alertDiag.Create();
                diag.Show();
            };

            cameraVer.Click += delegate
            {
                CameraPic();
            };

            searchGST.TextChanged += delegate
            {
                if (searchGST.Text.ToString().Length >= 15)
                {
                    string searchText = searchGST.Text.ToString();
                    if (con.connectivity())
                    {
                        GSTNSearch(searchText).Wait();
                    }
                    else
                    {
                        Toast.MakeText(Activity, "Please connect to Internet.", ToastLength.Long).Show();
                    }
                }
                else
                {
                    tradeName1.Visibility    = ViewStates.Gone;
                    gstnIdText1.Visibility   = ViewStates.Gone;
                    regDate1.Visibility      = ViewStates.Gone;
                    mobileNumber1.Visibility = ViewStates.Gone;

                    gridLayout.Visibility    = ViewStates.Gone;
                    checkValidate.Visibility = ViewStates.Gone;
                    submitDataVer.Visibility = ViewStates.Gone;

                    cameraVer.Visibility   = ViewStates.Gone;
                    gridViewVer.Visibility = ViewStates.Gone;
                    linear1.Visibility     = ViewStates.Gone;
                    linear2.Visibility     = ViewStates.Gone;
                    linear3.Visibility     = ViewStates.Gone;

                    otherText.Visibility            = ViewStates.Gone;
                    areaBusiness.Visibility         = ViewStates.Gone;
                    turnoverText.Visibility         = ViewStates.Gone;
                    rg4.Visibility                  = ViewStates.Gone;
                    businessSelectButton.Visibility = ViewStates.Gone;
                }
            };

            submitDataVer.Click += delegate {
                other        = otherText.Text.ToString();
                premisesArea = areaBusiness.Text.ToString();
                if (checkValidate.Selected)
                {
                    compoundingEligible = "Yes";
                }
                else
                {
                    compoundingEligible = "No";
                }

                //if (Manufacturer.Selected)
                //{
                //    manuf = "Manufacturer";
                //}
                //if (Trader.Selected)
                //{
                //    trad = "Trader";
                //}
                //if (ServiceDealer.Selected)
                //{
                //    dealer = "Service Dealer";
                //}

                turnOver = turnoverText.Text.ToString();
                //if (!manuf.Equals(""))
                //{
                //    if (!combine.Equals(""))
                //    {
                //        combine += "," + manuf;
                //    }
                //    else
                //    {
                //        combine += manuf;
                //    }
                //}
                //if (!trad.Equals(""))
                //{
                //    if (!combine.Equals(""))
                //    {
                //        combine += "," + trad;
                //    }
                //    else
                //    {
                //        combine += trad;
                //    }
                //}
                //if (!dealer.Equals(""))
                //{
                //    if (!combine.Equals(""))
                //    {
                //        combine += "," + dealer;
                //    }
                //    else
                //    {
                //        combine += dealer;
                //    }
                //}
                try
                {
                    combine = string.Join(",", Utilities.GlobalBusinessList);
                }catch (Exception ex)
                {
                    combine = "";
                }


                if (address.Equals(""))
                {
                    Toast.MakeText(Activity, "Please Select Address Status", ToastLength.Short).Show();
                    return;
                }
                if (businessStatus.Equals(""))
                {
                    Toast.MakeText(Activity, "Please Select Business Status", ToastLength.Short).Show();
                    return;
                }

                if (registration.Equals(""))
                {
                    Toast.MakeText(Activity, "Please Select Registration Status", ToastLength.Short).Show();
                    return;
                }

                if (Utilities.imageList.Count < 1)
                {
                    Toast.MakeText(Activity, "Please Capture Atleast One Photograph.", ToastLength.Short).Show();
                    return;
                }


                if (con.connectivity())
                {
                    submitDataVer.Enabled = false;
                    try
                    {
                        sendToServer();
                    }catch (Exception ex)
                    {
                        Toast.MakeText(Activity, "Something went wrong. Please try after sometime.", ToastLength.Long).Show();

                        PackageManager manager = Activity.PackageManager;
                        PackageInfo    info    = manager.GetPackageInfo(Activity.PackageName, 0);
                        info.VersionName.ToString();
                        int i = dba.insertGSTINData(geo.GetGeoLocation(Activity), GSTIN, "", DateTime.Now.ToString("yyyy-MM-dd"),
                                                    address, businessStatus, registration, other, compoundingEligible, premisesArea,
                                                    combine, turnOver, info.VersionName.ToString(), "no");

                        for (int j = 0; j < Utilities.imageList.Count; j++)
                        {
                            dba.insertImageDetail(i, Utilities.imageList[j].ImagePath, geo.GetGeoLocation(Activity));
                        }
                    }
                }
                else
                {
                    submitDataVer.Enabled = false;
                    PackageManager manager = Activity.PackageManager;
                    PackageInfo    info    = manager.GetPackageInfo(Activity.PackageName, 0);
                    info.VersionName.ToString();
                    int i = dba.insertGSTINData(geo.GetGeoLocation(Activity), GSTIN, "", DateTime.Now.ToString("yyyy-MM-dd"),
                                                address, businessStatus, registration, other, compoundingEligible, premisesArea,
                                                combine, turnOver, info.VersionName.ToString(), "no");

                    for (int j = 0; j < Utilities.imageList.Count; j++)
                    {
                        dba.insertImageDetail(i, Utilities.imageList[j].ImagePath, geo.GetGeoLocation(Activity));
                    }
                    Toast.MakeText(Activity, "Data Saved in Database.", ToastLength.Long).Show();

                    combine = "";
                    GSTIN   = "";
                    rg1.ClearCheck();
                    address = "";
                    rg2.ClearCheck();
                    businessStatus = "";
                    rg3.ClearCheck();
                    registration          = "";
                    other                 = "";
                    otherText.Text        = "";
                    checkValidate.Checked = false;
                    compoundingEligible   = "";
                    premisesArea          = "";
                    areaBusiness.Text     = "";
                    turnoverText.Text     = "";
                    Utilities.imageList.Clear();
                    turnOver              = "";
                    Manufacturer.Checked  = false;
                    Trader.Checked        = false;
                    ServiceDealer.Checked = false;
                    submitDataVer.Enabled = true;
                    manuf  = "";
                    trad   = "";
                    dealer = "";
                    grid_adapter.NotifyDataSetChanged();
                    Utilities.GlobalBusinessList.Clear();
                }
            };

            return(rootView);
        }
Esempio n. 20
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);


            prefs       = PreferenceManager.GetDefaultSharedPreferences(ApplicationContext);
            db          = new DbHelper();
            geo         = new Geolocation();
            restService = new ServiceHelper();
            ic          = new InternetConnection();
            login_data  = new List <LoginModel>();

            version = Android.App.Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Android.App.Application.Context.ApplicationContext.PackageName, 0).VersionName;
            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);
            List <LoginModel> loginModel = db.getDetail();

            if (loginModel.Count <= 1)
            {
                IMenu nav_Menu = navigationView.Menu;
                nav_Menu.FindItem(Resource.Id.switchuser).SetVisible(false);
            }

            location = geo.GetGeoLocation(this);
            SupportFragmentManager.BeginTransaction().Replace(Resource.Id.container, new MainFrag(), "MainFrag").Commit();

            ManualSyncData();

            View   header   = navigationView.GetHeaderView(0);
            string userName = prefs.GetString("UserName", "");
            string number   = prefs.GetString("MobileNumber", "");
            string propic   = prefs.GetString("NPPhoto", "");
            string org      = prefs.GetString("Organization", "");
            string desig    = prefs.GetString("Designation", "");

            identity = prefs.GetString("LoginIdentity", "");

            TextView  name1   = (TextView)header.FindViewById(Resource.Id.user);
            TextView  mobile1 = (TextView)header.FindViewById(Resource.Id.number);
            ImageView image   = (ImageView)header.FindViewById(Resource.Id.propic);
            TextView  desig1  = (TextView)header.FindViewById(Resource.Id.desig);
            TextView  org1    = (TextView)header.FindViewById(Resource.Id.org);

            name1.Text   = userName;
            mobile1.Text = number;
            desig1.Text  = desig;
            org1.Text    = org;

            if (propic != "" && propic != null)
            {
                Glide.With(this).Load(propic).Into(image);
            }
        }
Esempio n. 21
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.FilterByDate_Layout);

            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            im_model = new RecyclerAdapter <TaskInboxModel>();
            StrictMode.SetVmPolicy(builder.Build());
            StrictMode.ThreadPolicy.Builder builder1 = new StrictMode.ThreadPolicy.Builder().PermitAll();
            StrictMode.SetThreadPolicy(builder1.Build());

            FromDate = FindViewById <TextInputEditText>(Resource.Id.fromdate);
            ToDate   = FindViewById <TextInputEditText>(Resource.Id.todate);
            Submit   = FindViewById <Button>(Resource.Id.submit);
            spinner  = FindViewById <Spinner>(Resource.Id.orgspinner);

            geo            = new Geolocation();
            restservice    = new ServiceHelper();
            location       = geo.GetGeoLocation(this);
            orgmodel       = new List <OrgModel>();
            orgname        = new List <OrgModel>();
            markinglist    = new List <MarkingListModel>();
            addmarkinglist = new List <MarkingListModel>();

            getOrgData();

            // spinner.ItemSelected += Selectorg_ItemSelected;

            //var adapter = ArrayAdapter.CreateFromResource(this, Resource.Array.organization_array, Android.Resource.Layout.SimpleSpinnerItem);
            //adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            //spinner.Adapter = adapter;


            designationSpinner = FindViewById <Spinner>(Resource.Id.desigspinner);

            // designationSpinner.ItemSelected += spinner_ItemSelected1;

            //spinner1.ItemSelected += Selectorg_ItemSelected;

            // var adapter1 = ArrayAdapter.CreateFromResource(this, Resource.Array.designation_array, Android.Resource.Layout.SimpleSpinnerItem);
            //  adapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            //  designationSpinner.Adapter = adapter1;

            FromDate.Click += (sender, e) =>
            {
                DateTime         today  = DateTime.Today;
                DatePickerDialog dialog = new DatePickerDialog(this, OnDateSetFrom, today.Year, today.Month - 1, today.Day);

                dialog.DatePicker.MinDate = today.Millisecond;
                dialog.Show();
            };

            ToDate.Click += (sender, e) =>
            {
                DateTime         today  = DateTime.Today;
                DatePickerDialog dialog = new DatePickerDialog(this, OnDateSetTo, today.Year, today.Month - 1, today.Day);

                dialog.DatePicker.MinDate = today.Millisecond;
                dialog.Show();
            };

            Submit.Click += delegate
            {
                Finish();
            };
        }