Ejemplo n.º 1
0
 public DBContextResult <object> Insert(TRN_Notes p_TRN_Notes)
 {
     return(ExecuteDALMethod <TRN_Notes, object>(db, (DataContext, P_TRN_Notes) =>
     {
         db.TRN_Notes.Add(P_TRN_Notes);
         db.SaveChanges();
         return null;
     }, p_TRN_Notes));
 }
Ejemplo n.º 2
0
 public bool SaveNewPassword(string p_Email, string NewHashedPassword)
 {
     try
     {
         MST_UserInfo MST_UserInfo = db.MST_UserInfo.FirstOrDefault(x => x.Email.Equals(p_Email));
         MST_UserInfo.Password = NewHashedPassword;
         db.SaveChanges();
         return true;
     }
     catch (Exception ex)
     {
         new LogError(ex);
         return false;
     }
 }
 public bool AddOrRemoveAdmin(List <string> lstUserIds, bool p_IsAdmin)
 {
     try
     {
         foreach (var UserId in lstUserIds)
         {
             MST_UserInfo User = db.MST_UserInfo.Find(Convert.ToInt32(UserId));
             User.IsAdmin = p_IsAdmin;
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception ex)
     {
         new LogError(ex);
         return(false);
     }
 }