// 기존거 있으면 지움. 초기화임. public void batchjob_result() { string refDateStr = this.ReferenceDate_.ToString("yyyyMMdd"); clsHDAT_BATCHJOB_RESULT_TB clstb_batch = new clsHDAT_BATCHJOB_RESULT_TB(); clstb_batch.CALC_DT = refDateStr; clstb_batch.DeleteDate(); // 기존거 있으면 지움. 초기화임. clstb_batch.DeleteDate(); clstb_batch.START_TIME = ""; clstb_batch.END_TIME = ""; clstb_batch.DURATION_TIME = ""; clstb_batch.STATUS = (int)clsHDAT_BATCHJOB_RESULT_TB.STATUS_Type.NOT_CALCULATED; clstb_batch.BATCH_JOB_ID = (int)clsHDAT_BATCHJOB_RESULT_TB.BATCH_JOB_ID_Type.BASE_DATAGENERATE; clstb_batch.Insert(); clstb_batch.BATCH_JOB_ID = (int)clsHDAT_BATCHJOB_RESULT_TB.BATCH_JOB_ID_Type.LOAD_MARKETDATA; clstb_batch.Insert(); clstb_batch.BATCH_JOB_ID = (int)clsHDAT_BATCHJOB_RESULT_TB.BATCH_JOB_ID_Type.FP_CACULATION; clstb_batch.Insert(); clstb_batch.BATCH_JOB_ID = (int)clsHDAT_BATCHJOB_RESULT_TB.BATCH_JOB_ID_Type.POSITION_CALCULATION; clstb_batch.Insert(); }
// db update #region batch_db_update public static void updateBatchJobID_start(DateTime refDate, clsHDAT_BATCHJOB_RESULT_TB.BATCH_JOB_ID_Type jobType) { // basedata 딴데서 만듬. clsHDAT_BATCHJOB_RESULT_TB clstb = new clsHDAT_BATCHJOB_RESULT_TB(); clstb.CALC_DT = refDate.ToString("yyyyMMdd"); clstb.BATCH_JOB_ID = (int)jobType; clstb.START_TIME = DateTime.Now.ToString("HH:mm:ss"); clstb.END_TIME = "999999"; clstb.DURATION_TIME = "999999"; clstb.STATUS = (int)clsHDAT_BATCHJOB_RESULT_TB.STATUS_Type.CALCULATING; if (clstb.UpdateBatch() == 0) { clstb.Insert(); } else { //throw new Exception("update fail : " + clstb.CALC_DT + " " + clstb.BATCH_JOB_ID); } }