Beispiel #1
0
        protected override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                RequestWindowFeature(WindowFeatures.NoTitle);
                SetContentView(Resource.Layout.Mapa);

                ImageButton  ImgButton = FindViewById <ImageButton> (Resource.Id.BtnRegresar);
                DTOODTCustom ODTDet    = new DTOODTCustom();
                ODTDet = (DTOODTCustom)Utils.Deserialize(typeof(DTOODTCustom), this.Intent.GetStringExtra("ODT"));
                TextView lblODT = FindViewById <TextView> (Resource.Id.LblOrdenActual);
                lblODT.Text      = ODTDet.Folio + " - " + ODTDet.NumeroVista;
                lat              = this.Intent.GetDoubleExtra("lat", 0);
                lng              = this.Intent.GetDoubleExtra("lng", 0);
                ImgButton.Click += delegate {
                    Finish();
                };

                GetCurrentLocation();
                InitMapFragment();
                SetupMapIfNeeded();
            }catch (Exception ex) {
                Toast.MakeText(this, ex.Message, ToastLength.Long).Show();
            }
        }
        public static DTOODTPospuesta FindPospuesta(DTOODTCustom odt)
        {
            DTOODTPospuesta        RetExec = null;
            List <DTOODTPospuesta> pospone = Utils.MemoriaPosponer;

            if (pospone != null)
            {
                foreach (DTOODTPospuesta ex in pospone)
                {
                    if (ex.ODTID == odt.ID)
                    {
                        RetExec = ex;
                    }
                }
            }

            return(RetExec);
        }
        public static DTOODTCancelacion FindCancelacion(DTOODTCustom odt)
        {
            DTOODTCancelacion        RetExec     = null;
            List <DTOODTCancelacion> cancelacion = Utils.MemoriaCancelacion;

            if (cancelacion != null)
            {
                foreach (DTOODTCancelacion ex in cancelacion)
                {
                    if (ex.ODTID == odt.ID)
                    {
                        RetExec = ex;
                    }
                }
            }

            return(RetExec);
        }
        public static DTOODTEjecucion FindEjecucion(DTOODTCustom odt)
        {
            DTOODTEjecucion        RetExec   = null;
            List <DTOODTEjecucion> ejecucion = Utils.MemoriaEjecucion;

            if (ejecucion != null)
            {
                foreach (DTOODTEjecucion ex in ejecucion)
                {
                    if (ex.ODTID == odt.ID)
                    {
                        RetExec = ex;
                    }
                }
            }

            return(RetExec);
        }
Beispiel #5
0
        public static DTOODTCustom FindODT(DTOODTCustom odt)
        {
            DTOODTCustom[] Mem     = Utils.Memoria;
            DTOODTCustom   ODTFind = null;

            if (Mem != null)
            {
                foreach (DTOODTCustom od in Mem)
                {
                    if (od.ID == odt.ID && (od.EstatusID == 114 || od.EstatusID == 117 || (od.EstatusID == 113 && od.EsPospuesta == true)))
                    {
                        ODTFind = od;
                        break;
                    }
                }
            }

            return(ODTFind);
        }
Beispiel #6
0
        public static void BorrarMemoriaPospuesta(DTOODTCustom odt)
        {
            List <DTOODTPospuesta> Mem = Utils.MemoriaPosponer;

            if (Mem != null)
            {
                int index = 0;
                foreach (DTOODTPospuesta od in Mem)
                {
                    if (od.ODTID == odt.ID)
                    {
                        break;
                    }
                    index++;
                }

                Mem.RemoveAt(index);
                Utils.MemoriaPosponer = Mem;
            }
        }
Beispiel #7
0
        public static void  ActualizarMemoria(DTOODTCustom odt, short estatus)
        {
            DTOODTCustom[] Mem = Utils.Memoria;
            if (Mem != null)
            {
                int index = 0;
                foreach (DTOODTCustom od in Mem)
                {
                    if (od.ID == odt.ID)
                    {
                        break;
                    }
                    index++;
                }

                Mem[index].EstatusID = estatus;
                if (estatus == 113)
                {
                    Mem [index].EsPospuesta = true;
                }
                Utils.Memoria = Mem;
            }
        }
