public static string ShowPerformObjects(long requestID) { string result = string.Empty; var items = PerformServices.GetList(requestID); if (CommonSessions.UserID > 0 && (CommonSessions.UserID == requestID || TrackingServices.GetList(requestID).Select(item => item.UserID).Contains(CommonSessions.UserID) || CommonSessions.Role == UserRole.Administrator)) { foreach (var item in items) { result += $"{item.Agency.AgencyName} (<a href=\"#\" data-toggle=\"modal\" data-target=\".my-modal-lg\" data-link=\"{Redirector.GetLink("Province/XacNhanHoanThanh.aspx", "id", item.PerformID)}\">{item.StatusString}</a>)<br/>"; } } else { foreach (var item in items) { result += $"{item.Agency.AgencyName} ({item.StatusString})<br/>"; } } return(result); }
public static bool CheckReportPermission(long requestID) { var request = RequestServices.GetById(requestID); if (CommonSessions.UserID > 0 && (request.CreatedBy == CommonSessions.UserID || request.Trackings.Any(t => t.UserID == CommonSessions.UserID) || CommonSessions.Role == UserRole.Administrator)) { return(true); } return(CommonSessions.AgencyID > 0 && PerformServices.GetList(requestID).Any(item => item.AgencyID == CommonSessions.AgencyID)); }