/// <summary> /// Erstellt eine neue Instanz der NotizView Klasse. /// </summary> public NotizView(Notiz notiz, ILinkedItem linkedElement) { InitializeComponent(); this.myNotiz = notiz; this.myLinkedElement = linkedElement; this.InitializeData(); }
private void dgvNotizen_RowEnter(object sender, DataGridViewCellEventArgs e) { this.mySelectedNotiz = this.dgvNotizen.Rows[e.RowIndex].DataBoundItem as Notiz; if (mySelectedNotiz != null) { this.mtxtNotiztext.Text = mySelectedNotiz.Body; } }
/// <summary> /// Erstellt die neue Notiz mit den eingestellten Eigenschaften. /// </summary> /// <returns>Die <seealso cref="Products.Model.Entities.Notiz"/> Instanz der neuen Notiz.</returns> public Notiz Build() { string currentUserPK = ModelManager.UserService.CurrentUser.UID; var nRow = DataManager.NotesDataService.AddNotizRow(this.ParentItem.Key, this.ParentItem.LinkTypeId, this.LinkedItem.Key, this.LinkedItem.LinkTypeId, this.ContactNumber); var note = new Notiz(nRow); return(note); }
void dgvNotizen_RowEnter(object sender, DataGridViewCellEventArgs e) { var notiz = dgvNotizen.Rows[e.RowIndex].DataBoundItem as Notiz; if (notiz != null) { mySelectedNotiz = notiz; } }
public Notiz AddNote(Builder.NoteBuilder noteBuilder) { Notiz note = noteBuilder.Build(); SBList <Notiz> list = this.GetNotesList(noteBuilder.LinkedItem.Key, noteBuilder.LinkedItem.LinkTypeId); list.Add(note); return(note); }
public Notiz Build() { dsNotes.NotizXrefRow xRefRowKunde = null; dsNotes.NotizXrefRow xRefRowKontakt = null; dsNotes.NotizXrefRow xRefRowOther = null; Notiz newNotiz = new Notiz(DataManager.NotesDataService.AddNotizRow(ModelManager.UserService.CurrentUser.UID, this.myKunde.CustomerId), this.myKunde); // XRef Rows erstellen. if (newNotiz != null) { string currentUserPK = ModelManager.UserService.CurrentUser.UID; // Für den Kunden und den Hauptkontakt wird immer eine Verknüpfung erstellt. xRefRowKunde = DataManager.NotesDataService.AddNotizXrefRow( newNotiz.UID, this.myKunde.CustomerId, ModelManager.SharedItemsService.GetLinkTypeByName("Kunde").UID, currentUserPK); xRefRowKontakt = DataManager.NotesDataService.AddNotizXrefRow( newNotiz.UID, string.Format("{0}{1}", this.myKunde.CustomerId, this.myKontaktnummer), ModelManager.SharedItemsService.GetLinkTypeByName("Kundenkontakt").UID, currentUserPK); if (this.myLinkType != ModelManager.SharedItemsService.GetLinkTypeByName("Kunde") && this.myLinkType != ModelManager.SharedItemsService.GetLinkTypeByName("Kundenkontakt")) { xRefRowOther = DataManager.NotesDataService.AddNotizXrefRow( newNotiz.UID, this.myLinkId, this.myLinkTypId, currentUserPK); } if (this.myLinkType.Bezeichnung == "Kunde") { newNotiz.SetXrefBase(xRefRowKunde); newNotiz.SetContactXrefBase(xRefRowKontakt); } else if (this.myLinkType.Bezeichnung == "Kundenkontakt") { newNotiz.SetXrefBase(xRefRowKontakt); newNotiz.SetContactXrefBase(xRefRowKontakt); } else { newNotiz.SetXrefBase(xRefRowOther); newNotiz.SetContactXrefBase(xRefRowKontakt); } return(newNotiz); } return(null); }
/// <summary> /// Erzeugt eine neue Instanz der pnlNotiz Klasse. /// </summary> /// <param name="parentCtrl"></param> /// <param name="notiz"></param> public PanelNotiz(ContainerControl parentCtrl, Notiz notiz, Kunde kunde, bool keepLoaded) : base(parentCtrl, keepLoaded) { InitializeComponent(); this.myParent = parentCtrl as KundeMainView; this.myNotiz = notiz; this.myKunde = kunde; InitializeData(); this.OnClosed += pnlNotiz_OnClosed; }
void ResetGrids() { this.mySelectedLieferung = null; this.dgvLieferungen.DataSource = null; this.mySelectedRechnung = null; this.dgvRechnungen.DataSource = null; this.dgvDetails.DataSource = null; this.mySelectedNote = null; this.mySelectedNote = null; this.dgvNotes.DataSource = null; this.mySelectedFileLink = null; this.dgvFileLinks.DataSource = null; }
internal void ShowNotiz(Notiz notiz) { var notizPanel = new PanelNotiz(this, notiz, this.myKunde, false); if (this.myActivePanel.KeepLoaded) { this.myPanelsBack.Push(this.myActivePanel); } this.myActivePanel.Swipe(false); notizPanel.Swipe(true); this.myActivePanel = notizPanel; this.ToggleCloseButton(); }
public void AktualisiereNotiz(Notiz eNotiz) { Notiz lNotiz = _notizen.Find(n => n.Id == eNotiz.Id); if (lNotiz == null) { throw new System.Exception("Die Notiz ist in der 'Datenbank' nicht vorhanden und kann deshalb nicht aktualisiert werden"); } else { lNotiz.Aktualisiere(eNotiz); } }
public void SpeichereNotiz(Notiz eNotiz) { if (eNotiz.Id > 0) { throw new System.Exception("Diese Notiz ist bereits gespeichert und nicht neu. Bitte verwenden Sie die Methode Aktualisere Notiz zum speichern von Änderungen an bestehenden Notizen."); } else { eNotiz.Id = holeNachsteNotizId(); eNotiz.ZeitstempelErfassung = DateTime.Now; eNotiz.ZeitstempelLetzteAenderung = DateTime.Now; eNotiz.ErstelleLinksZuNotizmethoden(); _notizen.Add(eNotiz); } }
void dgvNotizen_RowEnter(object sender, DataGridViewCellEventArgs e) { this.mySelectedNote = this.dgvNotizen.Rows[e.RowIndex].DataBoundItem as Notiz; if (mySelectedNote != null) { this.mtxtNotiztext.Text = mySelectedNote.Body; var fileLinks = ModelManager.FileLinkService.GetFileLinkList(this.mySelectedNote.UID); if (fileLinks != null) { this.dgvDateilinks.DataSource = fileLinks.Sort("FullName"); } else { this.dgvDateilinks.DataSource = null; } } }
/// <summary> /// Löscht die angegebene Notiz. /// </summary> /// <param name="notiz">Die zu löschende Notiz.</param> /// <returns></returns> public int DeleteNote(Notiz notiz) { int result = 0; if (notiz.GetCanDelete()) // Wenn Notiz gelöscht werden kann (keine Dateiverknüpfungen etc.) { // Abonnenten informieren, dass die Notiz gelöscht wird. //if (this.NoteDeliting != null) //{ // NoteDeliting(this, new NoteDeletedEventArgs(notiz, notiz.LinkedItemId)); //} // Notiz aus dem Dictionary löschen. if (this.myNotesDict.ContainsKey(notiz.LinkedItemId) && this.myNotesDict[notiz.LinkedItemId].Contains(notiz)) { this.myNotesDict[notiz.LinkedItemId].Remove(notiz); } // Datenbankzeile löschen result = DataManager.NotesDataService.DeleteNotizRow(notiz.UID); } return(result); }
/// <summary> /// Erstellt Zufallsnotizen und speichert diese in der "Datenbank" (momentan Hauptspeicher). /// Diese Funktion dient der Initialiserung der leeren Notizliste, damit die Notizfunktionen Lesen, Ändern, Löschen getestet werden können. /// </summary> /// <param name="eAnzahlAnNotizen">Definiert die Anzahl an Notiz Objekten die erstellt und gespeichert werden</param> public void ErstelleZufallsnotizen(int eAnzahlAnNotizen) { if (eAnzahlAnNotizen < 1) { throw new ArgumentException("Der Parameter darf nicht kleiner 1 sein", "eAnzahlNotizen"); } var rng = new Random(); for (int i = 0; i < eAnzahlAnNotizen; i++) { int lId = holeNachsteNotizId(); var lN = new Notiz { ZeitstempelErfassung = DateTime.Now.AddDays(-i), ZeitstempelLetzteAenderung = DateTime.Now.AddDays(i), Id = lId, Text = rng.Next().ToString(), }; lN.ErstelleLinksZuNotizmethoden(); _notizen.Add(lN); } }
static void Main(string[] args) { Console.WriteLine("Hello World!"); List <GeometrischesObjekt> geoListe = new List <GeometrischesObjekt>(); List <Text> textListe = new List <Text>(); // Elemente in den Listen speichern // Ausgabe der Elemente auf dem Bildschirm foreach (var item in geoListe) { item.Ausgabe(); } foreach (var item in textListe) { item.Ausgabe(); } List <IBildschirmausgabe> bildschirmausgabeListe = new List <IBildschirmausgabe>(); bildschirmausgabeListe.Add(new Kreis()); bildschirmausgabeListe.Add(new Rechteck()); bildschirmausgabeListe.Add(new Notiz()); foreach (var item in bildschirmausgabeListe) { item.ausgeben(); } Notiz notiz = new Notiz(); //foreach (var item in notiz) //{ //} }
public StatusCodeResult AktualisiereNotiz(int id, Notiz eNotiz) { if (id != eNotiz.Id) { return(BadRequest()); } if (_notizenRepository.HoleNotizById(id) == null) { return(NotFound()); } try{ _notizenRepository.AktualisiereNotiz(eNotiz); } catch (Exception e) { _logger.LogError(e, "Fehler beim Speichern in der Datenbank", eNotiz); throw; } return(NoContent()); }
void dgvNotes_RowEnter(object sender, DataGridViewCellEventArgs e) { this.mySelectedNote = this.dgvNotes.Rows[e.RowIndex].DataBoundItem as Notiz; this.dgvFileLinks.DataSource = this.mySelectedNote.Dateilinks; }
// public void SpeichereNotiz(Notiz eNotiz) public CreatedAtActionResult SpeichereNotiz(Notiz eNotiz) { _notizenRepository.SpeichereNotiz(eNotiz); return(CreatedAtAction("SpeichereNotiz", new { id = eNotiz.Id }, eNotiz)); }
private void dgvNotizen_RowEnter(object sender, DataGridViewCellEventArgs e) { this.mtxtNoteText.Text = string.Empty; this.mySelectedNote = this.dgvNotizen.Rows[e.RowIndex].DataBoundItem as Notiz; this.mtxtNoteText.Text = (this.mySelectedNote != null) ? this.mySelectedNote.Body : string.Empty; }
public void TestMinusRemoval() { Notiz n = JsonConvert.DeserializeObject <Notiz>("{\"klaerfallnummer\":\"468982\",\"autor\":\"Konstantin Klein\",\"zeitpunkt\":\"2019-05-24T14:05:00Z\",\"inhalt\":\"hallo. das ist eine notiz mit einem lustigen emoji 🥝\n------------------------------------------------------------------------\",\"tdid\":\"0002\",\"tdname\":\"0000468982\",\"tdobject\":\"EMMA_CASE\"}"); Assert.AreEqual("hallo. das ist eine notiz mit einem lustigen emoji 🥝", n.Inhalt); }
public NoteCreatedEventArgs(Notiz notiz, string linkedItemPK) { this.Notiz = notiz; this.LinkedItemPK = linkedItemPK; }
public NoteDeletedEventArgs(Notiz note, string linkedItemPK) { this.Note = note; this.LinkedItemPK = linkedItemPK; }