Пример #1
0
 private void OnBlogKeyUp(object sender, KeyEventArgs e)
 {
     //Event handler for new blog entry
     Cursor.Current = Cursors.WaitCursor;
     try {
         if (e.KeyCode == Keys.Enter)
         {
             BlogEntry entry = new BlogEntry();
             entry.Date    = DateTime.Now;
             entry.Comment = this.txtComment.Text;
             entry.UserID  = Environment.UserName;
             if (FreightGateway.AddBlogEntry(entry))
             {
                 this.txtComment.Clear();
                 lock (this.txtBlog) {
                     DispatchDataset ds = FreightGateway.ViewBlog();
                     refreshBlog(ds);
                 }
             }
         }
     }
     catch (Exception ex) { App.ReportError(ex, false, LogLevel.Warning); }
     finally { Cursor.Current = Cursors.Default; }
 }