public static bool ReturnFile(Guid FileId) { string curUser = Thread.CurrentPrincipal.Identity.Name; string message = "File has been returned to you"; int fileForwardLevel = Convert.ToInt32(IgrssAdapters.FileForwardingAdapter.GetFileForwardLevel(FileId)); try { FileForwardTable ForwardDetail = IgrssAdapters.FileForwardingAdapter.GetFileForwardDetailsByLevel(FileId, fileForwardLevel); if (ForwardDetail.Rows.Count > 0) { FileForwardsRow row = ForwardDetail[0]; IgrssAlert Alert = WorkflowSupport.GetAlertById(row.FordwardedAlertId); if (fileForwardLevel > 1) { Guid GroupId = Guid.NewGuid(); WorkflowSupport.SendAlert(curUser, Alert.SentBy, Alert.Link, message, Alert.SessionData, GroupId); } else if (fileForwardLevel == 1) { WorkflowSupport.EnableAlert(Alert.AlertId); } WorkflowSupport.DeleteAlert(Alert.AlertId); IgrssAdapters.FileForwardingAdapter.SetFileReturned(FileId, fileForwardLevel); } return(true); } catch (Exception ex) { if (ExceptionPolicy.HandleException(ex, "DAL")) { throw; } } return(false); }
IgrssAlert DecodeAlert(AlertsRow row) { IgrssAlert alert = new IgrssAlert(); alert.AlertId = row.AlertId; alert.Message = row.Message; alert.IsActive = row.IsActive; alert.SentAt = row.SentAt; alert.SentBy = row.SentBy; alert.SentTo = row.SentTo; alert.Link = row.Link; XmlDocument doc = new XmlDocument(); doc.LoadXml(row.Info); alert.SessionData = WorkflowSupport.DeSerilizeDictionary(doc); return alert; }