Exemplo n.º 1
0
        //*****************USERS **********************************
        public static int CreateT_OE_USERS(string uSER_ID, string pWD_HASH, string pWD_SALT, string fNAME, string lNAME, string eMAIL, bool aCT_IND, bool iNITAL_PWD_FLAG,
                                           DateTime?lASTLOGIN_DT, string pHONE, string pHONE_EXT, int?cREATE_USERIDX)
        {
            using (EECIPEntities ctx = new EECIPEntities())
            {
                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_USERIDX  = cREATE_USERIDX;

                    ctx.T_OE_USERS.Add(u);
                    ctx.SaveChanges();
                    return(u.USER_IDX);
                }
                catch (Exception ex)
                {
                    db_Ref.LogEFException(ex);
                    throw ex;
                }
            }
        }
Exemplo n.º 2
0
 public static int DeleteT_OE_USERS(int idx)
 {
     using (EECIPEntities ctx = new EECIPEntities())
     {
         try
         {
             T_OE_USERS row = ctx.T_OE_USERS.First(i => i.USER_IDX == idx);
             ctx.T_OE_USERS.Remove(row);
             ctx.SaveChanges();
             return(1);
         }
         catch (Exception ex)
         {
             db_Ref.LogEFException(ex);
             return(0);
         }
     }
 }
Exemplo n.º 3
0
 public static int UpdateT_OE_USERS_WelcomeEmailSent(int idx)
 {
     using (EECIPEntities ctx = new EECIPEntities())
     {
         try
         {
             T_OE_USERS row = (from c in ctx.T_OE_USERS where c.USER_IDX == idx select c).First();
             row.NEW_USER_EMAIL_IND = true;
             ctx.SaveChanges();
             return(row.USER_IDX);
         }
         catch (Exception ex)
         {
             db_Ref.LogEFException(ex);
             return(0);
         }
     }
 }
Exemplo n.º 4
0
 public static int UpdateT_OE_USERS_UnlockGovernance(int idx)
 {
     using (EECIPEntities ctx = new EECIPEntities())
     {
         try
         {
             T_OE_USERS row = (from c in ctx.T_OE_USERS where c.USER_IDX == idx select c).First();
             row.ALLOW_GOVERNANCE = true;
             ctx.SaveChanges();
             return(row.USER_IDX);
         }
         catch (Exception ex)
         {
             db_Ref.LogEFException(ex);
             return(0);
         }
     }
 }
Exemplo n.º 5
0
 public static int UpdateT_OE_USERS_SyncInd(int idx, bool sYNC_IND)
 {
     using (EECIPEntities ctx = new EECIPEntities())
     {
         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();
             row.SYNC_IND = sYNC_IND;
             ctx.SaveChanges();
             return(1);
         }
         catch (Exception ex)
         {
             db_Ref.LogEFException(ex);
             return(0);
         }
     }
 }
Exemplo n.º 6
0
 public static int DeleteT_OE_USERS(int idx)
 {
     using (EECIPEntities ctx = new EECIPEntities())
     {
         try
         {
             T_OE_USERS row = ctx.T_OE_USERS.First(i => i.USER_IDX == idx);
             ctx.T_OE_USERS.Remove(row);
             ctx.SaveChanges();
             return(1);
         }
         catch (Exception ex)
         {
             //set to inactive if cannot delete
             UpdateT_OE_USERS(idx, null, null, null, null, null, false, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
             db_Ref.LogEFException(ex);
             return(0);
         }
     }
 }
Exemplo n.º 7
0
 public static int UpdateT_OE_USERS_Avatar(int idx, Byte[] UserAvatar)
 {
     using (EECIPEntities ctx = new EECIPEntities())
     {
         try
         {
             T_OE_USERS row = (from c in ctx.T_OE_USERS where c.USER_IDX == idx select c).First();
             if (UserAvatar != null)
             {
                 row.USER_AVATAR = UserAvatar;
             }
             ctx.SaveChanges();
             return(row.USER_IDX);
         }
         catch (Exception ex)
         {
             db_Ref.LogEFException(ex);
             return(0);
         }
     }
 }
Exemplo n.º 8
0
        public static int UpdateT_OE_USERS(int idx, string pWD_HASH, string pWD_SALT, string fNAME, string lNAME, string eMAIL, bool?aCT_IND, bool?iNIT_PWD_FLG, DateTime?eFF_DATE, DateTime?lAST_LOGIN_DT, string pHONE, string pHONE_EXT, int?mODIFY_USR, int?LogAtmpt, Guid?oRG_IDX, string jOB_TITLE)
        {
            using (EECIPEntities ctx = new EECIPEntities())
            {
                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 (pWD_HASH != null)
                    {
                        row.PWD_HASH = pWD_HASH;
                    }
                    if (pWD_SALT != null)
                    {
                        row.PWD_SALT = pWD_SALT;
                    }
                    if (fNAME != null)
                    {
                        row.FNAME = fNAME;
                    }
                    if (lNAME != null)
                    {
                        row.LNAME = lNAME;
                    }
                    if (eMAIL != null)
                    {
                        row.EMAIL = eMAIL;
                    }
                    if (aCT_IND != null)
                    {
                        row.ACT_IND = (bool)aCT_IND;
                    }
                    if (iNIT_PWD_FLG != null)
                    {
                        row.INITAL_PWD_FLAG = (bool)iNIT_PWD_FLG;
                    }
                    if (eFF_DATE != null)
                    {
                        row.EFFECTIVE_DT = (DateTime)eFF_DATE;
                    }
                    if (lAST_LOGIN_DT != null)
                    {
                        row.LASTLOGIN_DT = (DateTime)lAST_LOGIN_DT;
                    }
                    if (pHONE != null)
                    {
                        row.PHONE = pHONE;
                    }
                    if (pHONE_EXT != null)
                    {
                        row.PHONE_EXT = pHONE_EXT;
                    }
                    if (mODIFY_USR != null)
                    {
                        row.MODIFY_USERIDX = mODIFY_USR;
                    }
                    if (LogAtmpt != null)
                    {
                        row.LOG_ATMPT = LogAtmpt;
                    }
                    if (oRG_IDX != null)
                    {
                        row.ORG_IDX = oRG_IDX;
                    }
                    if (jOB_TITLE != null)
                    {
                        row.JOB_TITLE = jOB_TITLE;
                    }

                    row.MODIFY_DT = System.DateTime.Now;

                    ctx.SaveChanges();
                    return(1);
                }
                catch (Exception ex)
                {
                    db_Ref.LogEFException(ex);
                    return(0);
                }
            }
        }
