コード例 #1
0
ファイル: Jobing.aspx.cs プロジェクト: yzheng16/C-project
 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");
 }