using DocumentFormat.OpenXml.Drawing; using SushiBarBusinessLogic.OfficePackage.HelpersEnum; using SushiBarBusinessLogic.OfficePackage.HelpersModels; namespace SushiBarBusinessLogic.OfficePackage; public abstract class AbstractSaveToWord { public void CreateDoc(WordInfo info) { CreateWord(info); var rows = info.Stores .Select(store => CreateRow( new List() { CreateCell(new WordCell { Text = store.StoreName }), CreateCell(new WordCell { Text = store.StoreAddress }), CreateCell(new WordCell { Text = store.OpeningDate.ToShortDateString() }) })).ToList(); CreateTable(rows); SaveWord(info); } protected abstract void CreateWord(WordInfo info); protected abstract void CreateParagraph(WordParagraph? paragraph); protected abstract void SaveWord(WordInfo info); protected abstract void CreateTable(List? rows); protected abstract TableRow? CreateRow(List? cells); protected abstract TableCell? CreateCell(WordCell? cell); }