Example #1
0
 public static int DeleteT_OE_ColumnConfig(int columnConfig_IDX)
 {
     using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
     {
         try
         {
             T_OE_COLUMNCONFIG r = new T_OE_COLUMNCONFIG();
             r = (from c in ctx.T_OE_COLUMNCONFIG where c.COLUMNCONFIG_IDX == columnConfig_IDX select c).FirstOrDefault();
             ctx.DeleteObject(r);
             ctx.SaveChanges();
             return 1;
         }
         catch
         {
             return 0;
         }
     }
 }
Example #2
0
        public static int InsertOrUpdateT_OE_ColumnConfig(global::System.Int32? cOLUMNCONFIG_IDX, global::System.String cOLUMN_NAME,
           global::System.String uNIT, global::System.Double mAXVALUE, global::System.Double mINVALUE,
           global::System.Boolean cOLUMNDONTSEND)
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                Boolean insInd = false;
                try
                {
                    T_OE_COLUMNCONFIG a = new T_OE_COLUMNCONFIG();

                    if (cOLUMNCONFIG_IDX != null)
                        a = (from c in ctx.T_OE_COLUMNCONFIG
                             where c.COLUMNCONFIG_IDX == cOLUMNCONFIG_IDX
                             select c).FirstOrDefault();

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

                    if (cOLUMN_NAME != null) a.COLUMN_NAME = cOLUMN_NAME;
                    if (uNIT != null) a.UNIT = uNIT;
                    a.MAX_VALUE = mAXVALUE;
                    a.MIN_VALUE = mINVALUE;
                    a.COLUMN_DONT_SEND = cOLUMNDONTSEND;

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

                    ctx.SaveChanges();

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