Пример #1
0
        //TODO update entities

        public override void UpdateEntities(PxMetaModel.PcAxisMetabaseEntities context)
        {
            PxMetaModel.Value value = (from v in context.Values
                                       where v.ValuePool == ValuePool && v.ValueCode == ValueCode
                                       select v).First();

            value.ValueTextL = ValueText;
            value.UserId     = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
            value.LogDate    = DateTime.Now;

            PxMetaModel.Value_Eng value_eng = value.Value_Eng;

            value_eng.ValuetextL = ValueTextEnglish;
            value_eng.UserId     = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
            value_eng.LogDate    = DateTime.Now;

            foreach (var valueFootnote in ValueFootnotes)
            {
                valueFootnote.Value = this;
                valueFootnote.Save(context);
            }

            foreach (var removedValueFootnote in RemovedValueFootnotes)
            {
                removedValueFootnote.DeleteEntities(context);
            }
        }
Пример #2
0
        public override void CreateEntities(PxMetaModel.PcAxisMetabaseEntities context)
        {
            PxMetaModel.Value value = new PxMetaModel.Value();
            value.ValuePool  = ValuePool;
            value.ValueCode  = ValueCode;
            value.ValueTextL = ValueText;
            value.Footnote   = Footnote;
            value.SortCode   = ValueCode;
            value.UserId     = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
            value.LogDate    = DateTime.Now;

            context.AddToValues(value);

            PxMetaModel.Value_Eng valueEng = new PxMetaModel.Value_Eng();
            valueEng.Value      = value;
            valueEng.ValuetextL = ValueTextEnglish;
            valueEng.UserId     = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
            valueEng.LogDate    = DateTime.Now;
            valueEng.SortCode   = ValueCode;
            context.AddToValue_Eng(valueEng);

            foreach (var valueFootnote in ValueFootnotes)
            {
                valueFootnote.Value = this;
                valueFootnote.Save(context);
            }
        }
Пример #3
0
        public override void CreateEntities(PxMetaModel.PcAxisMetabaseEntities context)
        {
            PxMetaModel.Value value = new PxMetaModel.Value();
            value.ValuePool = ValuePool;
            value.ValueCode = ValueCode;
            value.ValueTextL = ValueText;
            value.Footnote = Footnote;
            value.SortCode = ValueCode;
            value.UserId = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
            value.LogDate = DateTime.Now;

            context.AddToValues(value);

            PxMetaModel.Value_Eng valueEng = new PxMetaModel.Value_Eng();
            valueEng.Value = value;
            valueEng.ValuetextL = ValueTextEnglish;
            valueEng.UserId = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
            valueEng.LogDate = DateTime.Now;
            valueEng.SortCode = ValueCode;
            context.AddToValue_Eng(valueEng);

            foreach(var valueFootnote in ValueFootnotes)
            {
                valueFootnote.Value = this;
                valueFootnote.Save(context);
            }
        }