/// <summary> /// Erstellt eine neue Instanz der NotizView Klasse. /// </summary> public NotizView(Notiz notiz, ILinkedItem linkedElement) { InitializeComponent(); this.myNotiz = notiz; this.myLinkedElement = linkedElement; this.InitializeData(); }
public KundeMainView(Kunde kunde, ILinkedItem openThis = null) { InitializeComponent(); this.myKunde = kunde; Model.ModelManager.CustomerService.CurrentCustomer = kunde; var name = this.myKunde.CompanyName1.Replace("&", "&&"); var titel = $"[{this.myKunde.KundenNrCpm}] [{this.myKunde.Vertreter}] {name}"; this.Text = titel; Application.Idle += Application_Idle; ShowStartPanel(); if (openThis != null) { switch (openThis.LinkTypBezeichnung) { case "Kundenkontakt": this.LoadOrShowKontakte(); break; case "Kundenmaschine": var machine = openThis as Kundenmaschine; if (machine != null) { this.ShowMaschine(machine); } break; } } }
/// <summary> /// Gibt eine Liste von Terminen zurück, mit denen das angegebene ILinkedItem /// verknüpft ist. /// </summary> /// <param name="linkedItem">Das verknüpfte <seealso cref="ILinkedItem"/></param> /// . /// <returns></returns> public SortableBindingList <Appointment> GetAppointmentList(ILinkedItem linkedItem) { var list = new SortableBindingList <Appointment>(); foreach (var terminListe in this.myAppointmentDictionary) { list.AddRange(terminListe.Value.Where(a => a.GetLinkedItemsList().Contains(linkedItem))); } return(list); }
/// <summary> /// Löscht die Dateiverknüpfung für das angegebene ILinkedItem. /// </summary> /// <param name="fileInfo">FileInfo Instanz der verknüpften Datei.</param> /// <param name="linkedItem">Das mit der Datei verknüpfte ILinkedItem.</param> public void DeleteFileLink(FileInfo fileInfo, ILinkedItem linkedItem, bool deleteFile = false) { if (this.myFileLinkDictionary.ContainsKey(linkedItem.Key)) { var link = this.myFileLinkDictionary[linkedItem.Key].FirstOrDefault(f => f.FullName == fileInfo.FullName); if (link != null) { this.myFileLinkDictionary[linkedItem.Key].Remove(link); } } DataManager.FileLinkDataService.DeleteFileLink(fileInfo); if (deleteFile) { fileInfo.Delete(); } }
void OpenNote() { if (this.mySelectedNote != null) { ILinkedItem linkedItem = null; if (this.activeGrid == this.dgvTourKunden && this.mySelectedKunde != null) { linkedItem = this.mySelectedKunde; } else if (this.activeGrid == this.dgvInteressenten && this.mySelectedProspect != null) { linkedItem = this.mySelectedProspect; } var nv = new NotizView(mySelectedNote, linkedItem); nv.ShowDialog(); } }
void btnRemoveLink_Click(object sender, EventArgs e) { if (this.mySelectedDateilink != null) { string msg = "Soll auch die gespeicherte Datei auf dem Server gelöscht werden?"; //string linkUID = this.mySelectedDateilink.LinkedItemId; var file = new FileInfo(this.mySelectedDateilink.FullName); string fileAndPath = this.mySelectedDateilink.FullName; ILinkedItem linkedItem = this.mySelectedNote; if (MetroMessageBox.Show(this, msg, "Datei löschen", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ModelManager.FileLinkService.DeleteFileLink(file, linkedItem, true); } else { ModelManager.FileLinkService.DeleteFileLink(file, linkedItem, false); } this.mySelectedDateilink = null; } }
/// <summary> /// Erstellt eine neue Verknüpfung zwischen einer Datei und einer ILinkedItem Instanz. /// </summary> /// <param name="fileInfo">FileInfo Instanz der zu verknüpfenden Datei.</param> /// <param name="linkedItem">ILinkedItem Instanz des verknüpfenden Elements.</param> /// <param name="keepSourceFile">Wenn false, wird die Originaldatei gelöscht.</param> /// <returns></returns> public FileLink AddFileLink(FileInfo fileInfo, ILinkedItem linkedItem, bool keepSourceFile = true) { var builder = new Builder.FileLinkBuilder(DataManager.FileLinkDataService); builder .SetSourceFile(fileInfo) .SetLinkedItem(linkedItem) .SetKeepSourceFile(keepSourceFile); var newFileLink = builder.Build(); if (this.myFileLinkDictionary.ContainsKey(linkedItem.Key)) { this.myFileLinkDictionary[linkedItem.Key].Add(newFileLink); } else { var list = new SBList <FileLink>(); list.Add(newFileLink); this.myFileLinkDictionary.Add(linkedItem.Key, list); } return(newFileLink); }
/// <summary> /// Legt das angegebene ILinkedItem für die Dateiverknüpfung fest. /// </summary> /// <param name="linkedItem"></param> /// <returns></returns> public FileLinkBuilder SetLinkedItem(ILinkedItem linkedItem) { this.LinkedItem = linkedItem; return(this); }
/// <summary> /// Fügt der Liste von zu verknüpfenden Elementen ein neues Element hinzu. /// </summary> /// <param name="linkedItem">Das zu verknüpfende Element.</param> /// <returns></returns> public CalendarSettings AddLinkedItem(ILinkedItem linkedItem) { this.myLinkedItemsList.Add(linkedItem); this.NotifyPropertyChanged("LinkedItemsList"); return(this); }
/// <summary> /// Entfernt die ausgewählte Verknüpfung vom angegebenen Termin. /// </summary> /// <param name="appointment"></param> /// <param name="linkedItem"></param> public void RemoveLinkedItemFromAppointment(Appointment appointment, ILinkedItem linkedItem) { this.GetLinkedItemsList(appointment).Remove(linkedItem); DataManager.AppointmentDataService.RemoveLinkedItem(fullName: appointment.FullName, linkedItemPK: linkedItem.Key); }
public NoteBuilder SetLinkedItem(ILinkedItem linkedItem) { this.LinkedItem = linkedItem; return(this); }
public NoteBuilder SetParentItem(ILinkedItem parentItem) { this.ParentItem = parentItem; return(this); }
/// <summary> /// Erzeugt eine neue Instanz der NoteBuilder Klasse. /// </summary> /// <param name="parentItem">Das übergeordnete ILinkedItem (Kunde, Interessent, Lieferant oder Mitarbeiter.</param> /// <param name="linkedItem">Das ILinkedItem, das mit der Notiz verknüpft werden soll.</param> /// <param name="contactNumber">Die Nummer eines Ansprechpartners bei dem übergeordneten Kunden.</param> public NoteBuilder(ILinkedItem parentItem, ILinkedItem linkedItem, string contactNumber = null) { this.ParentItem = parentItem; this.LinkedItem = linkedItem; this.ContactNumber = contactNumber; }
/// <summary> /// Ermittelt den Objekttyp des angegebenen ILinkedItem und gibt den entsprechenden /// Linktyp zurück. /// </summary> /// <param name="item">Das Element dessen Linktyp gesucht wird.</param> /// <returns></returns> public Linktyp GetLinkTypeByEntity(ILinkedItem item) { return(this.GetLinkTypeByName(item.LinkTypBezeichnung)); }
void dgvLinkedItems_RowEnter(object sender, DataGridViewCellEventArgs e) { this.mySelectedLinkedItem = this.dgvLinkedItems.Rows[e.RowIndex].DataBoundItem as ILinkedItem; }