Exemple #1
0
        private void AutocompleteTextView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            com.rahmat_faisal.www.Service ws  = new com.rahmat_faisal.www.Service();
            AutoCompleteTextView          txv = FindViewById <AutoCompleteTextView>(Resource.Id.AutoCompleteInput);
            EditText tximei = FindViewById <EditText>(Resource.Id.etIMEI);

            tximei.Text = ws.G_IMEI("ESEAL_AG_BC_PLB" + txv.Text.Trim());
            SetEnable();
        }
Exemple #2
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                com.rahmat_faisal.www.Service ws = new com.rahmat_faisal.www.Service();
                string hasil;

                EditText txtUserID = FindViewById <EditText>(Resource.Id.userName);
                EditText txtPwd    = FindViewById <EditText>(Resource.Id.password);
                hasil = ws.CheckEmployeeID(txtUserID.Text.ToString(), txtPwd.Text.ToString());
                if (hasil.ToLower() != "xxxxxxxxxx")
                {
                    //StartActivity(typeof(ListPickList));
                    Intent intent = new Intent(this, typeof(Update));
                    intent.PutExtra("NIK", txtUserID.Text.ToString());
                    intent.PutExtra("Nama", hasil);
                    StartActivity(intent);
                }
                else
                {
                    Notification.Builder builder = new Notification.Builder(this)
                                                   .SetContentTitle("Login Gagal")
                                                   .SetContentText("NIK atau Password salah")
                                                   .SetDefaults(NotificationDefaults.Sound);


                    // Build the notification:
                    Notification notification = builder.Build();

                    // Get the notification manager:
                    NotificationManager notificationManager =
                        GetSystemService(Context.NotificationService) as NotificationManager;

                    // Publish the notification:
                    const int notificationId = 0;
                    notificationManager.Notify(notificationId, notification);

                    AlertDialog.Builder dlg   = new AlertDialog.Builder(this);
                    AlertDialog         alert = dlg.Create();
                    alert.SetTitle("Login Gagal");
                    alert.SetMessage("NIK atau Password salah");
                    alert.Show();
                }
            }

            catch (Exception ex)
            {
                AlertDialog.Builder dlg   = new AlertDialog.Builder(this);
                AlertDialog         alert = dlg.Create();
                alert.SetTitle("Please Relogin   ");
                alert.SetMessage("User ID + Password must be Entry, " +
                                 "Please Cek Your internet Connection or send your problem to [email protected]  =problem>>" + ex.Message.ToString());
                alert.Show();
            }
        }
Exemple #3
0
        private void startActiv()
        {
            SetDisable();

            TextView tgl_kirim = (TextView)FindViewById(Resource.Id.tgl_date);

            tgl_kirim.Text = DateTime.Today.ToShortDateString();

            System.Data.DataSet           ds = new System.Data.DataSet();
            com.rahmat_faisal.www.Service ws = new com.rahmat_faisal.www.Service();
            ds = ws.G_eseal();

            List <String> listEseal;

            listEseal = new List <string>();
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                listEseal.Add(ds.Tables[0].Rows[i]["NoEseal"].ToString().Substring(15, 3));
            }


            //string[] geseal = Resources.GetStringArray(Resource.Array.Geseal_array);
            var          adapter             = new ArrayAdapter <String>(this, Resource.Layout.list_item);
            ArrayAdapter autoCompleteAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleDropDownItem1Line, listEseal);

            var autocompleteTextView = FindViewById <AutoCompleteTextView>(Resource.Id.AutoCompleteInput);

            autocompleteTextView.Adapter = autoCompleteAdapter;

            autocompleteTextView.ItemClick += AutocompleteTextView_ItemClick;

            /*AlertDialog.Builder dlg = new AlertDialog.Builder(this);
             * AlertDialog alert = dlg.Create();
             * alert.SetTitle("masukan No Eseal dahulu");
             * alert.Show();*/
        }