/// <summary>
 /// Deprecated Method for adding a new object to the T_WQX_IMPORT_TRANSLATE EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToT_WQX_IMPORT_TRANSLATE(T_WQX_IMPORT_TRANSLATE t_WQX_IMPORT_TRANSLATE)
 {
     base.AddObject("T_WQX_IMPORT_TRANSLATE", t_WQX_IMPORT_TRANSLATE);
 }
 /// <summary>
 /// Create a new T_WQX_IMPORT_TRANSLATE object.
 /// </summary>
 /// <param name="tRANSLATE_IDX">Initial value of the TRANSLATE_IDX property.</param>
 /// <param name="oRG_ID">Initial value of the ORG_ID property.</param>
 /// <param name="cOL_NAME">Initial value of the COL_NAME property.</param>
 /// <param name="dATA_FROM">Initial value of the DATA_FROM property.</param>
 public static T_WQX_IMPORT_TRANSLATE CreateT_WQX_IMPORT_TRANSLATE(global::System.Int32 tRANSLATE_IDX, global::System.String oRG_ID, global::System.String cOL_NAME, global::System.String dATA_FROM)
 {
     T_WQX_IMPORT_TRANSLATE t_WQX_IMPORT_TRANSLATE = new T_WQX_IMPORT_TRANSLATE();
     t_WQX_IMPORT_TRANSLATE.TRANSLATE_IDX = tRANSLATE_IDX;
     t_WQX_IMPORT_TRANSLATE.ORG_ID = oRG_ID;
     t_WQX_IMPORT_TRANSLATE.COL_NAME = cOL_NAME;
     t_WQX_IMPORT_TRANSLATE.DATA_FROM = dATA_FROM;
     return t_WQX_IMPORT_TRANSLATE;
 }
Ejemplo n.º 3
0
        public static int InsertOrUpdateWQX_IMPORT_TRANSLATE(int? tRANSLATE_IDX, string oRG_ID, string cOL_NAME, string dATA_FROM, string dATA_TO, string cREATE_USER = "******")
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                Boolean insInd = false;
                try
                {
                    T_WQX_IMPORT_TRANSLATE a = null;

                    if (tRANSLATE_IDX != null)
                        a = (from c in ctx.T_WQX_IMPORT_TRANSLATE
                             where c.TRANSLATE_IDX == tRANSLATE_IDX
                             select c).FirstOrDefault();

                    if (a == null) //insert case
                    {
                        insInd = true;
                        a = new T_WQX_IMPORT_TRANSLATE();
                    }

                    if (oRG_ID != null) a.ORG_ID = oRG_ID;
                    if (cOL_NAME != null) a.COL_NAME = cOL_NAME;
                    if (dATA_FROM != null) a.DATA_FROM = dATA_FROM;
                    if (dATA_TO != null) a.DATA_TO = dATA_TO;

                    if (insInd) //insert case
                    {
                        a.CREATE_DT = DateTime.Now;
                        a.CREATE_USERID = cREATE_USER;
                        ctx.AddToT_WQX_IMPORT_TRANSLATE(a);
                    }

                    ctx.SaveChanges();

                    return a.TRANSLATE_IDX;
                }
                catch (Exception ex)
                {
                    return 0;
                }
            }
        }