Exemplo n.º 9
0
        public static int UpdateT_OE_USERS(int idx, string pWD_HASH, string pWD_SALT, string fNAME, string lNAME, string eMAIL, bool?aCT_IND, bool?iNIT_PWD_FLG,
                                           DateTime?eFF_DATE, DateTime?lAST_LOGIN_DT, string pHONE, string pHONE_EXT, int?mODIFY_USR, int?LogAtmpt, Guid?oRG_IDX, string jOB_TITLE,
                                           string lINKED_IN, bool?NodeAdmin, bool?ExcludeBadges, bool?nOTIFY_DISCUSSION_IND, bool?nOTIFY_BADGE_IND, bool?nOTIFY_NEWSLETTER)
        {
            using (EECIPEntities ctx = new EECIPEntities())
            {
                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 (pWD_HASH != null)
                    {
                        row.PWD_HASH = pWD_HASH;
                    }
                    if (pWD_SALT != null)
                    {
                        row.PWD_SALT = pWD_SALT;
                    }
                    if (fNAME != null)
                    {
                        row.FNAME = fNAME;
                    }
                    if (lNAME != null)
                    {
                        row.LNAME = lNAME;
                    }
                    if (eMAIL != null)
                    {
                        row.EMAIL = eMAIL;
                    }
                    if (aCT_IND != null)
                    {
                        row.ACT_IND = (bool)aCT_IND;
                    }
                    if (iNIT_PWD_FLG != null)
                    {
                        row.INITAL_PWD_FLAG = (bool)iNIT_PWD_FLG;
                    }
                    if (eFF_DATE != null)
                    {
                        row.EFFECTIVE_DT = (DateTime)eFF_DATE;
                    }
                    if (lAST_LOGIN_DT != null)
                    {
                        row.LASTLOGIN_DT = (DateTime)lAST_LOGIN_DT;
                    }
                    if (pHONE != null)
                    {
                        row.PHONE = pHONE;
                    }
                    if (pHONE_EXT != null)
                    {
                        row.PHONE_EXT = pHONE_EXT;
                    }
                    if (mODIFY_USR != null)
                    {
                        row.MODIFY_USERIDX = mODIFY_USR;
                    }
                    if (LogAtmpt != null)
                    {
                        row.LOG_ATMPT = LogAtmpt;
                    }
                    if (oRG_IDX != null)
                    {
                        row.ORG_IDX = oRG_IDX;
                    }
                    if (oRG_IDX == Guid.Empty)
                    {
                        row.ORG_IDX = null;                        //handling blanking out of OrgIDX
                    }
                    if (jOB_TITLE != null)
                    {
                        row.JOB_TITLE = jOB_TITLE;
                    }
                    if (lINKED_IN != null)
                    {
                        row.LINKEDIN = lINKED_IN;
                    }
                    if (NodeAdmin != null)
                    {
                        row.NODE_ADMIN = NodeAdmin ?? false;
                    }
                    if (ExcludeBadges != null)
                    {
                        row.EXCLUDE_POINTS_IND = (bool)ExcludeBadges;
                    }
                    if (nOTIFY_DISCUSSION_IND != null)
                    {
                        row.NOTIFY_DISCUSSION_IND = (bool)nOTIFY_DISCUSSION_IND;
                    }
                    if (nOTIFY_BADGE_IND != null)
                    {
                        row.NOTIFY_BADGE_IND = (bool)nOTIFY_BADGE_IND;
                    }
                    if (nOTIFY_NEWSLETTER != null)
                    {
                        row.NOTIFY_NEWSLETTER = (bool)nOTIFY_NEWSLETTER;
                    }


                    row.MODIFY_DT = System.DateTime.Now;

                    ctx.SaveChanges();
                    return(1);
                }
                catch (Exception ex)
                {
                    db_Ref.LogEFException(ex);
                    return(0);
                }
            }
        }