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

            //WS

            var ws = new Extern();
            //ws.Proxy = System.Net.GlobalProxySelection.GetEmptyWebProxy();///
            result = ws.GetComenzi2();

            tableItems.Clear();

            const string sSeparatori1 = "@";
            const string sSeparatori2 = "#";
            string[] sAtomi1 = result.Split(sSeparatori1.ToCharArray());

            int index1;
            for (index1 = 0; index1 < sAtomi1.Length; index1 = index1 + 1)
            {
                if (sAtomi1[index1].Length <= 0) continue;

                string[] sAtomi2 = sAtomi1[index1].Split(sSeparatori2.ToCharArray());
                int idComanda = Convert.ToInt32(sAtomi2[0]);
                string denumire = sAtomi2[1];
                string dataSiOra = sAtomi2[2];

                tableItems.Add(new TableItem {id = idComanda.ToString(), nume = denumire, dataSiOra = dataSiOra});
            } //WS end

            //textViewHeader.SetText(headerText, TextView.BufferType.Normal);

            SetContentView(Resource.Layout.HomeScreen_negru);

            var textViewHeader = FindViewById<TextView>(Resource.Id.TextViewHeader);
            string headerText = string.Format("IQsfa - {0} comenzi", tableItems.Count.ToString());
            //TODO text format; scot underline !?!
            textViewHeader.Text = headerText;
            //v.getBackground().setColorFilter(Color.parseColor("#00ff00"), PorterDuff.Mode.DARKEN);

            listView = FindViewById<ListView>(Resource.Id.List);
            ///tableItems.Add(new TableItem() { id = "Tubers", nume = "43 items", dataSiOra = Resource.Drawable.Tubers });

            listView.Adapter = new HomeScreenAdapter(this, tableItems);
            listView.ItemClick += OnListItemClick;

            //StartService(new Intent(this, typeof(SimpleService)));

            //String Status = "Asking Server...";
            //txtStatus.setText((CharSequence) Status);
            //textViewHeader.SetText("" + headerText);
            //textViewHeader.Append(headerText);
        }
Esempio n. 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Second);

            string id = Intent.GetStringExtra("FirstData");

            var ws = new Extern();
            //ws.Proxy = System.Net.GlobalProxySelection.GetEmptyWebProxy();
            //var comandaDocLite = new ComandaDocLite();
            ComandaDocLite comandaDoc = ws.GetComanda2(Convert.ToInt32(id));
            //comandaDoc.Detalii[0].Produs
            //comandaDoc.Deta

            //comandaDetaliu.

            var textViewNumeProdus = FindViewById<TextView>(Resource.Id.textViewNumeProdus);
            textViewNumeProdus.Text = comandaDoc.Detalii[0].Produs;

            var textViewCantitate = FindViewById<TextView>(Resource.Id.textViewCantitate);
            textViewCantitate.Text = comandaDoc.Detalii[0].Cantitate.ToString() + " " + comandaDoc.Detalii[0].UM;

            var buttonValideaza = FindViewById<TextView>(Resource.Id.buttonValideaza);
            var editTextGreutate = FindViewById<TextView>(Resource.Id.editTextGreutate);
            buttonValideaza.Click += (sender, e) =>
                                         {
                                             editTextGreutate.RequestFocus();

                                             //InputMethodManager imm = GetSystemService<InputMethodManager>(Context.INPUT_METHOD_SERVICE);
                                             //InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
                                             //imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
                                         };

            //var textViewCantarit = FindViewById<TextView>(Resource.Id.textViewCantarit);
            //textViewCantarit.Text = comandaDoc.Detalii[0].c
            //textViewNumeProdus.Text = "Nume produs";
            // SetContentView(Resource.Layout.HomeScreen_negru);
            //var textViewHeader = FindViewById<TextView>(Resource.Id.TextViewHeader);
            //string headerText = string.Format("IQsfa - {0} comenzi", tableItems.Count.ToString());
            //TODO text format; scot underline !?!
            //textViewHeader.Text = headerText;
        }
Esempio n. 3
0
        public void DoStuff()
        {
            _timer = new Timer((o) =>
                                   {
                                       Log.Debug("SimpleService", "hello from simple service");

                                       //WS
                                       string result = "";
                                       var ws = new Extern();
                                       //ws.Proxy = System.Net.GlobalProxySelection.GetEmptyWebProxy();
                                       result = ws.GetComenzi2();
                                       if (result != HomeScreen.result)
                                       {
                                           HomeScreen.tableItems.Clear();

                                           const string sSeparatori1 = "@";
                                           const string sSeparatori2 = "#";
                                           string[] sAtomi1 = result.Split(sSeparatori1.ToCharArray());

                                           int index1;
                                           for (index1 = 0; index1 < sAtomi1.Length; index1 = index1 + 1)
                                           {
                                               if (sAtomi1[index1].Length <= 0) continue;

                                               string[] sAtomi2 =
                                                   sAtomi1[index1].Split(sSeparatori2.ToCharArray());
                                               int idComanda = Convert.ToInt32(sAtomi2[0]);
                                               string denumire = sAtomi2[1];
                                               string dataSiOra = sAtomi2[2];

                                               HomeScreen.tableItems.Add(new TableItem
                                                                             {
                                                                                 id = idComanda.ToString(),
                                                                                 nume = denumire,
                                                                                 dataSiOra = dataSiOra
                                                                             });
                                           } //WS end
                                       }
                                   }
                               , null, 0, 4000);
        }