LoginActivity.java 1.74 KB
package com.huaheng.wms;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;

import com.huaheng.wms.https.WMSHttpInterface;

import org.json.JSONException;
import org.json.JSONObject;

public class LoginActivity extends Activity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        insertCompany();
    }

    private void insertCompany() {
        JSONObject object = new JSONObject();
        try {
            object.put("address1", "长沙市");
            object.put("address2", "浏阳市");
            object.put("attentionTo", "string");
            object.put("city", "浏阳市");
            object.put("country", "湖南省");
            object.put("created", "2018-07-23T03:56:29.108Z");
            object.put("createdBy", "string");
            object.put("deleted", true);
            object.put("email", "string");
            object.put("enable", true);
            object.put("faxNum", "string");
            object.put("id", 0);
            object.put("kind", "string");
            object.put("lastUpdated", "2018-07-23T11:59:40.704Z");
            object.put("mobile", "string");
            object.put("name", "string");
            object.put("phoneNum", "string");
            object.put("postalCode", "string");
            object.put("province", "string");
            object.put("type", "string");
            object.put("userDef1", "string");
            object.put("userDef2", "string");
            object.put("userDef3", "string");
        } catch (JSONException e) {
            e.printStackTrace();
        }
        WMSHttpInterface.insertCompany(object);
    }
}