Subversion Repositories SmartDukaan

Rev

Rev 13853 | Rev 13878 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13853 Rev 13860
Line 27... Line 27...
27
 
27
 
28
	}
28
	}
29
	int updateInventory(long stock,String supc) throws ClientProtocolException, IOException{
29
	int updateInventory(long stock,String supc) throws ClientProtocolException, IOException{
30
		HttpPost post = new HttpPost("http://seller.snapdeal.com/inventory/update");
30
		HttpPost post = new HttpPost("http://seller.snapdeal.com/inventory/update");
31
		List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
31
		List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
32
		nameValuePairs.add(new BasicNameValuePair("availableInventory",
32
		nameValuePairs.add(new BasicNameValuePair("changedField",
-
 
33
				"inventory"));
-
 
34
		nameValuePairs.add(new BasicNameValuePair("changedValue",
33
				String.valueOf(stock)));
35
				String.valueOf(stock)));
34
		nameValuePairs.add(new BasicNameValuePair("supc",
36
		nameValuePairs.add(new BasicNameValuePair("supc",
35
				supc));
37
				supc));
36
		nameValuePairs.add(new BasicNameValuePair("oper","edit"));
-
 
37
		post.setEntity(new UrlEncodedFormEntity(nameValuePairs,"utf-8"));
38
		post.setEntity(new UrlEncodedFormEntity(nameValuePairs,"utf-8"));
38
		HttpResponse response = client.execute(post);
39
		HttpResponse response = client.execute(post);
39
		BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
40
		BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
40
		String line = "";
41
		String line = "";
41
		while ((line = rd.readLine()) != null) {
42
		while ((line = rd.readLine()) != null) {
Line 119... Line 120...
119
		}
120
		}
120
		get = new HttpGet("http://seller.snapdeal.com/inventory/");
121
		get = new HttpGet("http://seller.snapdeal.com/inventory/");
121
		response = client.execute(get);
122
		response = client.execute(get);
122
		rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
123
		rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
123
		while ((line = rd.readLine()) != null) {
124
		while ((line = rd.readLine()) != null) {
124
			//System.out.println(line);
125
			System.out.println(line);
125
		}
126
		}
126
	}
127
	}
127
 
128
 
128
 
129
 
129
 
130