Esempio n. 1
0
        public bool DeleteUser(GroupUserIdModel model)
        {
            try
            {
                var groupUser = _db.GroupUsers.First(x => x.GroupId == model.GroupId && x.UserId == model.UserId);

                _db.GroupUsers.Remove(groupUser);
                _db.SaveChanges();

                return(true);
            }
            catch (Exception ex)
            {
                JavaScriptSerializer js = new JavaScriptSerializer();
                string json             = js.Serialize(model);
                Log.Error("Group - DeleteUser- " + json, ex);
                throw;
            }
        }
Esempio n. 2
0
        public bool UpdateLastSeen(GroupUserIdModel model)
        {
            try
            {
                var groupUser = _db.GroupUsers.First(x => x.GroupId == model.GroupId && x.UserId == model.UserId);

                groupUser.LastSeenOn = UnixTimeBaseClass.UnixTimeNow;

                _db.Entry(groupUser).State = EntityState.Modified;
                _db.SaveChanges();

                return(true);
            }
            catch (Exception ex)
            {
                JavaScriptSerializer js = new JavaScriptSerializer();
                string json             = js.Serialize(model);
                Log.Error("Group - UpdateLastSeen - " + json, ex);
                throw;
            }
        }
Esempio n. 3
0
 public long GetLastSeen(GroupUserIdModel model)
 {
     return(_db.GroupUsers.First(x => x.GroupId == model.GroupId && x.UserId == model.UserId).LastSeenOn);
 }
Esempio n. 4
0
 public bool DeleteUser(GroupUserIdModel model)
 {
     return(_groupUser.DeleteUser(model));
 }
Esempio n. 5
0
 public bool UpdateLastSeen(GroupUserIdModel model)
 {
     return(_groupUser.UpdateLastSeen(model));
 }