Beispiel #8
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            try
            {
                RequestWindowFeature(WindowFeatures.NoTitle);

                SetContentView(Resource.Layout.Finalizar_Orden_De_Trabajo);

                //Botones
                ImageButton ImgButton      = FindViewById <ImageButton> (Resource.Id.BtnRegresar);
                ImageButton ImgCamara      = FindViewById <ImageButton> (Resource.Id.BtnCamara);
                Button      btnFotoDetalle = FindViewById <Button> (Resource.Id.BtnFotografiaDetalle);
                Button      btnFotoMediana = FindViewById <Button> (Resource.Id.BtnFotografiaMediana);
                Button      btnFotoLarga   = FindViewById <Button> (Resource.Id.BtnFotografiaLarga);
                Button      btnFinalizar   = FindViewById <Button> (Resource.Id.BtnFinalizar);

                //Labels
                lblFotoDetalle = FindViewById <TextView> (Resource.Id.LblInfoFotoDetalle);
                lblFotoMediana = FindViewById <TextView> (Resource.Id.LblInfoFotoMediana);;
                lblFotoLarga   = FindViewById <TextView> (Resource.Id.LblInfoFotoLarga);;

                TextView lblODT = FindViewById <TextView> (Resource.Id.lblOrdenActual);

                ODTDet      = (DTOODTCustom)Utils.Deserialize(typeof(DTOODTCustom), this.Intent.GetStringExtra("ODT"));
                lblODT.Text = ODTDet.Folio + " - " + ODTDet.NumeroVista;


                if (bundle != null)
                {
                    if (bundle.ContainsKey("pathImagen1"))
                    {
                        imageUrl1 = bundle.GetString("pathImagen1");
                    }

                    if (bundle.ContainsKey("pathImagen1Id"))
                    {
                        imageurlId1 = bundle.GetString("pathImagen1Id");
                    }

                    if (bundle.ContainsKey("lblDetalle"))
                    {
                        lblFotoDetalle.Text = bundle.GetString("lblDetalle");
                    }

                    if (!string.IsNullOrEmpty(imageUrl1))
                    {
                        bitmapDetalle = ReloadFoto(imageUrl1);
                        if (bitmapDetalle == null)
                        {
                            Toast.MakeText(ApplicationContext, "No se cargó la fotografía detalle correctamente, favor de seleccionarla de nuevo", ToastLength.Long).Show();
                            return;
                        }
                    }

                    if (bundle.ContainsKey("pathImagen2"))
                    {
                        imageUrl2 = bundle.GetString("pathImagen2");
                    }

                    if (bundle.ContainsKey("pathImagen2Id"))
                    {
                        imageurlId2 = bundle.GetString("pathImagen2Id");
                    }

                    if (bundle.ContainsKey("lblMediana"))
                    {
                        lblFotoMediana.Text = bundle.GetString("lblMediana");
                    }

                    if (!string.IsNullOrEmpty(imageUrl2))
                    {
                        bitmapMediana = ReloadFoto(imageUrl2);

                        if (bitmapMediana == null)
                        {
                            Toast.MakeText(ApplicationContext, "No se cargó la fotografía mediana correctamente, favor de seleccionarla de nuevo", ToastLength.Long).Show();
                            return;
                        }
                    }

                    if (bundle.ContainsKey("pathImagen3"))
                    {
                        imageUrl3 = bundle.GetString("pathImagen3");
                    }

                    if (bundle.ContainsKey("pathImagen3Id"))
                    {
                        imageurlId3 = bundle.GetString("pathImagen3Id");
                    }

                    if (bundle.ContainsKey("lblLarga"))
                    {
                        lblFotoLarga.Text = bundle.GetString("lblLarga");
                    }

                    if (!string.IsNullOrEmpty(imageUrl3))
                    {
                        bitmapLarga = ReloadFoto(imageUrl3);

                        if (bitmapLarga == null)
                        {
                            Toast.MakeText(ApplicationContext, "No se cargó la fotografía larga correctamente, favor de seleccionarla de nuevo", ToastLength.Long).Show();
                            return;
                        }
                    }


                    if (bundle.ContainsKey("contador"))
                    {
                        Contador = bundle.GetInt("contador");
                    }
                }



                //Eventos
                ImgButton.Click += delegate
                {
                    Finish();
                };
                btnFotoDetalle.Click += delegate { selectImage(1); };
                btnFotoMediana.Click += delegate { selectImage(2); };
                btnFotoLarga.Click   += delegate { selectImage(3); };
                btnFinalizar.Click   += delegate { FinalizarODT(); };
                ImgCamara.Click      += delegate {
                    IniciarCamaraButton();
                };


                bk.DoWork             += new DoWorkEventHandler(bk_DoWork);
                bk.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bk_RunWorkerCompleted);
                _progressDialog        = new ProgressDialog(this)
                {
                    Indeterminate = true
                };
                _progressDialog.SetMessage("Por favor espere...");
                _progressDialog.SetCanceledOnTouchOutside(false);
                RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait;
            }catch (Exception ex) {
                var toast = Toast.MakeText(ApplicationContext, ex.Message, ToastLength.Long);
                toast.Show();
            }
        }
