Ejemplo n.º 1
0
        public async Task getData()
        {
            progress = new Android.App.ProgressDialog(Activity);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait...");
            progress.Show();

            dynamic value = new ExpandoObject();

            value.DesignationId = desig_Id;

            string json = JsonConvert.SerializeObject(value);

            try
            {
                JsonValue item = await restService.FrequentList(Activity, json, geolocation).ConfigureAwait(false);

                freq = JsonConvert.DeserializeObject <List <FrequentList> >(item);

                db.InsertFrequentList(freq);
                if (freq.Count > 0)
                {
                    adapter = new FrequentAdapter(Activity, freq);
                }
                gv.Adapter = adapter;
                progress.Dismiss();
            }
            catch (Exception ex)
            {
                progress.Dismiss();
            }
            progress.Dismiss();
        }
Ejemplo n.º 2
0
        //public bool permissionmethodAsync()
        //{

        //    GetPermissionAsync();
        //    return true;
        //}
        //private async Task GetPermissionAsync()
        //{
        //    List<String> permissions = new List<String>();
        //    try
        //    {

        //        if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.AccessFineLocation) == Permission.Denied)
        //        {
        //            permissions.Add(Manifest.Permission.AccessFineLocation);
        //        }
        //        if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.RecordAudio) == Permission.Denied)
        //        {
        //            permissions.Add(Manifest.Permission.RecordAudio);
        //        }
        //        if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.AccessCoarseLocation) == Permission.Denied)
        //        {
        //            permissions.Add(Manifest.Permission.AccessCoarseLocation);
        //        }

        //        if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.Camera) == Permission.Denied)
        //        {
        //            permissions.Add(Manifest.Permission.Camera);
        //        }

        //        if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.ReadExternalStorage) == Permission.Denied)
        //        {
        //            permissions.Add(Manifest.Permission.ReadExternalStorage);
        //        }

        //        if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.WriteExternalStorage) == Permission.Denied)
        //        {
        //            permissions.Add(Manifest.Permission.WriteExternalStorage);
        //        }

        //        if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.CallPhone) == Permission.Denied)
        //        {
        //            permissions.Add(Manifest.Permission.CallPhone);
        //        }

        //        if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.ReadPhoneState) == Permission.Denied)
        //        {
        //            permissions.Add(Manifest.Permission.ReadPhoneState);
        //        }



        //        if (permissions.Count > 0)
        //        {
        //            ActivityCompat.RequestPermissions(Activity, permissions.ToArray(), 100);
        //        }
        //        if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.AccessFineLocation) == Permission.Granted)
        //        {
        //            geo = new Geolocation();
        //        }
        //    }
        //    catch (Exception e)
        //    {
        //        System.Console.WriteLine("Error", e.Message);
        //    }

        //}

        public async Task GetLogin()
        {
            Boolean result = ic.connectivity();

            if (result)
            {
                progress = new Android.App.ProgressDialog(Activity);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetCancelable(false);
                progress.SetMessage("Please wait...");
                progress.Show();
                JsonValue login_value = null;
                try
                {
                    login_value = await nextActivity("", "");
                }
                catch (Exception e)
                {
                }
                if (login_value != null)
                {
                    await ParseAndDisplay(login_value, "");
                }
            }
        }
Ejemplo n.º 3
0
 public void LoadingShow()
 {
     progress = new Android.App.ProgressDialog(Forms.Context);
     progress.Indeterminate = true;
     progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
     progress.SetMessage("Carregando, por favor aguarde...");
     progress.SetCancelable(false);
     progress.Show();
 }
Ejemplo n.º 4
0
 private void ShowProgressDialog()
 {
     progress = new Android.App.ProgressDialog(this.Context);
     progress.Indeterminate = true;
     progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
     progress.SetMessage("Please wait...");
     progress.SetCancelable(false);
     progress.Show();
 }
Ejemplo n.º 5
0
            public TaskInBackground(Context context, string path)
            {
                this.context = context;
                this.path    = path;

                progress = new Android.App.ProgressDialog(context);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetCancelable(false);
                progress.SetMessage("Please wait...");
            }
