Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE @Count INT = 0
- DECLARE @Message VARCHAR(255) = ''
- SELECT @Count = COUNT(*) FROM Action_temp WHERE ISNULL(id,'') = ''
- IF @Count > 0
- begin
- SET @Message = 'Action Plan cannot be uploaded because Project_ID is blank!'
- end
- ELSE
- BEGIN
- insert into T_Action_Plan (id, AREA, CWID, CWID_ASM, YEAR, CROP_GROUP, CROP, PRODUCT, ACTIVITY,
- grup, UNIT, BUDGET, MONTH_PLAN, MONTH_ACTUAL, Kabupaten, Kecamatan, name_spo, ACTUAL_DATE,
- ACTUAL_COST, retailer_buffer, STATUS)
- select id, AREA, CWID, CWID_ASM, YEAR, CROP_GROUP, CROP, PRODUCT, ACTIVITY, grup, UNIT,
- BUDGET, MONTH_PLAN, MONTH_ACTUAL, Kabupaten, Kecamatan, name_spo, ACTUAL_DATE, ACTUAL_COST,
- retailer_buffer, STATUS
- from Action_temp
- END
- delete from Action_temp
- SELECT @Message AS Error_Message
- public static string uploadDemoPlot(string filename, string path, string cwid)
- {
- try
- {
- using (BayerField_AseanEntities db = new BayerField_AseanEntities())
- {
- ObjectParameter par = new ObjectParameter("Message", typeof(Int32));
- UploadDemoplotTemp(filename, path);
- return db.sp_Add_Demoplot().ToString();
- }
- }
- catch(Exception ex)
- {
- return null;
- }
- }
- WHERE id_unique_key NOT IN (SELECT id_primary_key FROM x2)
Add Comment
Please, Sign In to add comment