//*****************ROLES **********************************
        public static int CreateT_OE_ROLES(global::System.String rOLE_NAME, global::System.String rOLE_DESC, global::System.String cREATE_USER = "******")
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                try
                {
                    T_OE_ROLES r = new T_OE_ROLES();
                    r.ROLE_NAME = rOLE_NAME;
                    r.ROLE_DESC = rOLE_DESC;
                    r.CREATE_DT = System.DateTime.Now;
                    r.CREATE_USERID = cREATE_USER;

                    ctx.AddToT_OE_ROLES(r);
                    ctx.SaveChanges();
                    return 1;
                }
                catch (Exception ex)
                {
                    return 0;
                }
            }
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the T_OE_ROLES EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToT_OE_ROLES(T_OE_ROLES t_OE_ROLES)
 {
     base.AddObject("T_OE_ROLES", t_OE_ROLES);
 }
 /// <summary>
 /// Create a new T_OE_ROLES object.
 /// </summary>
 /// <param name="rOLE_IDX">Initial value of the ROLE_IDX property.</param>
 /// <param name="rOLE_NAME">Initial value of the ROLE_NAME property.</param>
 /// <param name="rOLE_DESC">Initial value of the ROLE_DESC property.</param>
 public static T_OE_ROLES CreateT_OE_ROLES(global::System.Int32 rOLE_IDX, global::System.String rOLE_NAME, global::System.String rOLE_DESC)
 {
     T_OE_ROLES t_OE_ROLES = new T_OE_ROLES();
     t_OE_ROLES.ROLE_IDX = rOLE_IDX;
     t_OE_ROLES.ROLE_NAME = rOLE_NAME;
     t_OE_ROLES.ROLE_DESC = rOLE_DESC;
     return t_OE_ROLES;
 }
        public static int UpdateT_VCCB_ROLE(int idx, string newROLE_NAME, string newROLE_DESC, string newMODIFY_USR)
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                try
                {
                    T_OE_ROLES row = new T_OE_ROLES();
                    row = (from c in ctx.T_OE_ROLES where c.ROLE_IDX == idx select c).First();

                    if (newROLE_NAME != null)
                        row.ROLE_NAME = newROLE_NAME;

                    if (newROLE_DESC != null)
                        row.ROLE_DESC = newROLE_DESC;

                    if (newMODIFY_USR != null)
                        row.MODIFY_USERID = newMODIFY_USR;

                    row.MODIFY_DT = System.DateTime.Now;

                    ctx.SaveChanges();
                    return 1;
                }
                catch (Exception ex)
                {
                    return 0;
                }
            }
        }
 public static int DeleteT_VCCB_ROLE(int idx)
 {
     using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
     {
         try
         {
             T_OE_ROLES row = new T_OE_ROLES();
             row = (from c in ctx.T_OE_ROLES where c.ROLE_IDX == idx select c).First();
             ctx.DeleteObject(row);
             ctx.SaveChanges();
             return 1;
         }
         catch (Exception ex)
         {
             return 0;
         }
     }
 }