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

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById<Button>(Resource.Id.buttonLogin);
            EditText loginUserName = FindViewById<EditText>(Resource.Id.loginUsername);
            EditText loginPassword = FindViewById<EditText>(Resource.Id.loginPassword);

            button.Click += delegate
            {

                String username = loginUserName.Text;
                String password = loginPassword.Text;

                ActionInterface actionPerformer = new BaseAction();
                LoginAction la = new LoginAction(actionPerformer);
                bool result = la.login("9999", "9999", "posclient1");

                if (result)
                {
                    Intent intent = new Intent(this, typeof(ActivityAddItem));
                  StartActivity(intent);

                }

            };
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.AddItem);

            EditText addItemCode = FindViewById<EditText>(Resource.Id.itemCode);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById<Button>(Resource.Id.buttonAddItem);

            string[] items = new string[] { "mark", "tom", "pete", "jeff" };
            ListView listview1 = FindViewById<ListView>(Resource.Id.listView1);
            ArrayAdapter<string> adapater = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, items);
            listview1.Adapter = adapater;

            button.Click += delegate
            {
               String theCode = addItemCode.Text;

               ActionInterface actionPerformer = new BaseAction();
               LookupItemAction la = new LookupItemAction(actionPerformer);
               productdetailtype result = la.lookupItem("9999", "9999", "posclient1", "70029");
               addItemCode.Text = result.productname;

               AddItemAction ai = new AddItemAction(actionPerformer);
               bool resultFromAdd = ai.addItem("9999", "9999", "posclient1", "70029", 1, 3);

                if (resultFromAdd)
                {
                    addItemCode.Text = addItemCode.Text + ":true";
                }  else
                {
                    addItemCode.Text = addItemCode.Text + ":false";
                }

               };
        }