Ejemplo n.º 6
0
        public async void Validate()
        {
            var errorMsg = "";

            if (user.Text.Length == 0 && pass.Text.Length == 0)
            {
                if (user.Text.Length == 0 || pass.Text.Length == 0)
                {
                    errorMsg = "Please enter User Name ";
                }
                if (pass.Text.Length == 0 || pass.Text.Length == 0)
                {
                    errorMsg = errorMsg + "Please enter Password";
                }

                Toast.MakeText(Activity, errorMsg, ToastLength.Long).Show();
                return;
            }
            else
            {
                Boolean result = ic.connectivity();
                if (result)
                {
                    progress = new Android.App.ProgressDialog(Activity);
                    progress.Indeterminate = true;
                    progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                    progress.SetCancelable(false);
                    progress.SetMessage("Please wait...");
                    progress.Show();
                    JsonValue login_value = null;
                    try
                    {
                        login_value = await nextActivity(user.Text, pass.Text);
                    }
                    catch (Exception e)
                    {
                    }
                    if (login_value != null)
                    {
                        await ParseAndDisplay(login_value, user.Text);
                    }

                    //  loginId1 = user.Text;
                    // password1 = pass.Text;
                }
                else
                {
                    Toast.MakeText(Activity, "No Internet", ToastLength.Long).Show();
                }
            }
        }
Ejemplo n.º 7
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            progress = new Android.App.ProgressDialog(Activity);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait..");

            ISharedPreferences pref = Android.App.Application.Context.GetSharedPreferences("AboutUsInfo", FileCreationMode.Private);

            about_us = pref.GetString("content", String.Empty);
        }
Ejemplo n.º 8
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            progress = new Android.App.ProgressDialog(Activity);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait...");

            pref = Android.App.Application.Context.GetSharedPreferences("BookMarkInfo", FileCreationMode.Private);

            BookMarkDetails = pref.GetString("FinalBookMark", "false");

            dba = new DBHelper();
        }
Ejemplo n.º 9
0
        public async Task Send_Number()
        {
            if (ic.connectivity())
            {
                progress = new Android.App.ProgressDialog(Activity);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetCancelable(false);
                progress.SetMessage("Please wait...");
                progress.Show();

                OTPModel otp_data = new OTPModel();
                otp_data.MobileNo = number;
                otp_data.SMS      = "OTP";
                string otp_json = JsonConvert.SerializeObject(otp_data);
                try
                {
                    string item = await restService.GetOtp(Activity, licenceid, geolocation, version, otp_json);

                    if (item.Contains("Authentication Failed"))
                    {
                        progress.Dismiss();
                        AlertBox();
                    }
                    else
                    {
                        var primeArray = item.Split(',');
                        otp      = primeArray[0];
                        otp      = otp.Substring(1);
                        username = primeArray[1];
                        progress.Dismiss();
                        verification();
                    }
                }
                catch (Exception e)
                {
                    progress.Dismiss();
                }
            }
            else
            {
                progress.Dismiss();
            }
        }
Ejemplo 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);

            progress = new Android.App.ProgressDialog(Activity);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please Wait...");

            pref = Android.App.Application.Context.GetSharedPreferences("AboutExamInfo", FileCreationMode.Private);

            Abour_Exam = pref.GetString("FinalAboutExam", "false");

            dba = new DBHelper();
        }
        public async Task getorglist(string org_id)
        {
            progress = new Android.App.ProgressDialog(Activity);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait...");
            progress.Show();

            dynamic value = new ExpandoObject();

            value.OrgId = org_id;

            string json = JsonConvert.SerializeObject(value);

            try
            {
                string item = await restservice.MarkingList(Activity, json, location).ConfigureAwait(false);

                markinglist = JsonConvert.DeserializeObject <List <MarkingListModel> >(item);
                db.InsertMarkingList(markinglist);

                progress.Dismiss();
            }
            catch (Exception ex)
            {
                progress.Dismiss();
            }

            if (markinglist != null)
            {
                Activity.RunOnUiThread(() =>
                {
                    marked = new MarkingListAdapter(Activity, markinglist);
                    list.SetAdapter(marked);
                });
            }
            progress.Dismiss();
        }
Ejemplo n.º 12
0
        private async void BtnRegistrar_Click(object sender, EventArgs e)
        {
            progress = new Android.App.ProgressDialog(this.Context);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetMessage("Registrando...Espere...");
            progress.SetCancelable(false);
            progress.Show();

            string dni    = txtdni.Text;
            string nombre = txtnombre.Text;
            string email  = txtEmail.Text;
            string telef  = txtTele_F.Text;
            string telec  = txtTele_C.Text;

            if (!string.IsNullOrEmpty(dni) || !string.IsNullOrEmpty(nombre) || !string.IsNullOrEmpty(email) || !string.IsNullOrEmpty(telef) || !string.IsNullOrEmpty(telec))
            {
                //await
                var dato = await controller.RegistraCliente(int.Parse(dni), nombre, email, int.Parse(telef), int.Parse(telec));

                if (dato != null)
                {
                    progress.Dismiss();
                    Toast.MakeText(this.Context, "Registrado Correctamente", ToastLength.Short).Show();
                    LimpiarCasillas();
                }
                else
                {
                    progress.Dismiss();
                    Toast.MakeText(this.Context, "Error al Registrar", ToastLength.Short).Show();
                    LimpiarCasillas();
                }
            }
            else
            {
                progress.Dismiss();
                Toast.MakeText(this.Context, "Campos vacios", ToastLength.Short).Show();
            }
        }
