Example #1
0
        private void eventHandlerBckWrk_DoWork(object sender, DoWorkEventArgs e)
        {
            string description = (string)e.Argument;

            ServiceReference1.EventServiceClient eventService = new EventServiceClient();
            var checkedRecurringOption = rbtPanel.Controls.OfType <RadioButton>()
                                         .FirstOrDefault(r => r.Checked);

            if (checkedRecurringOption == null || txtEvent.Text.Trim() == "" || dateEvents.Text.Trim() == "")
            {
                MessageBox.Show("Please enter reqired fields", "Error", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }
            eventService.SaveEvent(txtEvent.Text, description, dateEvents.Text, checkedRecurringOption.Text, MainView.file);
            e.Result = "Success";
        }