/// <summary> /// Deprecated Method for adding a new object to the T_ATTAINS_REPORT EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToT_ATTAINS_REPORT(T_ATTAINS_REPORT t_ATTAINS_REPORT) { base.AddObject("T_ATTAINS_REPORT", t_ATTAINS_REPORT); }
/// <summary> /// Create a new T_ATTAINS_REPORT object. /// </summary> /// <param name="aTTAINS_REPORT_IDX">Initial value of the ATTAINS_REPORT_IDX property.</param> /// <param name="oRG_ID">Initial value of the ORG_ID property.</param> /// <param name="rEPORT_NAME">Initial value of the REPORT_NAME property.</param> public static T_ATTAINS_REPORT CreateT_ATTAINS_REPORT(global::System.Int32 aTTAINS_REPORT_IDX, global::System.String oRG_ID, global::System.String rEPORT_NAME) { T_ATTAINS_REPORT t_ATTAINS_REPORT = new T_ATTAINS_REPORT(); t_ATTAINS_REPORT.ATTAINS_REPORT_IDX = aTTAINS_REPORT_IDX; t_ATTAINS_REPORT.ORG_ID = oRG_ID; t_ATTAINS_REPORT.REPORT_NAME = rEPORT_NAME; return t_ATTAINS_REPORT; }
public static int InsertOrUpdateATTAINS_REPORT(int? aTTAINS_REPORT_IDX, string oRG_ID, string rEPORT_NAME, DateTime? dATA_FROM, DateTime? dATA_TO, bool? aTTAINS_IND, string aTTAINS_SUBMIT_STATUS, DateTime? aTTAINS_UPDATE_DT, String cREATE_USER = "******") { using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities()) { Boolean insInd = false; try { T_ATTAINS_REPORT a = new T_ATTAINS_REPORT(); if (aTTAINS_REPORT_IDX != null) a = (from c in ctx.T_ATTAINS_REPORT where c.ATTAINS_REPORT_IDX == aTTAINS_REPORT_IDX select c).FirstOrDefault(); if (aTTAINS_REPORT_IDX == null) //insert case { insInd = true; } if (oRG_ID != null) a.ORG_ID = oRG_ID; if (rEPORT_NAME != null) a.REPORT_NAME = rEPORT_NAME; if (dATA_FROM != null) a.DATA_FROM = dATA_FROM; if (dATA_TO != null) a.DATA_TO = dATA_TO; if (aTTAINS_IND != null) a.ATTAINS_IND = aTTAINS_IND; if (aTTAINS_SUBMIT_STATUS != null) a.ATTAINS_SUBMIT_STATUS = aTTAINS_SUBMIT_STATUS; if (aTTAINS_UPDATE_DT != null) a.ATTAINS_UPDATE_DT = aTTAINS_UPDATE_DT; if (insInd) //insert case { a.CREATE_USERID = cREATE_USER.ToUpper(); a.CREATE_DT = System.DateTime.Now; ctx.AddToT_ATTAINS_REPORT(a); } ctx.SaveChanges(); return a.ATTAINS_REPORT_IDX; } catch (Exception ex) { return 0; } } }