//***************************** ATTAINS_REPORT_LOG ************************************************** public static int InsertOrUpdateATTAINS_REPORT_LOG(int? aTTAINS_LOG_IDX, int? aTTAINS_REPORT_IDX, DateTime? sUBMIT_DT, string sUBMIT_FILE, byte[] rESPONSE_FILE, string rESPONSE_TXT, string cDX_SUBMIT_TRANSID, string cDX_SUBMIT_STATUS, string cREATE_USER = "******") { using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities()) { Boolean insInd = false; try { T_ATTAINS_REPORT_LOG a = new T_ATTAINS_REPORT_LOG(); if (aTTAINS_LOG_IDX != null) a = (from c in ctx.T_ATTAINS_REPORT_LOG where c.ATTAINS_LOG_IDX == aTTAINS_LOG_IDX select c).FirstOrDefault(); if (aTTAINS_REPORT_IDX == null) //insert case { insInd = true; } if (aTTAINS_REPORT_IDX != null) a.ATTAINS_REPORT_IDX = aTTAINS_REPORT_IDX.ConvertOrDefault<int>(); if (sUBMIT_DT != null) a.SUBMIT_DT = sUBMIT_DT.ConvertOrDefault<DateTime>(); if (sUBMIT_FILE != null) a.SUBMIT_FILE = sUBMIT_FILE; if (rESPONSE_FILE != null) a.RESPONSE_FILE = rESPONSE_FILE; if (rESPONSE_TXT != null) a.RESPONSE_TXT = rESPONSE_TXT; if (cDX_SUBMIT_TRANSID != null) a.CDX_SUBMIT_TRANSID = cDX_SUBMIT_TRANSID; if (cDX_SUBMIT_STATUS != null) a.CDX_SUBMIT_STATUS = cDX_SUBMIT_STATUS; if (insInd) //insert case { ctx.AddToT_ATTAINS_REPORT_LOG(a); } ctx.SaveChanges(); return a.ATTAINS_LOG_IDX ; } catch (Exception ex) { return 0; } } }