private void Save()
        {
            try
            {
                if (string.IsNullOrEmpty(Comment))
                {
                    throw new Exception("The comment cannot be empty.");
                }

                Data = new Core.Comment()
                {
                    Text = Comment,
                };

                //Returns a List and then API checks if it has ID, if yes update, else add

                if (IsEdit)
                {
                    Data.CommentID = existing.CommentID;
                }
                else
                {
                    Data.Created = DateTime.Now;
                }

                Cancelled = false;
                window.Close();
            }
            catch (Exception e)
            {
                MessageBoxFactory.ShowError(e);
            }
        }
Exemple #2
0
 public void Update(Core.Comment Comment)
 {
     _repository.Update(Comment);
 }