private void ButtonPrepare_Click(object sender, RoutedEventArgs e) { //Code, that prepares Bizz.TempIttLetterPdfData = new IttLetterPdfData(Bizz.TempProject, Bizz.TempBuilder, TextBoxAnswerDate.Text, TextBoxQuestionDate.Text, TextBoxCorrectionSheetDate.Text, Convert.ToInt32(TextBoxTimeSpan.Text), TextBoxMaterialUrl.Text, TextBoxConditionUrl.Text, TextBoxPassword.Text); // Code that save changes to the IttLetter PdfData int result = Bizz.CreateInDbReturnInt(Bizz.TempIttLetterPdfData); if (result > 0) { //Show Confirmation MessageBox.Show("Personlig del af Udbudsbrevet blev rettet", "Forbered Udbudsbrev", MessageBoxButton.OK, MessageBoxImage.Information); //Update IttLetter PdfData List Bizz.RefreshList("IttLetterPdfDataList"); //Reset UcIttLetterPreparePersonal ComboBoxCaseId.SelectedIndex = 0; Bizz.TempProject = new Project(); Bizz.TempBuilder = new Builder(); Bizz.TempIttLetterPdfData = new IttLetterPdfData(); } else { //Show error MessageBox.Show("Databasen returnerede en fejl. Personlig del af Tilbudsbrev blev ikke oprettet. Prøv igen.", "Forbered UdbudsBrev", MessageBoxButton.OK, MessageBoxImage.Information); } }
/// <summary> /// Method, that inserts an Offer to Db, and register it in Bizz.tempSubentrepeneur /// </summary> private void CreateIttLetter() { Bizz.TempIttLetter = new IttLetter(); int id = Bizz.CreateInDbReturnInt(Bizz.TempIttLetter); Bizz.TempIttLetter.SetId(id); Bizz.TempSubEntrepeneur.IttLetter = Bizz.TempIttLetter; }
/// <summary> /// Method, that adds multiple Receivers to Db /// </summary> /// <returns></returns> private void AddReceivers() { IttLetterReceiver tempReceiver; foreach (IndexedLegalEntity entity in ListBoxLegalEntities.SelectedItems) { tempReceiver = FillIttLetterReceiver(entity); //Code that ads a enterprise to Enterprise List int tempResult = Bizz.CreateInDbReturnInt(tempReceiver); //Code, that checks result if (!result) { if (tempResult < 1) { result = true; } } } }
private void ButtonAdd_Click(object sender, RoutedEventArgs e) { if (TextBoxNewBullet.Text != "") { int dbAnswer = 0; Exception exception = new Exception(); Bizz.TempIttLetterBullet = new IttLetterBullet(Bizz.TempIttLetterParagraph, TextBoxNewBullet.Text); try { dbAnswer = Bizz.CreateInDbReturnInt(Bizz.TempIttLetterBullet); } catch (Exception ex) { exception = ex; } if (dbAnswer < 1) { Exception tempEx = new Exception(); if (exception != tempEx) { MessageBox.Show("Databasen meldte en fejl. Linjen blev ikke tilføjet til afsnittet\n" + exception, "", MessageBoxButton.OK, MessageBoxImage.Error); } else { MessageBox.Show("Databasen meldte en fejl. Linjen blev ikke tilføjet til afsnittet", "", MessageBoxButton.OK, MessageBoxImage.Error); } } else { RefreshBullets(); GetIndexableIttLetterBulletList(); ListBoxBullets.ItemsSource = IndexableIttLetterBulletList; ListBoxBullets.SelectedIndex = 0; TextBoxNewBullet.Text = ""; } } }