public override void UpdateEntities(PxMetaModel.PcAxisMetabaseEntities context) { PxMetaModel.Content content = (from c in context.Contents where c.MainTable == MainTable.TableId && c.Contents == Content select c).First(); content.PresText = PresText; content.PresTextS = PressTextS; content.PresCode = MainTable.ProductId + StoreColumnNo; content.Copyright = Copyright; content.StatAuthority = StatAuthority; content.Producer = Producer; content.Unit = Unit; content.PresDecimals = PresDecimals; content.PresCellsZero = PresCellsZero; content.PresMissingLine = PresMissingLine; content.AggregPossible = AggregPossible; content.RefPeriod = RefPeriod; content.StockFA = StockFA; content.BasePeriod = BasePeriod; content.CFPrices = String.IsNullOrWhiteSpace(CFPrices) ? null : CFPrices; content.DayAdj = DayAdj; content.SeasAdj = SeasAdj; content.FootnoteContents = FootnoteContents == null ? "N" : FootnoteContents; content.FootnoteVariable = FootnoteVariable == null ? "N" : FootnoteVariable; content.FootnoteValue = FootnoteValue == null ? "N" : FootnoteValue; content.FootnoteTime = FootnoteTime == null ? "N" : FootnoteTime; content.StoreColumnNo = StoreColumnNo; content.StoreFormat = StoreFormat; content.StoreNoChar = StoreNoChar; content.StoreDecimals = StoreDecimals; content.UserId = System.Security.Principal.WindowsIdentity.GetCurrent().Name; content.LogDate = DateTime.Now; PxMetaModel.Contents_Eng contentEng = (from c in context.Contents_Eng where c.MainTable == MainTable.TableId && c.Contents == Content select c).First(); contentEng.PresText = PressTextEnglish; contentEng.PresTextS = PressTextEnglishS; contentEng.RefPeriod = RefPeriodEnglish; contentEng.BasePeriod = BasePeriod; contentEng.Unit = UnitEnglish; contentEng.UserId = System.Security.Principal.WindowsIdentity.GetCurrent().Name; contentEng.LogDate = DateTime.Now; foreach (PxContentFootnote contentFootnote in Footnotes) { contentFootnote.MainTable = MainTable; contentFootnote.Content = this; contentFootnote.Save(context); } foreach (PxContentVariableFootnote contentVariableFootnote in ContentVariableFootnotes) { contentVariableFootnote.MainTable = MainTable; contentVariableFootnote.Content = this; contentVariableFootnote.Save(context); } foreach (PxContentValueFootnote contentValueFootnote in ContentValueFootnotes) { contentValueFootnote.MainTable = MainTable; contentValueFootnote.Content = this; contentValueFootnote.Save(context); } foreach (PxContentVariableFootnote contentVariableFootnote in RemovedContentVariableFootnotes) { contentVariableFootnote.DeleteEntities(context); } foreach (PxContentFootnote contentFootnote in RemovedFootnotes) { contentFootnote.DeleteEntities(context); } foreach (PxContentValueFootnote contentValueFootnote in RemovedContentValueFootnotes) { contentValueFootnote.DeleteEntities(context); } }
public override void CreateEntities(PxMetaModel.PcAxisMetabaseEntities context) { PxMetaModel.Content content = new PxMetaModel.Content(); content.Contents = Content; content.MainTable = MainTable.TableId; content.PresText = PresText; content.PresTextS = PressTextS; content.PresCode = MainTable.ProductId + StoreColumnNo; content.Copyright = Copyright; content.StatAuthority = StatAuthority; content.Producer = Producer; content.Unit = Unit; content.PresDecimals = PresDecimals; content.PresCellsZero = PresCellsZero; content.PresMissingLine = PresMissingLine; content.AggregPossible = AggregPossible; content.RefPeriod = RefPeriod; content.StockFA = StockFA; content.BasePeriod = BasePeriod; content.CFPrices = String.IsNullOrWhiteSpace(CFPrices) ? null : CFPrices; content.DayAdj = DayAdj; content.SeasAdj = SeasAdj; content.FootnoteContents = FootnoteContents; content.FootnoteVariable = FootnoteVariable; content.FootnoteValue = FootnoteValue; content.FootnoteTime = FootnoteTime; content.StoreColumnNo = StoreColumnNo; content.StoreFormat = StoreFormat; content.StoreNoChar = StoreNoChar; content.StoreDecimals = StoreDecimals; content.UserId = System.Security.Principal.WindowsIdentity.GetCurrent().Name; content.LogDate = DateTime.Now; context.AddToContents(content); PxMetaModel.Contents_Eng contentEng = new PxMetaModel.Contents_Eng(); contentEng.Content = content; contentEng.PresText = PressTextEnglish; contentEng.PresTextS = PressTextEnglishS; contentEng.RefPeriod = RefPeriodEnglish; contentEng.BasePeriod = BasePeriodEnglish; contentEng.Unit = UnitEnglish; contentEng.UserId = System.Security.Principal.WindowsIdentity.GetCurrent().Name; contentEng.LogDate = DateTime.Now; context.AddToContents_Eng(contentEng); foreach (PxContentFootnote contentFootnote in Footnotes) { contentFootnote.MainTable = MainTable; contentFootnote.Content = this; contentFootnote.Save(context); } foreach (PxContentVariableFootnote contentVariableFootnote in ContentVariableFootnotes) { contentVariableFootnote.MainTable = MainTable; contentVariableFootnote.Content = this; contentVariableFootnote.Save(context); } foreach (PxContentValueFootnote contentValueFootnote in ContentValueFootnotes) { contentValueFootnote.MainTable = MainTable; contentValueFootnote.Content = this; contentValueFootnote.Save(context); } }