Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public static WebMethodResponse AccessComments(int requestId, CommentsType action, string comments)
 {
     var accessReq = new AccessRequest(requestId);
     comments = comments.FromJSONStringToObj<string>();
     return accessReq.AddComment(comments, action);
 }
Ejemplo n.º 3
0
Archivo: UI.cs Proyecto: apxlee/SAP
        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;
        }
Ejemplo n.º 4
0
 private void verifyWorkflowComment(SNAP_Workflow wf, CommentsType type)
 {
     Assert.IsTrue(wf.SNAP_Workflow_Comments.Count(c => c.commentTypeEnum == (byte)type) == 1);
 }
Ejemplo n.º 5
0
 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
     });
 }
Ejemplo n.º 6
0
 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;
 }