示例#1
0
 /// <summary>
 /// Helper methods to display information in the Results textbox.
 /// </summary>
 private void ResultsClear()
 {
     TextBoxResults.Clear();
     TextBoxLeadID.Clear();
     TextBoxCapturedBy.Clear();
     TextBoxCapturedDate.Clear();
     TextBoxRegID.Clear();
     TextBoxFirstName.Clear();
     TextBoxLastName.Clear();
     TextBoxTitle.Clear();
     TextBoxCompany.Clear();
     TextBoxCompany2.Clear();
     TextBoxAddress.Clear();
     TextBoxAddress2.Clear();
     TextBoxAddress3.Clear();
     TextBoxCity.Clear();
     TextBoxStateCode.Clear();
     TextBoxZipCode.Clear();
     TextBoxCountryCode.Clear();
     TextBoxEmail.Clear();
     TextBoxPhone.Clear();
     TextBoxPhoneExt.Clear();
     TextBoxFax.Clear();
     TextBoxNotes.Clear();
     dgvDemographics.DataSource = null;
 }
示例#2
0
 private void BtnSend_Click(object sender, EventArgs e)
 {
     if (TextBoxTitle.Text.Length == 0)
     {
         MessageBox.Show("공지 제목을 적어 주세요", "알림", MessageBoxButtons.OK, MessageBoxIcon.Information);
         TextBoxTitle.Focus();
         return;
     }
     if (richTextBoxContent.Text.Length != 0)
     {
         String    NoticeTime = DateTime.Now.ToString();
         NoticeObj obj        = new NoticeObj();
         obj.IsEmergency = ToggleButtonNormalNotice.Pressed;
         obj.Title       = TextBoxTitle.Text;
         obj.Content     = richTextBoxContent.Text;
         obj.NoticeTime  = Utils.TimeKey();
         NoticeRegisterRequested(this, new CustomEventArgs(obj));
         Close();
     }
     else
     {
         MessageBox.Show("공지할 내용을 적어 주세요", "알림", MessageBoxButtons.OK, MessageBoxIcon.Information);
         richTextBoxContent.Focus();
     }
 }
        private void AddTask(object sender, MouseButtonEventArgs e)
        {
            if (TextBoxTitle.Text == "")
            {
                TextBoxTitle.Focus();
            }
            else if (PickerDate.SelectedDate == null || PickerHeureDebut.SelectedTime == null || PickerHeureFin.SelectedTime == null)
            {
                MessageBox.Show("Veuillez choisir la date exacte");
            }
            else if ((ComboBoxPriorité.SelectedIndex != 0) && (ComboBoxPriorité.SelectedIndex != 1) && (ComboBoxPriorité.SelectedIndex != 2))
            {
                MessageBox.Show("Veuillez choisir la priorité");
            }
            else if (((string)((ComboBoxItem)ComboBoxActivities.SelectedItem).DataContext) == "Activité scolaire" && DataSupervisor.ds.user.JoursFeries.Keys.Contains(PickerDate.SelectedDate.Value))
            {
                MessageBox.Show("Le jour choisit est ferie");
            }
            else
            {
                Tache    t           = new Tache();
                DateTime?selectedDay = PickerDate.SelectedDate;
                DateTime dateDebut   = new DateTime(selectedDay.Value.Year, selectedDay.Value.Month, selectedDay.Value.Day, PickerHeureDebut.SelectedTime.Value.Hour, PickerHeureDebut.SelectedTime.Value.Minute, PickerHeureDebut.SelectedTime.Value.Second);
                DateTime dateFin     = new DateTime(selectedDay.Value.Year, selectedDay.Value.Month, selectedDay.Value.Day, PickerHeureFin.SelectedTime.Value.Hour, PickerHeureFin.SelectedTime.Value.Minute, PickerHeureFin.SelectedTime.Value.Second);
                t.dateDebut = dateDebut;
                t.dateFin   = dateFin;
                foreach (String s in this.files)
                {
                    t.Fichiers.Add(s);
                }
                t.title   = TextBoxTitle.Text;
                t.Details = TextBoxDescription.Text;
                switch (ComboBoxPriorité.SelectedIndex)
                {
                case 0:
                    t.priorite = "Urgente";
                    break;

                case 1:
                    t.priorite = "Normale";
                    break;

                case 2:
                    t.priorite = "Basse";
                    break;

                default:
                    return;
                }
                t.Activitee = (string)((ComboBoxItem)ComboBoxActivities.SelectedItem).DataContext;
                t.Alarms    = new List <Notif>();
                foreach (KeyValuePair <Chip, Notif> n in NotificationDict)
                {
                    t.Alarms.Add(n.Value);
                }

                DataSupervisor.ds.AddTache(t);
                windowParent.Close();
            }
        }
        private void EditBook_Clicked(object sender, RoutedEventArgs e)
        {
            int number;

            if (String.IsNullOrEmpty(TextBoxYear.Text) || String.IsNullOrEmpty(TextBoxAuthor.Text) || String.IsNullOrEmpty(TextBoxTitle.Text))
            {
                MessageBox.Show("non of fields can be empty");
            }
            else if ((!(Int32.TryParse(TextBoxYear.Text, out number))))
            {
                MessageBox.Show("The year must be integer");
            }
            else if (number < 10 || number > 3000)
            {
                MessageBox.Show("The age must be between 10 and 3000");
            }
            else
            {
                BindingExpression author = TextBoxAuthor.GetBindingExpression(TextBox.TextProperty);
                BindingExpression title  = TextBoxTitle.GetBindingExpression(TextBox.TextProperty);
                BindingExpression year   = TextBoxYear.GetBindingExpression(TextBox.TextProperty);

                author.UpdateSource();
                title.UpdateSource();
                year.UpdateSource();
                mainVM.BooksView.Refresh();
                mainVM.UpdateYears();
                this.Close();
            }
        }
