Ejemplo n.º 1
0
        protected override bool beforeUpdateInsertAction()
        {
            BP.Sys.MapData md = new BP.Sys.MapData();
            md.No = this.No;
            if (md.RetrieveFromDBSources() == 0)
            {
                md.Name = this.Name;
                md.Insert();
            }

            if (this.IsRowLock == true)
            {
                /*检查是否启用了行锁定.*/
                MapAttrs attrs = new MapAttrs(this.No);
                if (attrs.Contains(MapAttrAttr.KeyOfEn, "IsRowLock") == false)
                {
                    throw new Exception("您启用了从表单(" + this.Name + ")行数据锁定功能,但是该从表里没IsRowLock字段,请参考帮助文档。");
                }
            }

            if (this.IsEnablePass)
            {
                /*判断是否有IsPass 字段。*/
                MapAttrs attrs = new MapAttrs(this.No);
                if (attrs.Contains(MapAttrAttr.KeyOfEn, "IsPass") == false)
                {
                    throw new Exception("您启用了从表单(" + this.Name + ")条数据审核选项,但是该从表里没IsPass字段,请参考帮助文档。");
                }
            }
            return(base.beforeUpdateInsertAction());
        }
Ejemplo n.º 2
0
 protected override bool beforeUpdateInsertAction()
 {
     if (this.IsEnablePass)
     {
         /*判断是否有IsPass 字段。*/
         MapAttrs attrs = new MapAttrs(this.No);
         if (attrs.Contains(MapAttrAttr.KeyOfEn, "IsPass") == false)
         {
             throw new Exception("您启用了从表单(" + this.Name + ")条数据审核选项,但是该从表里没IsPass字段,请参考帮助文档。");
         }
     }
     return(base.beforeUpdateInsertAction());
 }
Ejemplo n.º 3
0
        public void IntMapAttrs()
        {
            BP.Sys.MapData md = new BP.Sys.MapData();
            md.No = this.No;
            if (md.RetrieveFromDBSources() == 0)
            {
                md.Name = this.Name;
                md.Insert();
            }

            MapAttrs attrs = new MapAttrs(this.No);

            BP.Sys.MapAttr attr = new BP.Sys.MapAttr();
            if (attrs.Contains(MapAttrAttr.KeyOfEn, "OID") == false)
            {
                attr             = new BP.Sys.MapAttr();
                attr.FK_MapData  = this.No;
                attr.HisEditType = EditType.Readonly;

                attr.KeyOfEn       = "OID";
                attr.Name          = "主键";
                attr.MyDataType    = BP.DA.DataType.AppInt;
                attr.UIContralType = UIContralType.TB;
                attr.LGType        = FieldTypeS.Normal;
                attr.UIVisible     = false;
                attr.UIIsEnable    = false;
                attr.DefVal        = "0";
                attr.Insert();
            }

            if (attrs.Contains(MapAttrAttr.KeyOfEn, "RefPK") == false)
            {
                attr             = new BP.Sys.MapAttr();
                attr.FK_MapData  = this.No;
                attr.HisEditType = EditType.Readonly;

                attr.KeyOfEn       = "RefPK";
                attr.Name          = "关联ID";
                attr.MyDataType    = BP.DA.DataType.AppString;
                attr.UIContralType = UIContralType.TB;
                attr.LGType        = FieldTypeS.Normal;
                attr.UIVisible     = false;
                attr.UIIsEnable    = false;
                attr.DefVal        = "0";
                attr.Insert();
            }

            if (attrs.Contains(MapAttrAttr.KeyOfEn, "FID") == false)
            {
                attr             = new BP.Sys.MapAttr();
                attr.FK_MapData  = this.No;
                attr.HisEditType = EditType.Readonly;

                attr.KeyOfEn       = "FID";
                attr.Name          = "FID";
                attr.MyDataType    = BP.DA.DataType.AppInt;
                attr.UIContralType = UIContralType.TB;
                attr.LGType        = FieldTypeS.Normal;
                attr.UIVisible     = false;
                attr.UIIsEnable    = false;
                attr.DefVal        = "0";
                attr.Insert();
            }

            if (attrs.Contains(MapAttrAttr.KeyOfEn, "RDT") == false)
            {
                attr             = new BP.Sys.MapAttr();
                attr.FK_MapData  = this.No;
                attr.HisEditType = EditType.UnDel;

                attr.KeyOfEn       = "RDT";
                attr.Name          = "记录时间";
                attr.MyDataType    = BP.DA.DataType.AppDateTime;
                attr.UIContralType = UIContralType.TB;
                attr.LGType        = FieldTypeS.Normal;
                attr.UIVisible     = false;
                attr.UIIsEnable    = false;
                attr.Tag           = "1";
                attr.Insert();
            }

            if (attrs.Contains(MapAttrAttr.KeyOfEn, "Rec") == false)
            {
                attr             = new BP.Sys.MapAttr();
                attr.FK_MapData  = this.No;
                attr.HisEditType = EditType.Readonly;

                attr.KeyOfEn       = "Rec";
                attr.Name          = "记录人";
                attr.MyDataType    = BP.DA.DataType.AppString;
                attr.UIContralType = UIContralType.TB;
                attr.LGType        = FieldTypeS.Normal;
                attr.UIVisible     = false;
                attr.UIIsEnable    = false;
                attr.MaxLen        = 20;
                attr.MinLen        = 0;
                attr.DefVal        = "@WebUser.No";
                attr.Tag           = "@WebUser.No";
                attr.Insert();
            }
        }