Beispiel #9
0
        async Task Load()
        {
            try{
                LinearLayout linearPadre = FindViewById <LinearLayout> (Resource.Id.Layout_OrdenTrabajo);
                linearPadre.RemoveAllViews();

                LinkedList <DTOODTCustom> ListaODT = new LinkedList <DTOODTCustom> ();
                foreach (DTOODTCustom ODTDet in ArrayODT)
                {
                    DTOODTCustom Find = Utils.FindODT(ODTDet);
                    LinearLayout LY   = new LinearLayout(this);


                    LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent,
                                                                                                 LinearLayout.LayoutParams.MatchParent);

                    linearLayoutParams.SetMargins(0, 0, 0, 0);

                    LY.LayoutParameters = linearLayoutParams;


                    LY.Id          = ODTDet.ID;
                    LY.Orientation = Android.Widget.Orientation.Vertical;
                    LY.SetGravity(GravityFlags.Center);



                    TextView tvTitulo = new TextView(this);
                    tvTitulo.Text = ODTDet.Folio + " - " + ODTDet.NumeroVista;
                    tvTitulo.SetBackgroundResource(Resource.Drawable.ListViewOrden_Trabajo);
                    tvTitulo.Gravity = Android.Views.GravityFlags.Center;
                    if (Find == null)
                    {
                        if (ODTDet.EsPospuesta == true)
                        {
                            tvTitulo.SetTextColor(Color.ParseColor(color [1]));
                        }
                        else
                        {
                            tvTitulo.SetTextColor(Color.ParseColor(color [0]));
                        }
                        tvTitulo.Click += delegate
                        {
                            var activityMain = new Intent(this, typeof(Orden_De_Trabajo));
                            activityMain.PutExtra("ODT", Utils.Serialize(typeof(DTOODTCustom), ODTDet));
                            StartActivityForResult(activityMain, 1);
                        };
                        ListaODT.AddLast(ODTDet);
                    }
                    else
                    {
                        if (Find.EstatusID == 114)
                        {
                            DTOODTEjecucion Exec = EjecucionMemoria.FindEjecucion(Find);
                            if (Exec != null)
                            {
                                tvTitulo.SetTextColor(Color.ParseColor(color [3]));
                                tvTitulo.Click += delegate { BKEjecucion(Exec); };
                                ListaODT.AddLast(Find);
                            }
                            else
                            {
                                if (ODTDet.EsPospuesta == true)
                                {
                                    tvTitulo.SetTextColor(Color.ParseColor(color [1]));
                                }
                                else
                                {
                                    tvTitulo.SetTextColor(Color.ParseColor(color [0]));
                                }
                                tvTitulo.Click += delegate
                                {
                                    var activityMain = new Intent(this, typeof(Orden_De_Trabajo));
                                    activityMain.PutExtra("ODT", Utils.Serialize(typeof(DTOODTCustom), ODTDet));
                                    StartActivityForResult(activityMain, 1);
                                };
                                ListaODT.AddLast(ODTDet);
                            }
                        }
                        else if (Find.EstatusID == 113)
                        {
                            DTOODTPospuesta pos = EjecucionMemoria.FindPospuesta(Find);
                            if (pos != null)
                            {
                                tvTitulo.SetTextColor(Color.ParseColor(color [1]));
                                tvTitulo.Click += delegate { BKPospones(pos); };
                                ListaODT.AddLast(Find);
                            }
                            else
                            {
                                if (ODTDet.EsPospuesta == true)
                                {
                                    tvTitulo.SetTextColor(Color.ParseColor(color [1]));
                                }
                                else
                                {
                                    tvTitulo.SetTextColor(Color.ParseColor(color [0]));
                                }
                                tvTitulo.Click += delegate
                                {
                                    var activityMain = new Intent(this, typeof(Orden_De_Trabajo));
                                    activityMain.PutExtra("ODT", Utils.Serialize(typeof(DTOODTCustom), ODTDet));
                                    StartActivityForResult(activityMain, 1);
                                };
                                ListaODT.AddLast(ODTDet);
                            }
                        }
                        else if (Find.EstatusID == 117)
                        {
                            DTOODTCancelacion can = EjecucionMemoria.FindCancelacion(Find);
                            if (can != null)
                            {
                                tvTitulo.SetTextColor(Color.ParseColor(color [2]));
                                tvTitulo.Click += delegate {
                                    BKCancelacion(can);
                                };
                                ListaODT.AddLast(Find);
                            }
                            else
                            {
                                if (ODTDet.EsPospuesta == true)
                                {
                                    tvTitulo.SetTextColor(Color.ParseColor(color [1]));
                                }
                                else
                                {
                                    tvTitulo.SetTextColor(Color.ParseColor(color [0]));
                                }
                                tvTitulo.Click += delegate
                                {
                                    var activityMain = new Intent(this, typeof(Orden_De_Trabajo));
                                    activityMain.PutExtra("ODT", Utils.Serialize(typeof(DTOODTCustom), ODTDet));
                                    StartActivityForResult(activityMain, 1);
                                };
                                ListaODT.AddLast(ODTDet);
                            }
                        }
                    }

                    tvTitulo.Clickable = true;
                    LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent,
                                                                                LinearLayout.LayoutParams.MatchParent);

                    p.SetMargins(10, 0, 15, 20);
                    tvTitulo.LayoutParameters = p;
                    LY.AddView(tvTitulo);
                    linearPadre.AddView(LY);
                }
                Utils.Memoria = ListaODT.ToArray <DTOODTCustom>();
            }catch (Exception ex) {
                throw ex;
            }
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            RequestWindowFeature(WindowFeatures.NoTitle);


            SetContentView(Resource.Layout.Cancelar_Orden_De_Trabajo);


            ImageButton ImgButton = FindViewById <ImageButton> (Resource.Id.BtnRegresar);
            ImageButton ImgCamara = FindViewById <ImageButton> (Resource.Id.BtnCamara);

            Medidas       = FindViewById <Button> (Resource.Id.BtnMedidas);
            Clausurado    = FindViewById <Button> (Resource.Id.BtnClausurado);
            Arrendamiento = FindViewById <Button> (Resource.Id.BtnArrendamiento);
            Arte          = FindViewById <Button> (Resource.Id.BtnArte);
            Otros         = FindViewById <Button> (Resource.Id.BtnOtros);
            Button Fotografia = FindViewById <Button> (Resource.Id.BtnFotografiaEvidencia);
            Button Cancelar   = FindViewById <Button> (Resource.Id.BtnCancelarODT);


            //label
            lblInfoFoto = FindViewById <TextView> (Resource.Id.LblInfoFoto);
            TextView lblODT = FindViewById <TextView> (Resource.Id.LblOrdenActual);



            ODTDet      = (DTOODTCustom)Utils.Deserialize(typeof(DTOODTCustom), this.Intent.GetStringExtra("CANCELAR_ODT"));
            lblODT.Text = ODTDet.Folio + " - " + ODTDet.NumeroVista;

            if (bundle != null)
            {
                if (bundle.ContainsKey("pathImagen1"))
                {
                    imageurl = bundle.GetString("pathImagen1");
                }

                if (bundle.ContainsKey("pathImagen1Id"))
                {
                    imageurlId = bundle.GetString("pathImagen1Id");
                }

                if (bundle.ContainsKey("lblDetalle"))
                {
                    lblInfoFoto.Text = bundle.GetString("lblDetalle");
                }

                if (bundle.ContainsKey("contador"))
                {
                    Contador = bundle.GetInt("contador");
                }

                if (!string.IsNullOrEmpty(imageurl))
                {
                    bitmapDetalle = ReloadFoto(imageurl);
                    if (bitmapDetalle == null)
                    {
                        Toast.MakeText(ApplicationContext, "No se cargó la fotografía de evidencia correctamente, favor de seleccionarla de nuevo", ToastLength.Long).Show();
                        return;
                    }
                }
            }



            //Eventos

            Medidas.Click       += delegate { PressMotive(5); };
            Clausurado.Click    += delegate { PressMotive(6); };
            Arrendamiento.Click += delegate { PressMotive(7); };
            Arte.Click          += delegate { PressMotive(8); };
            Otros.Click         += delegate { PressMotive(9); };
            ImgButton.Click     += delegate
            {
                Finish();
            };

            ImgCamara.Click += delegate {
                IniciarCamara();
            };
            Fotografia.Click += delegate { selectImage(2); };
            Cancelar.Click   += delegate { CancelarODT(); };


            bk.DoWork             += new DoWorkEventHandler(bk_DoWork);
            bk.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bk_RunWorkerCompleted);
            _progressDialog        = new ProgressDialog(this)
            {
                Indeterminate = true
            };
            _progressDialog.SetMessage("Por favor espere...");
            _progressDialog.SetCanceledOnTouchOutside(false);

            // Create your application here


            RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait;
        }