Ejemplo n.º 1
0
 private void AddOtherComment(object obj)
 {
     try
     {
         if (!string.IsNullOrEmpty(OtherCOMMENT))
         {
             string Other = OtherNUM != 0 ? $"NUM {OtherNUM} {OtherCOMMENT}" : OtherCOMMENT;
             if (EditingComment == null)
             {
                 if (TanComments.Where(tc => tc.Num != 0 && tc.Num == OtherNUM).Count() == 0)
                 {
                     TanComments.Add(new Comments
                     {
                         Id           = Guid.NewGuid(),
                         Num          = OtherNUM,
                         Comment      = OtherCOMMENT,
                         CommentType  = CommentType.OTHER,
                         Length       = Other.Length,
                         TotalComment = Other
                     });
                     ClearVM(null);
                 }
                 else
                 {
                     MessageBox.Show($"For Num {OtherNUM} comments already added. Duplicate Comments are not Allowed", "Reactions", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
             else if (EditingComment.CommentType == CommentType.OTHER)
             {
                 Comments comment = (from c in TanComments.ToList()
                                     where c.Id == EditingComment.Id
                                     select c).FirstOrDefault();
                 if (comment != null)
                 {
                     comment.Comment      = OtherCOMMENT;
                     comment.CommentType  = CommentType.OTHER;
                     comment.TotalComment = Other;
                     comment.Length       = Other.Length;
                     comment.Num          = OtherNUM;
                     ClearVM(null);
                 }
             }
             else
             {
                 MessageBox.Show("You Do Not Add New Comment in Edit Mode. Please Update " + EditingComment.CommentType + " First.", "Reactions", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
         else
         {
             MessageBox.Show("Comments are manadatory to Save TanComments", "Reactions", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         Log.This(ex);
     }
 }
Ejemplo n.º 2
0
 private void AddCASComment(object obj)
 {
     try
     {
         if (!string.IsNullOrEmpty(CasConsultedCOMMENT))
         {
             if (EditingComment == null)
             {
                 TanComments.Add(new Comments {
                     Id = Guid.NewGuid(), Comment = CasConsultedCOMMENT, CommentType = CommentType.CAS, Length = CasConsultedCOMMENT.Length, TotalComment = CasConsultedCOMMENT
                 });
                 ClearVM(null);
             }
             else if (EditingComment.CommentType == CommentType.CAS)
             {
                 Comments comment = (from c in TanComments.ToList()
                                     where c.Id == EditingComment.Id
                                     select c).FirstOrDefault();
                 if (comment != null)
                 {
                     comment.Comment      = CasConsultedCOMMENT;
                     comment.Length       = CasConsultedCOMMENT.Length;
                     comment.TotalComment = CasConsultedCOMMENT;
                     comment.CommentType  = CommentType.CAS;
                     ClearVM(null);
                 }
             }
             else
             {
                 MessageBox.Show("You Do Not Add New Comment in Edit Mode. Please Update " + EditingComment.CommentType + " First.", "Reactions", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
         else
         {
             MessageBox.Show("Comments are manadatory to Save TanComments", "Reactions", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         Log.This(ex);
     }
 }
Ejemplo n.º 3
0
 public void AddTanComment(string Comment, CommentType CommentType, string Column, string Figure, String FootNote, string Line, int Num, string Page, string Para, string Schemes, string Sheet, string Table, string TotalComment)
 {
     TanComments.Add(new Comments
     {
         Id           = Guid.NewGuid(),
         Comment      = Comment,
         CommentType  = CommentType,
         Length       = TotalComment.Length,
         Column       = Column,
         Figure       = Figure,
         FootNote     = FootNote,
         Line         = Line,
         Num          = Num,
         Page         = Page,
         Para         = Para,
         Schemes      = Schemes,
         Sheet        = Sheet,
         Table        = Table,
         TotalComment = TotalComment
     });
 }