Ejemplo n.º 13
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.assign, container, false);

            HasOptionsMenu = true;
            //ViewPager
            viewpager = rootView.FindViewById <ViewPager>(Resource.Id.viewpager);

            // personal =
            setupViewPager(viewpager);
            var tabLayout = rootView.FindViewById <TabLayout>(Resource.Id.tabs);

            tabLayout.SetupWithViewPager(viewpager);


            progress = new Android.App.ProgressDialog(Activity);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait...");
            return(rootView);
        }
        public async Task getOrgData()
        {
            progress = new Android.App.ProgressDialog(Activity);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait...");
            progress.Show();

            //dynamic value = new ExpandoObject();
            //value.OrgId = orgid;

            //   string json = JsonConvert.SerializeObject(value);
            try
            {
                string item = await restservice.OrgnizationList(Activity, "", location);

                orgmodel = JsonConvert.DeserializeObject <List <OrgModel> >(item);
                for (int i = 0; i < orgmodel.Count; i++)
                {
                    OrgModel org = new OrgModel();
                    org.organizationName = orgmodel[i].organizationName;
                    orgname.Add(org);
                }
                //  db.InsertMarkingList(orgmodel);

                progress.Dismiss();
                selectorg.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(Selectorg_ItemSelected);
                ArrayAdapter adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, orgmodel);
                selectorg.Adapter = adapter;
            }

            catch (Exception ex)
            {
                progress.Dismiss();
            }
        }
Ejemplo n.º 15
0
        public async Task getData()
        {
            Boolean connectivity = con.connectivity();

            if (connectivity)
            {
                progress = new Android.App.ProgressDialog(Activity);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetCancelable(false);
                progress.SetMessage("Please wait...");
                progress.Show();
                dynamic value = new ExpandoObject();
                value.UserId = u_id;

                string json = JsonConvert.SerializeObject(value);
                try
                {
                    JsonValue item = await restService.TaskInbox(Activity, json, geolocation);

                    freq = JsonConvert.DeserializeObject <List <TaskInboxModel> >(item);
                    dbHelper.insertdatainbox(freq);
                    progress.Dismiss();

                    //if (freq.Count != 0)
                    //{
                    //    recyclerview_layoutmanger = new LinearLayoutManager(Activity, LinearLayoutManager.Vertical, false);
                    //    recyclerview.SetLayoutManager(recyclerview_layoutmanger);
                    //    recyclerview_adapter = new TaskInboxAdapter(Activity, freq, recyclerview, FragmentManager);
                    //    recyclerview.SetAdapter(recyclerview_adapter);
                    //}

                    //else
                    //{
                    //    LayoutParams lparams = new LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent);
                    //    TextView textView = new TextView(Activity);
                    //    textView.LayoutParameters = lparams;
                    //    lparams.Gravity = GravityFlags.Center;
                    //    textView.Text = "Oops ! You haven't assigned any task yet";
                    //    linearLayout.AddView(textView);
                    //}
                    //progress.Dismiss();
                }
                catch (Exception ex)
                {
                    progress.Dismiss();
                }
            }
            taskdata = dbHelper.GetTaskInbox();
            if (taskdata.Count != 0)
            {
                recyclerview_layoutmanger = new LinearLayoutManager(Activity, LinearLayoutManager.Vertical, false);
                recyclerview.SetLayoutManager(recyclerview_layoutmanger);
                recyclerview_adapter = new TaskInboxAdapter(Activity, taskdata, recyclerview, FragmentManager);
                recyclerview.SetAdapter(recyclerview_adapter);
            }

            else
            {
                LayoutParams lparams  = new LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);
                TextView     textView = new TextView(Activity);
                textView.LayoutParameters = lparams;
                textView.Text             = "Oops ! You haven't assigned any task yet";
                linearLayout.AddView(textView);
            }
        }
