コード例 #1
0
        async void OnTapped(object s)
        {
            var result = await alertService.ShowMessage("Aviso", "Desea sincronizar la lista de trabajadores");

            if (result == true)
            {
                dataAccess.DeleteOperarios();
                var response = await apiService.Operarios <mtraba00>();

                if (!response.IsSuccess)
                {
                    await dialogService.ShowMessage("Error", response.Message);

                    return;
                }

                var opera   = (List <mtraba00>)response.Result;
                int xqtraba = opera.Count();
                int xtraba  = 0;

                using (IProgressDialog fooDialog = UserDialogs.Instance.Progress("Sincronizando...", null, null, true, MaskType.Black))
                {
                    foreach (var record in opera)
                    {
                        mtraba00 operario = new mtraba00
                        {
                            ctraba = record.ctraba,
                            dtraba = record.dtraba,
                            ccargo = record.ccargo,
                            dcargo = record.dcargo,
                            xsecci = record.xsecci,
                            clinea = record.clinea
                        };
                        dataService.InsertOperario(operario);
                        xtraba = xtraba + 1;
                        fooDialog.PercentComplete = xtraba;
                        fooDialog.Title           = xtraba + " de " + xqtraba;
                        await Task.Delay(10);
                    }
                }
            }
            else // if it's equal to Cancel
            {
                return; // just return to the page and do nothing.
            }

            //await dialogService.ShowMessage("Image", "Tapped");
        }
コード例 #2
0
        private async void Delete()
        {
            var result = await alertService.ShowMessage("Aviso", "Desea eliminar el registro.");

            if (result == true)
            {
                //using (var data = new DataAccess())
                //{
                taudit00 taudit = new taudit00
                {
                    idaudi = xoperac.ElementAt(swipedRowIndex - 1).idaudi,
                    careas = xoperac.ElementAt(swipedRowIndex - 1).careas.ToString(),
                    faudit = DateTime.Parse(xoperac.ElementAt(swipedRowIndex - 1).faudit.ToString()),
                    nsecue = Int32.Parse(xoperac.ElementAt(swipedRowIndex - 1).nsecue.ToString()),
                    clinea = xoperac.ElementAt(swipedRowIndex - 1).clinea.ToString(),
                    nordpr = xoperac.ElementAt(swipedRowIndex - 1).nordpr.ToString(),
                    ccarub = xoperac.ElementAt(swipedRowIndex - 1).ccarub.ToString(),
                    dcarub = xoperac.ElementAt(swipedRowIndex - 1).dcarub.ToString(),
                    ctraba = xoperac.ElementAt(swipedRowIndex - 1).ctraba.ToString(),
                    copera = xoperac.ElementAt(swipedRowIndex - 1).copera.ToString(),
                    dopera = xoperac.ElementAt(swipedRowIndex - 1).dopera.ToString(),
                    dclien = xoperac.ElementAt(swipedRowIndex - 1).dclien.ToString(),
                    nlotes = Int32.Parse(xoperac.ElementAt(swipedRowIndex - 1).nlotes.ToString()),
                    nmuest = Int32.Parse(xoperac.ElementAt(swipedRowIndex - 1).nmuest.ToString()),
                    status = xoperac.ElementAt(swipedRowIndex - 1).status.ToString(),
                    dobser = xoperac.ElementAt(swipedRowIndex - 1).dobser.ToString(),
                    smodif = "R",
                };
                App.baseDatos.Delete(taudit);
                //}
            }
            else // if it's equal to Cancel
            {
                return; // just return to the page and do nothing.
            }

            LoadDetalleAuditorias(nclinea);
        }