Exemplo n.º 1
0
        private void btnGet_Click(object sender, EventArgs e)
        {
            WebApiCall      web = new WebApiCall(null);
            ApiCallArgument ar  = new ApiCallArgument(txtServerUrl.Text, "Employee", false);

            ar.UseName   = txtUser.Text;
            ar.Password  = txtPass.Text;
            ar.Parameter = "Saiful";
            //
            web.execute(ar, delegate(object p)
            {
                parseSingleEmployee(p);
            });
        }
Exemplo n.º 2
0
        private void btnWebApi_Click(object sender, EventArgs e)
        {
            WebApiCall      web = new WebApiCall(null);
            ApiCallArgument ar  = new ApiCallArgument(txtServerUrl.Text, "Employee");

            ar.UseName  = txtUser.Text;
            ar.Password = txtPass.Text;
            //
            web.execute(ar, delegate(object p)
            {
                ResponseObject res = (ResponseObject)p;
                this.parseEmployee(res);

                return;
            });
        }
Exemplo n.º 3
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            WebApiCall      web = new WebApiCall(null);
            ApiCallArgument ar  = new ApiCallArgument(txtServerUrl.Text, "Employee");

            ar.UseName   = txtUser.Text;
            ar.Password  = txtPass.Text;
            ar.Parameter = new Login()
            {
                ID = txtUser.Text, Password = txtPass.Text
            };
            //
            web.execute(ar, delegate(object p)
            {
                Employee emp = parseSingleEmployee(p);
                if (emp != null)
                {
                    this.lblLoginID.Text = "Login as: " + emp.Name;
                }
            });
        }