/// <summary> /// Fügt ein neues ColumnAssignment in der Datenbank hinzu /// </summary> /// <param name="csvColumn">Die CSV Spalte</param> /// <param name="databaseTable">Datenbank Tabelle</param> /// <param name="databaseColumn">Datenbank Spalte</param> /// <returns>Die ID des Eintrags in der Datenbank</returns> public static int Add(int formletterPatternID, string csvColumn, string databaseTable, string databaseColumn) { using (TafelModelContainer db = new TafelModelContainer()) { var columnAssignment = new ColumnAssignment() { FormletterPattern = db.FormletterPatterns.Single(fp => fp.FormletterPatternID == formletterPatternID), CsvColumn = csvColumn, DatabaseTable = databaseTable, DatabaseColumn = databaseColumn }; db.ColumnAssignments.AddObject(columnAssignment); db.SaveChanges(); return columnAssignment.ColumnAssignmentID; } }
/// <summary> /// Fügt ein neues ColumnAssignment in der Datenbank hinzu /// </summary> /// <param name="csvColumn">Die CSV Spalte</param> /// <param name="databaseTable">Datenbank Tabelle</param> /// <param name="databaseColumn">Datenbank Spalte</param> /// <returns>Die ID des Eintrags in der Datenbank</returns> public static int Add(int formletterPatternID, string csvColumn, string databaseTable, string databaseColumn) { using (TafelModelContainer db = new TafelModelContainer()) { var columnAssignment = new ColumnAssignment() { FormletterPattern = db.FormletterPatterns.Single(fp => fp.FormletterPatternID == formletterPatternID), CsvColumn = csvColumn, DatabaseTable = databaseTable, DatabaseColumn = databaseColumn }; db.ColumnAssignments.AddObject(columnAssignment); db.SaveChanges(); return(columnAssignment.ColumnAssignmentID); } }
/// <summary> /// Veraltete Methode zum Hinzufügen eines neuen Objekts zum EntitySet 'ColumnAssignments'. Verwenden Sie stattdessen die Methode '.Add' der zugeordneten Eigenschaft 'ObjectSet<T>'. /// </summary> public void AddToColumnAssignments(ColumnAssignment columnAssignment) { base.AddObject("ColumnAssignments", columnAssignment); }
/// <summary> /// Erstellt ein neues ColumnAssignment-Objekt. /// </summary> /// <param name="columnAssignmentID">Anfangswert der Eigenschaft ColumnAssignmentID.</param> /// <param name="csvColumn">Anfangswert der Eigenschaft CsvColumn.</param> /// <param name="databaseTable">Anfangswert der Eigenschaft DatabaseTable.</param> /// <param name="databaseColumn">Anfangswert der Eigenschaft DatabaseColumn.</param> public static ColumnAssignment CreateColumnAssignment(global::System.Int32 columnAssignmentID, global::System.String csvColumn, global::System.String databaseTable, global::System.String databaseColumn) { ColumnAssignment columnAssignment = new ColumnAssignment(); columnAssignment.ColumnAssignmentID = columnAssignmentID; columnAssignment.CsvColumn = csvColumn; columnAssignment.DatabaseTable = databaseTable; columnAssignment.DatabaseColumn = databaseColumn; return columnAssignment; }