private static string GetXmlCommentsPath(CommentsType commentsType) { var rootDir = System.AppDomain.CurrentDomain.BaseDirectory; var path = string.Empty; switch (commentsType) { case CommentsType.WebApi: path = string.Format(@"{0}bin\LotteryService.WebApi.XML", rootDir); break; case CommentsType.Application: path = string.Format(@"{0}bin\LotteryService.Application.XML", rootDir); break; } return(path); }
public static WebMethodResponse AccessComments(int requestId, CommentsType action, string comments) { var accessReq = new AccessRequest(requestId); comments = comments.FromJSONStringToObj<string>(); return accessReq.AddComment(comments, action); }
private static string MakeFriendlyCommentAudience(CommentsType commentType) { string audienceName = string.Empty; switch (commentType) { case CommentsType.Access_Notes_AccessTeam: audienceName = "Access & Identity Management"; break; case CommentsType.Access_Notes_ApprovingManager: audienceName = "Approving Managers"; break; case CommentsType.Access_Notes_SuperUser: case CommentsType.Access_Notes_Requestor: default: audienceName = "Requestor"; break; } return audienceName; }
private void verifyWorkflowComment(SNAP_Workflow wf, CommentsType type) { Assert.IsTrue(wf.SNAP_Workflow_Comments.Count(c => c.commentTypeEnum == (byte)type) == 1); }
private void addAccessTeamComment(SNAP_Workflow accessTeamWF, string comment, CommentsType type) { //comment = comment.Replace("<br />", string.Empty); accessTeamWF.SNAP_Workflow_Comments.Add(new SNAP_Workflow_Comment() { commentText = comment, commentTypeEnum = (byte)type, createdDate = DateTime.Now }); }
public WebMethodResponse AddComment(string comment, CommentsType type) { WebMethodResponse resp = new WebMethodResponse(); comment = comment.Replace("<br />", string.Empty); try { using (var db = new SNAPDatabaseDataContext()) { var req = db.SNAP_Requests.Single(r => r.pkId == _id); req.SNAP_Request_Comments.Add(new SNAP_Request_Comment() { commentText = comment, commentTypeEnum = (byte)type, createdDate = DateTime.Now }); db.SubmitChanges(); resp = new WebMethodResponse(true, "Add Comment", "Success"); } } catch (Exception ex) { Logger.Fatal("AccessRequest - AddComment, Message:" + ex.Message + ", StackTrace: " + ex.StackTrace); resp = new WebMethodResponse(false, "Add Comment Exception", ex.Message); } return resp; }