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.Prot29AddCarProduct;

public class Handset29 {

	/**
	 * <br/>2015-7-14上午11:27:07
	 * @param args
	 */
	public static void main(String[] args) {
		SocketCreate create = new SocketCreate("192.168.0.46", 8898,
				"2000000000001");
		try {
			create.createLoginCpzsHandset(358000052L);//汽配
			System.out.println(create.getiCompanyId()+"---"+create.getiWorkStyle());
			
			Prot29AddCarProduct addCarProduct = new Prot29AddCarProduct();
			addCarProduct.dealProt(create, "测试追加产品名称06", "产品型号", "适配车型", "产地", "http://www.baidu.com", "生产商", "测试描述语句","供货商名称");
			long iProductId = addCarProduct.getiProductId();
			if(iProductId>0){
				System.out.println("正确的产品id:"+iProductId);
			}else{
				System.err.println("错误的产品id:"+iProductId);
			}
			
			
		} 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);
		}

	}

}