示例#5
0
        private async void ShowPost(object sender, SelectionChangedEventArgs e)
        {
            if (!(TitleList.SelectedValue is Post selectedPost))
            {
                return;
            }

            DropState();

            var dbPost = await _postService.Get(selectedPost.Id);

            _currentPost      = selectedPost;
            _currentPost.Body = dbPost.Body;

            TextBoxTitle.Text = _currentPost.Title;
            Display.Document.SetText(TextSetOptions.FormatRtf, _currentPost.Body);

            BodyStackPanel.Visibility = Visibility.Visible;
            TextBoxTitle.Visibility   = Visibility.Visible;
            BodySearchBox.Visibility  = Visibility.Visible;

            if (TextBoxTitle.Text == Constant.DefaultTitle)
            {
                TextBoxTitle.Focus(FocusState.Programmatic);
                TextBoxTitle.SelectAll();
            }

            ClosePaneButton.Visibility = Visibility;
        }
示例#6
0
        private void Add_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            SmpUcFormStateLabel.CurrentState = FormCurrentState.Add;
            var newItem = new City
            {
                Title = ResourceAccessor.Labels.GetString("New")
            };

            Cities.Add(newItem);
            DataGridCities.SelectedItem = newItem;
            CollectionViewSource.GetDefaultView(DataGridCities.ItemsSource)?.Refresh();
            DataGridCities.ScrollIntoView(newItem);
            TextBoxTitle.Focus();
        }
示例#7
0
 private bool IsCheckInput()
 {
     if (string.IsNullOrEmpty(this.TextBoxTitle.Text.Trim()))
     {
         MessageBox.Show("视频标题不能为空!", "提示");
         TextBoxTitle.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(this.TextFrontImg.GetUrl().Trim()))
     {
         MessageBox.Show("封面图不能为空!", "提示");
         TextFrontImg.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(this.TextVideo.GetUrl().Trim()))
     {
         MessageBox.Show("视频信息不能为空!", "提示");
         TextVideo.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(this.TextVideoDuration.Text.Trim()))
     {
         MessageBox.Show("视频时长不能为空!", "提示");
         TextVideoDuration.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(this.TextBrief.Text.Trim()))
     {
         MessageBox.Show("简易描述不能为空!", "提示");
         TextBrief.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(this.TextIntro.Text.Trim()))
     {
         MessageBox.Show("详细描述不能为空!", "提示");
         TextIntro.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(this.ArtTags.Label1.Trim()))
     {
         MessageBox.Show("艺术标签不能为空!", "提示");
         ArtTags.Focus();
         return(false);
     }
     return(true);
 }
示例#8
0
 // Private Functions
 // -----------------
 private void SetMovieSelection(bool clear)
 {
     // set/disable next button
     ButtonNext.Enabled = !clear;
     if (clear)
     {
         PictureBoxMovie.BackgroundImage = null;
         TextBoxTitle.Clear();
         TextBoxCategory.Clear();
         TextBoxCost.Clear();
         // confirm selectedMovie is null if we're clearing
         selectedMovie          = null;
         Program.MovieSelection = null;
     }
     else
     {
         PictureBoxMovie.BackgroundImage = selectedMovie.Poster;
         TextBoxTitle.Text      = selectedMovie.Title;
         TextBoxCategory.Text   = selectedMovie.Genre;
         TextBoxCost.Text       = "$ " + selectedMovie.Price.ToString();
         Program.MovieSelection = selectedMovie;
     }
 }
示例#9
0
 private void Edit_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     SmpUcFormStateLabel.CurrentState = FormCurrentState.Edit;
     TextBoxTitle.Focus();
 }