示例#1
0
 private void button_send_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(TextBox_title.Text))
     {
         MessageBox.Show("Enter title");
     }
     else if (String.IsNullOrEmpty(TextBox_body.Text))
     {
         MessageBox.Show("Enter message body");
     }
     else
     {
         string name;
         if (registrar != null)
         {
             name = registrar.Name;
         }
         else
         {
             name = ST.Name;
         }
         CollectiveMessage ms = new CollectiveMessage()
         {
             senderName = name, text = TextBox_body.Text, title = TextBox_title.Text
         };
         SettingDatabase.Add_Message(ms);
         TextBox_title.Clear();
         TextBox_body.Clear();
     }
 }