Esempio n. 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            View Chat = LayoutInflater.Inflate(Resource.Layout.Chat, null);

            IdDestinatario = Intent.GetStringExtra(GetString(Resource.String.idChat));
            destinatario   = Intent.GetStringExtra(GetString(Resource.String.NombreDestinatarioChat));
            empleado       = HelperMethods.getUserById(Convert.ToInt32(IdDestinatario));

            SetContentView(Chat);

            Conexion_Web_Service._client.ListarMensajesAsync(Perfil_Login.miPerfil.ID_Login, Convert.ToInt32(IdDestinatario));
            Conexion_Web_Service._client.ListarMensajesCompleted += _client_ListarMensajesCompleted;

            SetSupportActionBar(FindViewById <Toolbar>(Resource.Id.toolbar));

            // ensure that the system bar color gets drawn
            Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);

            // enable the back button in the action bar
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            // set the activity title and action bar title
            Title = SupportActionBar.Title = destinatario;

            SetupViews(Chat, savedInstanceState);

            editText = FindViewById <EditText>(Resource.Id.forms_centralfragments_chat_chat_editText);
            sv       = FindViewById <ScrollView>(Resource.Id.chatScroll);

            HelperMethods.SetupAnimations(this);

            GetInfo_OnGetInfoComplete();

            editText.Click += ((sender, e) =>
            {
                _activityRootView = FindViewById <ScrollView>(Resource.Id.chatScroll);
                _activityRootView.ViewTreeObserver.AddOnGlobalLayoutListener(this);
            });

            profilePhotoImageView.Click += ((sender, e) => {
                Intent detailIntent = new Intent(this, typeof(InformacionPersonal));
                detailIntent.PutExtra(Resources.GetString(Resource.String.InformacionPersonalIntentKey), int.Parse(IdDestinatario));
                HelperMethods.startIntent(detailIntent, this, Chat, profilePhotoImageView);
            });;
        }
Esempio n. 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            shouldExecuteOnResume = false;

            base.OnCreate(savedInstanceState);

            View acquaintanceDetailLayout = LayoutInflater.Inflate(Resource.Layout.AcquaintanceDetail, null);

            SetContentView(acquaintanceDetailLayout);
            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            // ensure that the system bar color gets drawn
            Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);

            // enable the back button in the action bar
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            // extract the acquaintance id fomr the intent
            IdEmpleado    = Intent.GetIntExtra(GetString(Resource.String.acquaintanceDetailIntentKey), 0);
            vengoConsulta = Intent.GetBooleanExtra(GetString(Resource.String.ConsultaIntentKey), false);

            empleado = HelperMethods.getUserById(IdEmpleado);
            nombreCompletoEmpleado = HelperMethods.DisplayName(empleado);

            // set the activity title and action bar title
            Title = SupportActionBar.Title = nombreCompletoEmpleado;

            SetupViews(acquaintanceDetailLayout, savedInstanceState);

            HelperMethods.SetupAnimations(this);

            mPolylineOptions = new PolylineOptions();
            mPolylineOptions.InvokeColor(Color.Blue).InvokeWidth(10);

            //Should call this to let the map showing
            shouldExecuteOnResume = true;
            Instance = this;
            OnResume();
        }
