//*****************USERS **********************************
        public static int CreateT_OE_USERS(global::System.String uSER_ID, global::System.String pWD_HASH, global::System.String pWD_SALT, global::System.String fNAME, global::System.String lNAME, global::System.String eMAIL, global::System.Boolean aCT_IND, global::System.Boolean iNITAL_PWD_FLAG, global::System.DateTime? lASTLOGIN_DT, global::System.String pHONE, global::System.String pHONE_EXT, global::System.String cREATE_USER)
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                try
                {
                    T_OE_USERS u = new T_OE_USERS();
                    u.USER_ID = uSER_ID;
                    u.PWD_HASH = pWD_HASH;
                    u.PWD_SALT = pWD_SALT;
                    u.FNAME = fNAME;
                    u.LNAME = lNAME;
                    u.EMAIL = eMAIL;
                    u.ACT_IND = aCT_IND;
                    u.INITAL_PWD_FLAG = iNITAL_PWD_FLAG;
                    u.EFFECTIVE_DT = System.DateTime.Now;
                    u.LASTLOGIN_DT = lASTLOGIN_DT;
                    u.PHONE = pHONE;
                    u.PHONE_EXT = pHONE_EXT;
                    u.CREATE_DT = System.DateTime.Now;
                    u.CREATE_USERID = cREATE_USER;

                    ctx.AddToT_OE_USERS(u);
                    ctx.SaveChanges();
                    return u.USER_IDX;
                }
                catch (Exception ex)
                {
                    return 0;
                }
            }
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the T_OE_USERS EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToT_OE_USERS(T_OE_USERS t_OE_USERS)
 {
     base.AddObject("T_OE_USERS", t_OE_USERS);
 }
 /// <summary>
 /// Create a new T_OE_USERS object.
 /// </summary>
 /// <param name="uSER_IDX">Initial value of the USER_IDX property.</param>
 /// <param name="uSER_ID">Initial value of the USER_ID property.</param>
 /// <param name="pWD_HASH">Initial value of the PWD_HASH property.</param>
 /// <param name="pWD_SALT">Initial value of the PWD_SALT property.</param>
 /// <param name="fNAME">Initial value of the FNAME property.</param>
 /// <param name="lNAME">Initial value of the LNAME property.</param>
 /// <param name="iNITAL_PWD_FLAG">Initial value of the INITAL_PWD_FLAG property.</param>
 /// <param name="eFFECTIVE_DT">Initial value of the EFFECTIVE_DT property.</param>
 /// <param name="aCT_IND">Initial value of the ACT_IND property.</param>
 public static T_OE_USERS CreateT_OE_USERS(global::System.Int32 uSER_IDX, global::System.String uSER_ID, global::System.String pWD_HASH, global::System.String pWD_SALT, global::System.String fNAME, global::System.String lNAME, global::System.Boolean iNITAL_PWD_FLAG, global::System.DateTime eFFECTIVE_DT, global::System.Boolean aCT_IND)
 {
     T_OE_USERS t_OE_USERS = new T_OE_USERS();
     t_OE_USERS.USER_IDX = uSER_IDX;
     t_OE_USERS.USER_ID = uSER_ID;
     t_OE_USERS.PWD_HASH = pWD_HASH;
     t_OE_USERS.PWD_SALT = pWD_SALT;
     t_OE_USERS.FNAME = fNAME;
     t_OE_USERS.LNAME = lNAME;
     t_OE_USERS.INITAL_PWD_FLAG = iNITAL_PWD_FLAG;
     t_OE_USERS.EFFECTIVE_DT = eFFECTIVE_DT;
     t_OE_USERS.ACT_IND = aCT_IND;
     return t_OE_USERS;
 }
 public static int DeleteT_OE_USERS(int idx)
 {
     using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
     {
         try
         {
             T_OE_USERS row = new T_OE_USERS();
             row = (from c in ctx.T_OE_USERS where c.USER_IDX == idx select c).First();
             ctx.DeleteObject(row);
             ctx.SaveChanges();
             return 1;
         }
         catch (Exception ex)
         {
             return 0;
         }
     }
 }
 public static int UpdateT_OE_USERSDefaultOrg(int idx, string dEFAULT_ORG_ID)
 {
     using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
     {
         try
         {
             T_OE_USERS row = new T_OE_USERS();
             row = (from c in ctx.T_OE_USERS where c.USER_IDX == idx select c).First();
             if (dEFAULT_ORG_ID != null) row.DEFAULT_ORG_ID = dEFAULT_ORG_ID;
             ctx.SaveChanges();
             return row.USER_IDX;
         }
         catch (Exception ex)
         {
             return 0;
         }
     }
 }
        public static int UpdateT_OE_USERS(int idx, string newPWD_HASH, string newPWD_SALT, string newFNAME, string newLNAME, string newEMAIL, bool? newACT_IND, bool? newINIT_PWD_FLG, DateTime? newEFF_DATE, DateTime? newLAST_LOGIN_DT, string newPHONE, string newPHONE_EXT, string newMODIFY_USR)
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                try
                {
                    T_OE_USERS row = new T_OE_USERS();
                    row = (from c in ctx.T_OE_USERS where c.USER_IDX == idx select c).First();

                    if (newPWD_HASH != null)
                        row.PWD_HASH = newPWD_HASH;

                    if (newPWD_SALT != null)
                        row.PWD_SALT = newPWD_SALT;

                    if (newFNAME != null)
                        row.FNAME = newFNAME;

                    if (newLNAME != null)
                        row.LNAME = newLNAME;

                    if (newEMAIL != null)
                        row.EMAIL = newEMAIL;

                    if (newACT_IND != null)
                        row.ACT_IND = (bool)newACT_IND;

                    if (newINIT_PWD_FLG != null)
                        row.INITAL_PWD_FLAG = (bool)newINIT_PWD_FLG;

                    if (newEFF_DATE != null)
                        row.EFFECTIVE_DT = (DateTime)newEFF_DATE;

                    if (newLAST_LOGIN_DT != null)
                        row.LASTLOGIN_DT = (DateTime)newLAST_LOGIN_DT;

                    if (newPHONE != null)
                        row.PHONE = newPHONE;

                    if (newPHONE_EXT != null)
                        row.PHONE_EXT = newPHONE_EXT;

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

                    row.MODIFY_DT = System.DateTime.Now;

                    ctx.SaveChanges();
                    return row.USER_IDX;
                }
                catch (Exception ex)
                {
                    return 0;
                }
            }
        }