Ejemplo n.º 16
0
        public async Task getData()
        {
            progress = new Android.App.ProgressDialog(Activity);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait...");
            progress.Show();
            dynamic value = new ExpandoObject();

            value.UserId = userid;

            string json = JsonConvert.SerializeObject(value);

            try
            {
                JsonValue item = await restService.TaskOutbox(Activity, json, geolocation);

                List <TaskOutboxModel> taskOutbox = JsonConvert.DeserializeObject <List <TaskOutboxModel> >(item);
                dbHelper.insertdataoutbox(taskOutbox);

                for (int i = 0; i < taskOutbox.Count; i++)
                {
                    TaskOutboxModel detail = new TaskOutboxModel
                    {
                        TaskPercentage     = taskOutbox[i].TaskPercentage,
                        Task_id            = taskOutbox[i].Task_id,
                        Task_name          = taskOutbox[i].Task_name,
                        Description        = taskOutbox[i].Description,
                        deadline_date      = taskOutbox[i].deadline_date,
                        mark_to            = taskOutbox[i].mark_to,
                        task_status        = taskOutbox[i].task_status,
                        Task_created_by    = taskOutbox[i].Task_created_by,
                        Task_creation_date = taskOutbox[i].Task_creation_date,
                        task_mark_by       = taskOutbox[i].task_mark_by,
                        MarkingDate        = taskOutbox[i].MarkingDate,
                        task_marking_type  = taskOutbox[i].task_marking_type
                    };


                    im_model.Add(detail);
                }
                if (im_model.Count != 0)
                {
                    recyclerview_layoutmanger = new LinearLayoutManager(Activity, LinearLayoutManager.Vertical, false);
                    recyclerview.SetLayoutManager(recyclerview_layoutmanger);
                    recyclerview_adapter = new TaskOutboxAdapter(Activity, im_model, recyclerview, FragmentManager);
                    recyclerview.SetAdapter(recyclerview_adapter);
                }
                else
                {
                    TextView textView = new TextView(Activity);

                    textView.Text = "Oops ! You haven't assigned any task yet";
                    LinearLayout.AddView(textView);
                }

                progress.Dismiss();
            }
            catch (Exception ex)
            {
                progress.Dismiss();
            }
            progress.Dismiss();
        }
