コード例 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            RequestWindowFeature(WindowFeatures.NoTitle);
            //base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.login);

            passTxv     = FindViewById <TextView>(Resource.Id.passwordTxv);
            usuariosTxv = FindViewById <TextView>(Resource.Id.usuariosTxv);
            usuariosSpn = FindViewById <Spinner>(Resource.Id.usuariosSpn);
            passEtx     = FindViewById <EditText>(Resource.Id.passwordEtx);
            loginBtn    = FindViewById <Button>(Resource.Id.loginBtn);

            loginBtn.Click += LoginBtn_Click;

            try
            {
                LocalDbManager.InitializeLocalDb();
                CargarUsuarios();
            }
            catch (Exception)
            {
                Utiles.MostrarMensaje(this, "Sin conexión", "Sin conexión al servidor");
            }

#if DEBUG
            passEtx.Text = "Syntex";
#endif
        }
コード例 #2
0
ファイル: MainActivity.cs プロジェクト: cdcorrea/Syntex_repo
 private void Download_Click(object sender, EventArgs e)
 {
     try
     {
         Utiles.AccionEnEspera(this, LocalDbManager.DownloadToLocalDb(), "Descarga", new Android.Graphics.Color(230, 245, 40));
     }
     catch
     {
         Utiles.MostrarMensaje(this, "Imposible conectar con servidor", "La conexión con el servidor no fue posible, revise su conexión y vuelva a intentar. En caso de persistir el error comuniquese con el administrador del sistema.");
     }
 }
コード例 #3
0
ファイル: SelectTests.cs プロジェクト: WickedFlame/MicroMap
        public void Setup()
        {
            _dbManager = new LocalDbManager(null, @"(localdb)\mssqllocaldb");
            _dbManager.CreateDatabase();

            var sb = new StringBuilder();

            sb.AppendLine("CREATE TABLE Awesome(ID int, Value varchar(20));");
            sb.AppendLine("INSERT Awesome (ID, Value) VALUES (1, 'one')");
            sb.AppendLine("INSERT Awesome (ID, Value) VALUES (2, 'two')");
            _dbManager.ExecuteString(sb.ToString());
        }
コード例 #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.espera);

            progressBar          = FindViewById <ProgressBar>(Resource.Id.esperaPB);
            progressBar.Progress = 0;
            bannerTxv            = FindViewById <TextView>(Resource.Id.bannerTxv);

            _actions       = LocalDbManager.DownloadToLocalDb();
            _nombreProceso = Intent.GetStringExtra("NombreProceso");

            Task.Run(async() => await Procesar());
        }
コード例 #5
0
ファイル: DatabaseScope.cs プロジェクト: radtek/DataAccess
 /// <summary>
 ///     Creates a new Database
 /// </summary>
 internal DatabaseScope(LocalDbManager dbManager)
 {
     LocalDbManager.Scope = dbManager;
 }
コード例 #6
0
ファイル: DatabaseScope.cs プロジェクト: JPVenson/DataAccess
		/// <summary>
		/// Creates a new Database
		/// </summary>
		internal DatabaseScope(LocalDbManager dbManager)
		{
			LocalDbManager.Scope = dbManager;
		}
