Esempio n. 1
0
 public static int DeleteT_OE_AnalyzeConfig(int AnalyzeConfig_IDX)
 {
     using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
     {
         try
         {
             T_OE_ANALYZECONFIG r = new T_OE_ANALYZECONFIG();
             r = (from c in ctx.T_OE_ANALYZECONFIG where c.ANALYZECONFIG_IDX == AnalyzeConfig_IDX select c).FirstOrDefault();
             ctx.DeleteObject(r);
             ctx.SaveChanges();
             return 1;
         }
         catch
         {
             return 0;
         }
     }
 }
Esempio n. 2
0
        public static int InsertOrUpdateT_OE_AnalyzeConfig(global::System.Int32? aNALYZECONFIG_IDX, global::System.String oRG_ID, global::System.String aNALYZECONFIG_NAME, 
            global::System.Int32 uSER_IDX, global::System.String sITES, global::System.String cHARACTERISTIC, global::System.DateTime sTART_DATE, 
            global::System.DateTime eND_DATE, global::System.Double uPPER_THRESHOLD, global::System.Double lOWER_THRESHOLD)
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                Boolean insInd = false;
                try
                {
                    T_OE_ANALYZECONFIG a = new T_OE_ANALYZECONFIG();

                    if (aNALYZECONFIG_IDX != null)
                        a = (from c in ctx.T_OE_ANALYZECONFIG
                             where c.ANALYZECONFIG_IDX == aNALYZECONFIG_IDX
                             select c).FirstOrDefault();

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

                    if (oRG_ID != null) a.ORG_ID = oRG_ID;
                    if (aNALYZECONFIG_NAME != null) a.ANALYZECONFIG_NAME = aNALYZECONFIG_NAME;
                    if (uSER_IDX != null) a.USER_IDX = uSER_IDX;
                    if (sITES != null) a.SITES = sITES;
                    if (cHARACTERISTIC != null) a.CHARACTERISTIC = cHARACTERISTIC;
                    if (sTART_DATE != null) a.START_DATE = sTART_DATE;
                    if (eND_DATE != null) a.END_DATE = eND_DATE;
                    if (uPPER_THRESHOLD != null) a.UPPER_THRESHOLD = uPPER_THRESHOLD;
                    if (lOWER_THRESHOLD != null) a.LOWER_THRESHOLD = lOWER_THRESHOLD;

                    if (insInd) //insert case
                    {
                    //    a.CREATE_USERID = cREATE_USER.ToUpper();
                    //    a.CREATE_DT = System.DateTime.Now;
                        ctx.AddToT_OE_ANALYZECONFIG(a);
                    }
                    else
                    {
                    //    a.UPDATE_USERID = cREATE_USER.ToUpper();
                    //    a.UPDATE_DT = System.DateTime.Now;
                    }

                    ctx.SaveChanges();

                    return a.ANALYZECONFIG_IDX;
                }
                catch (Exception ex)
                {
                    return 0;
                }
            }
        }
 /// <summary>
 /// Create a new T_OE_ANALYZECONFIG object.
 /// </summary>
 /// <param name="aNALYZECONFIG_IDX">Initial value of the ANALYZECONFIG_IDX property.</param>
 public static T_OE_ANALYZECONFIG CreateT_OE_ANALYZECONFIG(global::System.Int32 aNALYZECONFIG_IDX)
 {
     T_OE_ANALYZECONFIG t_OE_ANALYZECONFIG = new T_OE_ANALYZECONFIG();
     t_OE_ANALYZECONFIG.ANALYZECONFIG_IDX = aNALYZECONFIG_IDX;
     return t_OE_ANALYZECONFIG;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the T_OE_ANALYZECONFIG EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToT_OE_ANALYZECONFIG(T_OE_ANALYZECONFIG t_OE_ANALYZECONFIG)
 {
     base.AddObject("T_OE_ANALYZECONFIG", t_OE_ANALYZECONFIG);
 }