Ejemplo n.º 1
0
 public ECommonModelPart AddCommonModelPart(ECommonModelPart modelPart)
 {
     var part = CdevContainer.Ins.Resolve<AbstractCommonModelPart>(modelPart.PartName);
     part.Rebuild(modelPart);
     return part.AddCommonModelPart();
 }
Ejemplo n.º 2
0
 public void SaveCommonModelPart(ECommonModelPart modelPart)
 {
     var part = CdevContainer.Ins.Resolve<AbstractCommonModelPart>(modelPart.PartName);
     part.Rebuild(modelPart);
     part.SaveCommonModelPart();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 添加默认部分 用于添加默认的 Title 部分
 /// </summary>
 /// <returns></returns>
 public virtual ECommonModelPart AddDefaultCommonModelPart()
 {
     ECommonModelPart modelPart = new ECommonModelPart();
     modelPart.CommonModelId = this.CommonModelId;
     modelPart.PartLeft = this.PartLeft;
     modelPart.PartTop = this.PartTop;
     modelPart.PartWidth = this.PartWidth;
     modelPart.PartName = this.PartName;
     modelPart.PartTemplate = this.PartTemplate;
     this.mb.Add(modelPart);
     this.Id = modelPart.Id;
     modelPart.Setting = this.GetSetting();
     this.mb.Save(modelPart, p => p.Id == modelPart.Id, p => new Columns(p.Setting));
     return modelPart;
 }
Ejemplo n.º 4
0
 public virtual void SaveCommonModelPart()
 {
     ECommonModelPart modelPart = new ECommonModelPart();
     modelPart.PartLeft = this.PartLeft;
     modelPart.PartTop = this.PartTop;
     modelPart.PartWidth = this.PartWidth;
     modelPart.PartTemplate = this.PartTemplate;
     modelPart.Setting = this.GetSetting();
     this.mb.Save(modelPart, p => p.Id == this.Id, p => new Columns(p.Setting, p.PartWidth, p.PartTop, p.PartLeft, p.PartTemplate));
     this.Save();
 }
Ejemplo n.º 5
0
        public void Rebuild(ECommonModelPart modelPart)
        {
            this.CommonModelId = modelPart.CommonModelId;
            this.Id = modelPart.Id;
            this.PartLeft = modelPart.PartLeft;
            this.PartTop = modelPart.PartTop;
            this.PartWidth = modelPart.PartWidth;
            this.PartTemplate = modelPart.PartTemplate ?? "";

            //基本配置
            var mp = modelPart.Setting.ToObject<TextPart>();
            this.SettingLabelName = mp.SettingLabelName;
            this.SettingName = mp.SettingName;
            this.SettingTip = mp.SettingTip;
            this.SettingLabelWidth = mp.SettingLabelWidth;
            this.SettingContentWidth = mp.SettingContentWidth;
            this.SettingValidateRule = mp.SettingValidateRule;
            //子类配置
            this.RebuildSetting(modelPart.Setting);
        }