예제 #1
0
        public virtual void BeforeSave()
        {
            if (Id > 0)
            {
                Provider.Database.ClearEntityWebCache(this.GetType(), this.Id);
                IDatabaseEntity originalEntity = Module.Read(this.Id);
                string          changes        = originalEntity.CompareFields(this);

                if (!string.IsNullOrWhiteSpace(changes))
                {
                    var mh = new ModuleHistory();
                    originalEntity.CopyPropertiesWithSameName(mh);
                    mh.Id       = 0;
                    mh.ModuleId = originalEntity.Id;
                    mh.Details  = originalEntity.Serialize();
                    mh.Save();
                }
            }
        }
예제 #2
0
파일: Module.cs 프로젝트: fizikci/Cinar
        public virtual void BeforeSave()
        {
            if (Id > 0)
            {
                Provider.Database.ClearEntityWebCache(this.GetType(), this.Id);
                IDatabaseEntity originalEntity = Module.Read(this.Id);
                string changes = originalEntity.CompareFields(this);

                if (!string.IsNullOrWhiteSpace(changes))
                {
                    var mh = new ModuleHistory();
                    originalEntity.CopyPropertiesWithSameName(mh);
                    mh.Id = 0;
                    mh.ModuleId = originalEntity.Id;
                    mh.Details = originalEntity.Serialize();
                    mh.Save();
                }
            }
        }