/// <summary>
 /// Deprecated Method for adding a new object to the T_EPA_ORGS EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToT_EPA_ORGS(T_EPA_ORGS t_EPA_ORGS)
 {
     base.AddObject("T_EPA_ORGS", t_EPA_ORGS);
 }
 /// <summary>
 /// Create a new T_EPA_ORGS object.
 /// </summary>
 /// <param name="oRG_ID">Initial value of the ORG_ID property.</param>
 /// <param name="oRG_FORMAL_NAME">Initial value of the ORG_FORMAL_NAME property.</param>
 public static T_EPA_ORGS CreateT_EPA_ORGS(global::System.String oRG_ID, global::System.String oRG_FORMAL_NAME)
 {
     T_EPA_ORGS t_EPA_ORGS = new T_EPA_ORGS();
     t_EPA_ORGS.ORG_ID = oRG_ID;
     t_EPA_ORGS.ORG_FORMAL_NAME = oRG_FORMAL_NAME;
     return t_EPA_ORGS;
 }
示例#3
0
        public static int InsertOrUpdateT_EPA_ORGS(global::System.String oRG_ID, global::System.String oRG_NAME)
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                try
                {
                    T_EPA_ORGS a = new T_EPA_ORGS();
                    a.ORG_ID = oRG_ID;
                    if (oRG_NAME != null) a.ORG_FORMAL_NAME = oRG_NAME;
                    a.UPDATE_DT = System.DateTime.Now;
                    ctx.AddToT_EPA_ORGS(a);
                    ctx.SaveChanges();

                    return 1;
                }
                catch (Exception ex)
                {
                    return 0;
                }
            }
        }