/// <summary> /// gets last change made to issue /// </summary> /// <param name="issueId">issue id</param> /// <returns>last change of issue</returns> public UserChangeModel GetLastChange(int issueId) { UserChangeModel ucm = new UserChangeModel(); ucm = ucm.ToModel(ChangesOp.LastChange(issueId)); if (userList == null || userList.Count == 0) { GetAllUsers(); } ucm.Name = userList.Find(x => x.Id == ucm.UserId).Name; return(ucm); }
/// <summary> /// gets last 100 changes made to issue /// </summary> /// <param name="issueId">issue id</param> /// <returns>list of last 100 changes made to issue</returns> public List <UserChangeModel> GetLast100Changes(int issueId) { List <UserChangeModel> changesList; UserChangeModel ucm = new UserChangeModel(); if (userList == null || userList.Count == 0) { GetAllUsers(); } changesList = ucm.ToModelList(ChangesOp.GetLast100Changes(issueId), ucm); foreach (UserChangeModel change in changesList) { change.Name = userList.Find(x => x.Id == change.UserId).Name; } return(changesList); }
/// <summary> /// returns users with the count of changes they made /// </summary> /// <param name="issueId"></param> /// <returns>list of key value pairs, key is the userId and value the count of changes</returns> public List <KeyValuePair <UserShortModel, int> > GetAllChangeCountsByUser(int issueId) { List <KeyValuePair <UserShortModel, int> > list = new List <KeyValuePair <UserShortModel, int> >(); List <KeyValuePair <int, int> > countList = ChangesOp.GetAllChangeCountsByUser(issueId); KeyValuePair <UserShortModel, int> userCntKvp; if (userList == null || userList.Count() == 0) { GetAllUsers(); } foreach (KeyValuePair <int, int> cntKvp in countList) { userCntKvp = new KeyValuePair <UserShortModel, int>(userList.Find(x => x.Id == cntKvp.Key), cntKvp.Value); list.Add(userCntKvp); } return(list); }
/// <summary> /// gets list of users with the count of changes made to issue /// </summary> /// <param name="issueId">issue id</param> /// <returns>list of key value pairs (key: user name, value: count of changes made to issue)</returns> public List <KeyValuePair <string, int> > GetGroupActivity(int issueId) { return(ChangesOp.GetGroupActivity(issueId)); }
/// <summary> /// gets a list of user changes /// </summary> /// <param name="issueId">issue id</param> /// <param name="userId">user id</param> /// <returns>list of user changes</returns> public List <UserChangeModel> GetUserChanges(int issueId, int userId) { UserChangeModel ucm = new UserChangeModel(); return(ucm.ToModelList(ChangesOp.GetUserChanges(issueId, userId), ucm)); }
/// <summary> /// returns the count of changes made by user /// </summary> /// <param name="issueId"></param> /// <param name="userId"></param> /// <returns></returns> public int GetUserChangesCount(int issueId, int userId) { return(ChangesOp.GetUserChangesCount(issueId, userId)); }
/// <summary> /// returns users with the count of changes they made /// </summary> /// <param name="issueId"></param> /// <returns>list of key value pairs, key is the userId and value the count of changes</returns> public KeyValuePair <string, int> UserWithMostChanges(int issueId) { return(ChangesOp.UserWithMostChanges(issueId)); }