Search in sources :

Example 1 with RemoteService

use of cn.cerc.summer.android.basis.RemoteService in project summer-android by cn-cerc.

the class FrmLoginByAccount method onClick.

@Override
public void onClick(View v) {
    switch(v.getId()) {
        case R.id.btnLogin:
            String account = edtAccount.getText().toString().trim();
            if ("".equals(account)) {
                lblMessage.setText("用户帐号不允许为空");
                return;
            }
            String password = edtPassword.getText().toString().trim();
            if ("".equals(password)) {
                lblMessage.setText("用户密码不允许为空");
                return;
            }
            this.onPause();
            new Thread(new Runnable() {

                @Override
                public void run() {
                    try {
                        RemoteService rs = new RemoteService(loginUrl);
                        DataSet dataIn = rs.getDataIn();
                        // dataIn.getHead().setField("usercode", edtAccount.getText().toString());
                        dataIn.getHead().setField("Account_", edtAccount.getText().toString());
                        // dataIn.getHead().setField("password", edtPassword.getText().toString());
                        dataIn.getHead().setField("Password_", edtPassword.getText().toString());
                        dataIn.getHead().setField("MachineID_", MyApp.getInstance().getClientId());
                        dataIn.getHead().setField("ClientName_", "android");
                        handler.sendMessage(rs.execByMessage(MSG_LOGIN));
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }).start();
            break;
        default:
            break;
    }
}
Also used : RemoteService(cn.cerc.summer.android.basis.RemoteService) DataSet(cn.cerc.jdb.core.DataSet)

Aggregations

DataSet (cn.cerc.jdb.core.DataSet)1 RemoteService (cn.cerc.summer.android.basis.RemoteService)1