コード例 #7
0
ファイル: MainActivity.cs プロジェクト: cdcorrea/Syntex_repo
        protected override void OnCreate(Bundle savedInstanceState)
        {
            usuario = Intent.GetStringExtra("Usuario");
            bool bReingreso = Intent.GetBooleanExtra("ReingresoMenu", false);

            RequestWindowFeature(WindowFeatures.NoTitle);
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            LinearLayout btnAltaAnimal = FindViewById <LinearLayout>(Resource.Id.btnAltaAnimal);
            LinearLayout btnConsulta   = FindViewById <LinearLayout>(Resource.Id.btnConsulta);
            LinearLayout btnMuestreo   = FindViewById <LinearLayout>(Resource.Id.btnMuestreo);
            LinearLayout btnSangria    = FindViewById <LinearLayout>(Resource.Id.btnSangria);
            LinearLayout btnTacto      = FindViewById <LinearLayout>(Resource.Id.btnTacto);
            LinearLayout btnTraslado   = FindViewById <LinearLayout>(Resource.Id.btnTraslado);
            LinearLayout btnUpload     = FindViewById <LinearLayout>(Resource.Id.btnUpload);
            LinearLayout btnDownload   = FindViewById <LinearLayout>(Resource.Id.btnDownload);

            btnUpload.Click   += Upload_Click;
            btnDownload.Click += Download_Click;


            if (!bReingreso)
            {
                LocalDbManager.InitializeLocalDb();
            }

            var listaPermisosUsuario = revisarPermisos(usuario);

            permisosAll = Permisos.Select(null);

            if (listaPermisosUsuario.IndexOf(permisosAll.Where(x => x.Descripcion == "Mobile - Alta animal").First().ID) != -1) //ALTA ANIMAL
            {
                btnAltaAnimal.Enabled = true;
                btnAltaAnimal.Click  += AltaAnimales_Click;
                btnAltaAnimal.SetBackgroundColor(Android.Graphics.Color.ParseColor("#5ab75d"));
            }
            else
            {
                btnAltaAnimal.Enabled = true;
                btnAltaAnimal.SetBackgroundColor(Android.Graphics.Color.ParseColor("#ebebeb"));
            }
            if (listaPermisosUsuario.IndexOf(permisosAll.Where(x => x.Descripcion == "Mobile - Consulta animal").First().ID) != -1) //CONSULTA ANIMAL
            {
                btnConsulta.Enabled = true;
                btnConsulta.Click  += Consulta_Click;
                btnConsulta.SetBackgroundColor(Android.Graphics.Color.ParseColor("#0175d8"));
            }
            else
            {
                btnConsulta.Enabled = true;
                btnConsulta.SetBackgroundColor(Android.Graphics.Color.ParseColor("#ebebeb"));
            }
            if (listaPermisosUsuario.IndexOf(permisosAll.Where(x => x.Descripcion == "Mobile - Asociar animal").First().ID) != -1)//ASOCIAR
            {
                permisoAsociar = true;
            }
            else
            {
                permisoAsociar = false;
            }
            if (listaPermisosUsuario.IndexOf(permisosAll.Where(x => x.Descripcion == "Mobile - Traslado animal").First().ID) != -1) //TRASLADO
            {
                btnTraslado.Enabled = true;
                btnTraslado.Click  += Traslado_Click;
                btnTraslado.SetBackgroundColor(Android.Graphics.Color.ParseColor("#00bdd4"));
            }
            else
            {
                btnTraslado.Enabled = true;
                btnTraslado.SetBackgroundColor(Android.Graphics.Color.ParseColor("#ebebeb"));
            }
            if (listaPermisosUsuario.IndexOf(permisosAll.Where(x => x.Descripcion == "Mobile - Tacto animal").First().ID) != -1)//TACTO
            {
                btnTacto.Enabled = true;
                btnTacto.Click  += Tacto_Click;
                btnTacto.SetBackgroundColor(Android.Graphics.Color.ParseColor("#aba1bd"));
            }
            else
            {
                btnTacto.Enabled = true;
                btnTacto.SetBackgroundColor(Android.Graphics.Color.ParseColor("#ebebeb"));
            }
            if (listaPermisosUsuario.IndexOf(permisosAll.Where(x => x.Descripcion == "Mobile - Muestreo animal").First().ID) != -1) //MUESTREO
            {
                btnMuestreo.Enabled = true;
                btnMuestreo.Click  += Muestreo_Click;
                btnMuestreo.SetBackgroundColor(Android.Graphics.Color.ParseColor("#e98904"));
            }
            else
            {
                btnMuestreo.Enabled = true;
                btnMuestreo.SetBackgroundColor(Android.Graphics.Color.ParseColor("#ebebeb"));
            }
            if (listaPermisosUsuario.IndexOf(permisosAll.Where(x => x.Descripcion == "Mobile - Sangria animal").First().ID) != -1)//SANGRIA
            {
                btnSangria.Enabled = true;
                btnSangria.Click  += Sangria_Click;
                btnSangria.SetBackgroundColor(Android.Graphics.Color.ParseColor("#de3f27"));
            }
            else
            {
                btnSangria.Enabled = true;
                btnSangria.SetBackgroundColor(Android.Graphics.Color.ParseColor("#ebebeb"));
            }
        }