Exemplo n.º 1
0
 protected void AddCommentButton_Click(object sender, EventArgs e)
 {
     MessageUserControl.TryRun(() =>
     {
         JobController control = new JobController();
         int serviceId         = int.Parse(ServiceDetailIdLabel.Text);
         string comment        = CommentTB.Text;
         if (string.IsNullOrWhiteSpace(comment))
         {
             throw new Exception("Must enter a comment first");
         }
         control.AddComment(serviceId, comment);
         CommentsLabel.Text += "; " + comment;
         CommentTB.Text      = "";
     }, "Comment added", "Comment successfully added");
 }