Esempio n. 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Layout = LayoutInflater.Inflate(Resource.Layout.InformacionPersonal, null);
            SetContentView(Layout);

            nombres               = FindViewById <TextView>(Resource.Id.Nombre);
            apellidos             = FindViewById <TextView>(Resource.Id.Apellido);
            nDocumento            = FindViewById <TextView>(Resource.Id.NDocumento);
            fechaNacimiento       = FindViewById <TextView>(Resource.Id.FechaNacimiento);
            telefonoMovil         = FindViewById <TextView>(Resource.Id.TelefonoMovil);
            telefonoFijo          = FindViewById <TextView>(Resource.Id.TelefonoFijo);
            direccion             = FindViewById <TextView>(Resource.Id.Direccion);
            email                 = FindViewById <TextView>(Resource.Id.Email);
            fechaIngreso          = FindViewById <TextView>(Resource.Id.FechaIngreso);
            departamento          = FindViewById <TextView>(Resource.Id.Departamento);
            profilePhotoImageView = FindViewById <ImageView>(Resource.Id.ImagenPerfil);
            Tareas                = FindViewById <Button>(Resource.Id.TareasPersonal);
            Ubicacion             = FindViewById <Button>(Resource.Id.UbicacionPersonal);
            Mensajeria            = FindViewById <Button>(Resource.Id.MensajeriaPersonal);
            progress              = HelperMethods.setSpinnerDialog("Cargando Coordenadas...", this);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            // set the activity title and action bar title
            Title = SupportActionBar.Title = "Informacion Personal";

            HelperMethods.SetupAnimations(this);

            // extract the acquaintance id fomr the intent
            IdEmpleado = Intent.GetIntExtra(GetString(Resource.String.InformacionPersonalIntentKey), 0);

            if (IdEmpleado != 0)
            {
                empleadoConsulta = HelperMethods.getUserById(IdEmpleado);
                informacionPerfil(empleadoConsulta);
            }
            else
            {
                informacionPerfil(Perfil_Login.miPerfil);
                IdEmpleado            = Perfil_Login.miPerfil.ID_Login;
                Tareas.Visibility     = ViewStates.Invisible;
                Ubicacion.Visibility  = ViewStates.Invisible;
                Mensajeria.Visibility = ViewStates.Invisible;
            }
            Conexion_Web_Service._client.BajarCoordenadasEmpleadosCompleted += _client_Lista_BajarCoordenadasEmpleadosCompletedPersonal;

            Ubicacion.Click += delegate {
                Layout.Enabled = false;
                long  fechaFinal           = HelperMethods.ConvertToUnixTimestamp(DateTime.Now);
                long  fechaInicial         = fechaFinal - 3600;
                int[] ID_UsuariosConsultar = { IdEmpleado };

                Conexion_Web_Service._client.BajarCoordenadasEmpleadosAsync(fechaInicial, fechaFinal, ID_UsuariosConsultar);
                progress.Show();
            };
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            var consulta = LayoutInflater.Inflate(Resource.Layout.Consulta, null);

            SetContentView(consulta);

            BotonEnviar = FindViewById <Button>(Resource.Id.btnEnviar);
            Spinner spinner = FindViewById <Spinner>(Resource.Id.spinner);

            time_display      = FindViewById <TextView>(Resource.Id.txtHora);
            timeFinal_display = FindViewById <TextView>(Resource.Id.txtHoraFin);
            pick_button       = FindViewById <Button>(Resource.Id.btnFechaInicial);
            pickFinal_button  = FindViewById <Button>(Resource.Id.btnFechaFinal);
            int IdEmpleado = Intent.GetIntExtra(GetString(Resource.String.ConsultaIntentKey), 0);

            time_display.Text = "llegue";
            // setup the action bar
            SetSupportActionBar(FindViewById <Toolbar>(Resource.Id.toolbar));

            // ensure that the system bar color gets drawn
            Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);
            Title = SupportActionBar.Title = "Consulta";

            // Spinner o combo que muestra la lista de empleados disponibles
            ArrayAdapter <EmpleadoDTO> adapter = new ArrayAdapter <EmpleadoDTO>(this, Android.Resource.Layout.SimpleSpinnerItem, Perfil_Login.ListaEmpleadosAsignados);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinner.Adapter = adapter;

            if (IdEmpleado != 0)
            {
                EmpleadoDTO empleado        = HelperMethods.getUserById(IdEmpleado);
                int         spinnerPosition = adapter.GetPosition(empleado);
                spinner.SetSelection(spinnerPosition);
            }

            #region Calendario y Horas
            // Invoca el fragmento que contiene el calendario de fecha final
            var fragFin   = FragmentManager.BeginTransaction();
            var fragFinal = new DatePickerFinFragment();
            fragFin.Add(Resource.Id.fragment_Fecha_Final, fragFinal);
            fragFin.Commit();

            // Invoca el fragmento que contiene el calendario de fecha inicial
            var fragTx = FragmentManager.BeginTransaction();
            var frag   = new DatePickerFragment();
            fragTx.Add(Resource.Id.fragment_Fecha_Inicial, frag);
            fragTx.Commit();

            // Get the current time
            horaInicial   = DateTime.Now.Hour;
            horaFinal     = DateTime.Now.Hour + 1;
            minutoInicial = DateTime.Now.Minute;
            minutoFinal   = DateTime.Now.Minute;

            // Display the current date
            UpdateDisplay(time_display, TIME_DIALOG_ID);
            UpdateDisplay(timeFinal_display, TIME_DIALOG_ID_FIN);
            #endregion

            pick_button.Click      += (o, e) => ShowDialog(TIME_DIALOG_ID);
            pickFinal_button.Click += (o, e) => ShowDialog(TIME_DIALOG_ID_FIN);
            BotonEnviar.Click      += BotonEnviar_Click;
            spinner.ItemSelected   += spinner_ItemSelected;
            Conexion_Web_Service._client.BajarCoordenadasEmpleadosCompleted += _client_Consulta_BajarCoordenadasEmpleadosCompleted;
        }