Guest User

Untitled

a guest
Jan 18th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. DECLARE @Count INT = 0
  2. DECLARE @Message VARCHAR(255) = ''
  3.  
  4. SELECT @Count = COUNT(*) FROM Action_temp WHERE ISNULL(id,'') = ''
  5.  
  6.  
  7. IF @Count > 0
  8. begin
  9. SET @Message = 'Action Plan cannot be uploaded because Project_ID is blank!'
  10.  
  11. end
  12. ELSE
  13. BEGIN
  14. insert into T_Action_Plan (id, AREA, CWID, CWID_ASM, YEAR, CROP_GROUP, CROP, PRODUCT, ACTIVITY,
  15. grup, UNIT, BUDGET, MONTH_PLAN, MONTH_ACTUAL, Kabupaten, Kecamatan, name_spo, ACTUAL_DATE,
  16. ACTUAL_COST, retailer_buffer, STATUS)
  17.  
  18. select id, AREA, CWID, CWID_ASM, YEAR, CROP_GROUP, CROP, PRODUCT, ACTIVITY, grup, UNIT,
  19. BUDGET, MONTH_PLAN, MONTH_ACTUAL, Kabupaten, Kecamatan, name_spo, ACTUAL_DATE, ACTUAL_COST,
  20. retailer_buffer, STATUS
  21. from Action_temp
  22. END
  23. delete from Action_temp
  24. SELECT @Message AS Error_Message
  25.  
  26. public static string uploadDemoPlot(string filename, string path, string cwid)
  27. {
  28. try
  29. {
  30. using (BayerField_AseanEntities db = new BayerField_AseanEntities())
  31. {
  32. ObjectParameter par = new ObjectParameter("Message", typeof(Int32));
  33. UploadDemoplotTemp(filename, path);
  34. return db.sp_Add_Demoplot().ToString();
  35. }
  36. }
  37. catch(Exception ex)
  38. {
  39. return null;
  40. }
  41. }
  42.  
  43. WHERE id_unique_key NOT IN (SELECT id_primary_key FROM x2)
Add Comment
Please, Sign In to add comment