コード例 #1
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            if (cmbOwner.SelectedIndex == 0)
            {
                DialogParameters param = new DialogParameters();
                param.Header  = "Owner is required";
                param.Content = "Please specify the Owner";
                RadWindow.Alert(param);
                return;
            }
            else if (!dtAppointment.SelectedValue.HasValue)
            {
                DialogParameters param = new DialogParameters();
                param.Header  = "Appointment Time is required";
                param.Content = "Please specify the Appointment Time";
                RadWindow.Alert(param);
                return;
            }
            else if (dtAppointment.SelectedValue.Value < DateTime.Now)
            {
                DialogParameters param = new DialogParameters();
                param.Header  = "Invalid Appointment Time";
                param.Content = "The specified Appointment Time is in the past.\r\nPlease select another Appointment Time.";
                RadWindow.Alert(param);
                return;
            }
            else
            {
                BusyIndicator1.IsBusy      = true;
                BusyIndicator1.BusyContent = "Creating Estimate Revision...";

                _mrsClient.CreateStudioMRevisionCompleted += new EventHandler <CreateStudioMRevisionCompletedEventArgs>(mrsClient_CreateStudioMRevisionCompleted);
                _mrsClient.CreateStudioMRevisionAsync(_estimateRevisionId, Convert.ToInt32(cmbOwner.SelectedValue), dtAppointment.SelectedValue.Value, _estimateRevisionTypeId, (App.Current as App).CurrentUserId);
            }
        }