Ejemplo n.º 17
0
        public async Task getData()
        {
            if (ic.connectivity())
            {
                progress = new Android.App.ProgressDialog(Activity);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetCancelable(false);
                progress.SetMessage("Please wait...");
                progress.Show();
                dynamic value = new ExpandoObject();
                value.task_id = task_id_to_send;

                string json = JsonConvert.SerializeObject(value);
                try
                {
                    JsonValue item = await restService.GetComplianceTask(Activity, json, geolocation);

                    comp         = JsonConvert.DeserializeObject <ComplianceModel>(item);
                    taskuploaded = comp.lstUploadedCompliance;
                    db.complianceoutbox_insert(comp);
                }
                catch (Exception ex)
                {
                    progress.Dismiss();
                }
            }
            else
            {
                datacomp = db.GetCompliance_for_outbox(task_id_to_send);
                db.insertuploadedtask_for_outbox(comp.lstUploadedCompliance);
                taskuploaded = db.gettaskuploaded(task_id_to_send);
                // taskuploaded = comp.lstUploadedCompliance;

                db.insertCommunicationdetail(comp.lstCommunication, task_id_to_send);
                List <CommunicationModel> lstCommunication = db.GetCommunicationModels(task_id_to_send);
            }
            //if (datacomp.Count == 0)
            //{
            //    Toast.MakeText(Activity, "Please connect to the Internet.", ToastLength.Long).Show();
            //}
            //else
            //{


            //}
            // List<CommunicationModel> lstCommunication = comp.lstCommunication;

            if (taskuploaded != null)
            {
                for (int i = 0; i < taskuploaded.Count; i++)
                {
                    if (taskuploaded[i].file_type.Equals("Image"))
                    {
                        imagelistoutbox.Add(taskuploaded[i]);
                    }
                    else if (taskuploaded[i].file_type.Equals("Video"))
                    {
                        videolistoutbox.Add(taskuploaded[i]);
                    }
                    else if (taskuploaded[i].file_type.Equals("Audio"))
                    {
                        audiolistoutbox.Add(taskuploaded[i]);
                    }
                }

                for (int i = 0; i < taskuploaded.Count; i++)
                {
                    filetype    = taskuploaded[i].file_type;
                    filename    = taskuploaded[i].FileName;
                    file_format = taskuploaded[i].file_format;
                    path        = taskuploaded[i].Path;
                    geolocation = taskuploaded[i].GeoLocation;
                    filesize    = taskuploaded[i].FileSize;
                    if (filetype == "Image")
                    {
                        gridimagecomp     = new GridImagecomplianceoutbox(Activity, imagelistoutbox, FragmentManager);
                        imagegrid.Adapter = gridimagecomp;
                        imagegrid.setExpanded(true);
                    }
                    if (filetype == "Video")
                    {
                        gridvideocomp         = new GridVideocomplianceoutbox(Activity, videolistoutbox, FragmentManager);
                        videolistview.Adapter = gridvideocomp;
                        videolistview.setExpanded(true);
                    }
                    if (filetype == "Audio")
                    {
                        gridaudiocomp         = new GridAudiocomplianceOutbox(Activity, audiolistoutbox, FragmentManager);
                        audiolistview.Adapter = gridaudiocomp;
                        audiolistview.setExpanded(true);
                    }
                }

                //task_id = comp.task_id;
                //task_description = comp.description;
                //deadline = comp.deadline_date;
                //meatingid = comp.Meeting_ID;
                //rownum = comp.RowNo;
                ////taskcreationDate = comp.task_creation_date;
                //markby = comp.task_mark_by;
                //taskstatus = comp.taskStatus;
                //markto = comp.markTo;
                //markingtype = comp.task_marking_type;
                //taskcreatedby = comp.task_created_by;
                //markingDate = comp.MarkingDate;
                //creationdate = comp.task_creation_date;
                //shapes_from_Comp = comp.shapes;
                //task_name = comp.task_name;


                progress.Dismiss();
            }

            settingValues();

            for (int i = 0; i <= taskuploaded.Count; i++)
            {
                max_num     = comp.lstUploadedCompliance[i].max_numbers;
                file_format = comp.lstUploadedCompliance[i].file_format;
                filetype    = comp.lstUploadedCompliance[i].file_type;
                //  taskoverview = comp.lstUploadedCompliance[i].task_overview;
                //uploaded = comp.lstUploadedCompliance[i].Uploaded;

                if (filetype.Equals("Image"))
                {
                    image_max = Convert.ToInt32(max_num);
                }
                else if (filetype.Equals("Video"))
                {
                    video_max = Convert.ToInt32(max_num);
                }
                else if (filetype.Equals("Audio"))
                {
                    audio_max = Convert.ToInt32(max_num);
                }
                //Image_no.Text = image_max.ToString();
                //Video_no.Text = video_max.ToString();
                //Audio_no.Text = audio_max.ToString();
            }
        }
Ejemplo n.º 18
0
        private async System.Threading.Tasks.Task CreatetaskService()
        {
            progress = new Android.App.ProgressDialog(Activity);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait...");
            progress.Show();

            //models = db.GetFullAttachmentData(task_id_to_send);

            for (int i = 0; i < listmapping2.Count; i++)
            {
                byte[] img  = GetStreamFromFile(listmapping2[i].localPath);
                var    url1 = await blob.UploadPhotoAsync(img, listmapping2[i].localPath.Substring(listmapping2[i].localPath.LastIndexOf("/") + 1));

                if (url1 != null)
                {
                    listmapping2[i].Path = url1;
                }
            }
            dynamic value = new ExpandoObject();

            value.task_name          = taskname;
            value.description        = taskdescri;
            value.deadline_date      = deadline;
            value.taskCreatethrough  = "mobile";
            value.markTo             = markto;
            value.lstTaskFileMapping = listmapping2;
            value.lstAddedCompliance = CreateTaskFrag.modelsaddcompliance;
            string json = JsonConvert.SerializeObject(value);

            try
            {
                string item = await restService.CreateTaskMethod(Activity, json, geolocation);

                if (item.Contains("Task Created successfully"))
                {
                    //db.InsertCreateTaskData(taskname, taskdescri, deadline, "mobile", markto, "yes");


                    //Toast.MakeText(Activity, "Task Assign Successfully..", ToastLength.Long).Show();
                    Toast.MakeText(Activity, "Task Assign Successfully...", ToastLength.Long).Show();
                    CreateTaskFrag.modelsaddcompliance.Clear();
                    progress.Dismiss();
                }
                else
                {
                    //db.InsertCreateTaskData(taskname, taskdescri, deadline, "mobile", markto,"yes",listmapping2);

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

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

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

                    Toast.MakeText(Activity, "Task saved Successfully.. you have not internet connection", ToastLength.Long).Show();
                    progress.Dismiss();
                }
            }
            catch (Exception ex)
            {
                progress.Dismiss();
            }

            progress.Dismiss();
        }