package cn.net.test;

import java.io.IOException;
import java.net.BindException;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;

import cn.net.cpzslibs.prot.Prot02Logout;
import cn.net.cpzslibs.prot.SocketCreate;
import cn.net.cpzslibs.prot.handset.Prot28UpCarProductNId;

public class MainTest1703 {

	/**
	 * <br/>2015-7-14上午11:27:07
	 * @param args
	 */
	public static void main(String[] args) {
		SocketCreate create = new SocketCreate("192.168.0.46", 8898,
				"358000052");
		try {
			create.createLoginCpzsHandset(358000052L);
			System.out.println(create.getiCompanyId()+"---"+create.getiWorkStyle());
			if (create.isResult()) {
				Prot28UpCarProductNId carProductNId = new Prot28UpCarProductNId();
				carProductNId.dealProt(create, 107616L, "Ce Shi 123");
				if(carProductNId.isSuccess()){
					System.out.println("测试追加成功");
				}else{
					System.out.println("测试追加  失败");
				}
			}else{
				System.out.println("登录失败"+create.getErrMsg());
			}
			

		} catch (BindException e) {
			e.printStackTrace();
		} catch (ConnectException e) {
			e.printStackTrace();
		} catch (SocketTimeoutException e) {
			e.printStackTrace();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			new Prot02Logout().dealLogout(create);
		}

	}

}
