Subversion Repositories SmartDukaan

Rev

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

Rev 13890 Rev 13899
Line 863... Line 863...
863
							row.getCell((short) 5).setCellValue("No");
863
							row.getCell((short) 5).setCellValue("No");
864
						}
864
						}
865
					}
865
					}
866
					else{
866
					else{
867
						System.out.println("Incremental check success");
867
						System.out.println("Incremental check success");
868
						UpdateSDIUsingPanel UDSI = new UpdateSDIUsingPanel();
-
 
869
						try {
868
						try {
-
 
869
							HttpPost post = new HttpPost("http://seller.snapdeal.com/inventory/update");
-
 
870
							List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
-
 
871
							System.out.println("Calling update inventory: Supc: "+inventory.getSupc()+ " to be update stock: "+ sent_inventory);
-
 
872
							nameValuePairs.add(new BasicNameValuePair("changedField",
870
							//UDSI.handleLogin();
873
									"inventory"));
-
 
874
							nameValuePairs.add(new BasicNameValuePair("changedValue",
-
 
875
									String.valueOf(sent_inventory)));
-
 
876
							nameValuePairs.add(new BasicNameValuePair("supc",
-
 
877
									inventory.getSupc()));
-
 
878
							post.setEntity(new UrlEncodedFormEntity(nameValuePairs,"utf-8"));
-
 
879
							HttpResponse response = client.execute(post);
-
 
880
							BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-
 
881
							String line = "";
-
 
882
							while ((line = rd.readLine()) != null) {
871
							UDSI.updateInventory(sent_inventory,inventory.getSupc());
883
								System.out.println("Response of Inventory Update: "+line);
-
 
884
							}
872
							Thread.sleep(2000);
885
							Thread.sleep(2000);
873
						} catch (ClientProtocolException e) {
886
						} catch (ClientProtocolException e) {
874
							System.out.println("Could not login and update inventory");
887
							System.out.println("Could not login and update inventory");
875
							e.printStackTrace();
888
							e.printStackTrace();
876
							continue;
889
							continue;