Пример #1
0
        private void editButton_Click(object sender, RoutedEventArgs e)
        {
            if (editButton.Content.Equals("Dodaj zeszyt"))
            {
                if (!_issueFound)
                {
                    //dodajemy zeszyt (nie istnieje zeszyt o podanym numerze)
                    Issue issue = new Issue(_viewModel.WizardViewModel.SelectedJournal.InstitutionId,       //id_inst
                                            _viewModel.WizardViewModel.SelectedJournal.PublisherId,         //id_wyd
                                            _viewModel.WizardViewModel.SelectedJournal.IdWithinPublisher,   //id_serie
                                            null,                                                           //id_w_serii
                                            _seriesNumber,                                                  //nr_w_serii
                                            _publisherNumber,                                               //nr_w_wydawnictwie
                                            titleBox.Text,
                                            int.Parse(yearBox.Text),
                                            true,
                                            typeCombo.Text,
                                            typeNumberBox.Text);

                    ArchiverCentralRepository.Instance.SaveIssue(issue);
                }
                else
                {
                    //zmieniamy zeszyt juz istniejacy
                    Issue issue = new Issue(_viewModel.WizardViewModel.SelectedJournal.InstitutionId,       //id_inst
                                            _viewModel.WizardViewModel.SelectedJournal.PublisherId,         //id_wyd
                                            _viewModel.WizardViewModel.SelectedJournal.IdWithinPublisher,   //id_serie
                                            _viewModel.SelectedIssue.IdWithinJournal,                                                           //id_w_serii
                                            _seriesNumber,                                                  //nr_w_serii
                                            _publisherNumber,                                               //nr_w_wydawnictwie
                                            titleBox.Text,
                                            int.Parse(yearBox.Text),
                                            true,
                                            typeCombo.Text,
                                            typeNumberBox.Text);

                    ArchiverCentralRepository.Instance.UpdateIssue(issue);
                }
            }
            else
            {
                //edytujemy wybrany zeszyt
                numberWithinJournalBox.IsEnabled = false;
                numberWithinPublisherBox.IsEnabled = false;

                yearBox.IsEnabled = true;
                titleBox.IsEnabled = true;
                typeCombo.IsEnabled = true;
                typeNumberBox.IsEnabled = true;

                editButton.Content = "Dodaj zeszyt";
            }
        }
Пример #2
0
 public abstract IEnumerable<Article> GetArticlesFromIssue(Issue issue);
Пример #3
0
        private void FillIssueData(Issue issue)
        {
            if (issue == null)
            {
                _issueFound = false;
                numberWithinJournalBox.IsEnabled = false;
                numberWithinPublisherBox.IsEnabled = false;

                editButton.IsEnabled = true;
                cancelButton.IsEnabled = true;

                yearBox.IsEnabled = true;
                titleBox.IsEnabled = true;
                typeCombo.IsEnabled = true;
                typeNumberBox.IsEnabled = true;

                if (numberWithinJournalBox.Text != "")
                {
                    _seriesNumber = int.Parse(numberWithinJournalBox.Text);
                }
                if (numberWithinPublisherBox.Text != "")
                {
                    _publisherNumber = int.Parse(numberWithinPublisherBox.Text);
                }

                yearBox.Text = "";
                titleBox.Text = "";
                typeNumberBox.Text = "";

                _title = "";
                _type = default(IssueType);
                _typeNumber = "";
                _year = "";

                editButton.Content = "Dodaj zeszyt";

            }
            else
            {
                _issueFound = true;
                numberWithinJournalBox.Text = issue.NumberWithinJournal.ToString();
                numberWithinPublisherBox.Text = issue.NumberWithinPublisher.ToString();
                yearBox.Text = issue.YearOfPublication != null ? issue.YearOfPublication.ToString() : "";
                titleBox.Text = issue.Title != null ? issue.Title : "";
                _viewModel.IssueTypes.MoveCurrentTo(issue.Type);
                typeNumberBox.Text = issue.TypeNumber != null ? issue.TypeNumber.ToString() : "";

                _title = titleBox.Text;
                //TYPE??
                _type = issue.Type;
                _typeNumber = typeNumberBox.Text;
                _year = yearBox.Text;

                editButton.IsEnabled = true;
                cancelButton.IsEnabled = true;

                editButton.Content = "Edytuj zeszyt";
            }
        }
Пример #4
0
 public abstract bool UpdateIssue(Issue issue);
Пример #5
0
 public abstract bool DeleteIssue(Issue issue);
Пример #6
0
 public abstract string SaveIssue(Issue issue);
Пример #7
0
 public void AddIssue(Issue issue)
 {
     XmlNode node = this.CreateDatafield("830");
     XmlNode title = this.CreateSubfield(issue.Title, "a");
     XmlNode publishernumber = this.CreateSubfield(issue.NumberWithinPublisher.ToString(), "v");
     XmlNode issuenumber = this.CreateSubfield(issue.NumberWithinJournal.ToString(), "n");
     XmlNode date = this.CreateSubfield(issue.YearOfPublication.ToString(), "f");
     node.AppendChild(title);
     node.AppendChild(publishernumber);
     node.AppendChild(issuenumber);
     node.AppendChild(date);
     record.AppendChild(node);
 }
Пример #8
0
 public override bool UpdateIssue(Issue issue)
 {
     throw new NotImplementedException();
 }
Пример #9
0
 public override string SaveIssue(Issue issue)
 {
     throw new NotImplementedException();
 }
Пример #10
0
 public override IEnumerable<Article> GetArticlesFromIssue(Issue issue)
 {
     throw new NotImplementedException();
 }