Beispiel #1
0
        /// <summary>
        /// 帮助控件查询接口
        /// </summary>
        /// <param name="helpID"></param>
        /// <param name="keyword"></param>
        /// <param name="codeField"></param>
        /// <param name="nameField"></param>
        /// <param name="isParent"></param>
        /// <returns></returns>
        public List <dynamic> getQueryHelpSwitch(string helpID, string keyword, string codeField, string nameField, string filter, bool isParent)
        {
            var svr   = new FBSmartHelpService(context);
            var model = svr.getModel(helpID);

            return(DataModelCom.getQueryHelpSwitch(model.ModelID, keyword, codeField, nameField, filter, model.Filter, isParent, base.Db));
        }
Beispiel #2
0
        public List <FBDataModelCols> GetObjectColList(string ModelID, string ObjectID, bool hasRealtion)
        {
            if (string.IsNullOrEmpty(ObjectID))
            {
                ObjectID = DataModelCom.getMainModelObjectID(ModelID, base.Db);
            }
            List <FBDataModelCols> list = new List <FBDataModelCols>();

            list = Db.Fetch <FBDataModelCols>("select * from FBDataModelCols where ModelID=@0 and ModelObjectID=@1", ModelID, ObjectID);
            return(list);
        }
Beispiel #3
0
        /// <summary>
        /// 获取表单数据源的字段合集
        /// </summary>
        /// <param name="frmid"></param>
        /// <param name="dmid"></param>
        /// <returns></returns>
        public List <JFBFormDS> getFormDS(string frmid, string dmid)
        {
            List <FBDataModelObjects> list = DataModelCom.getModelDSList(dmid, true, base.Db);

            List <JFBFormDS> ds = new List <JFBFormDS>();

            foreach (FBDataModelObjects model in list)
            {
                JFBFormDS info = new JFBFormDS();
                info.id      = model.ID;
                info.ismain  = model.isMain == "1" ? true : false;
                info.issys   = true;
                info.dataid  = model.ObjectID;//
                info.modelid = model.ModelID;
                info.text    = model.Name;
                info.name    = model.Code;
                List <JFBFormDSFields> collist = new List <JFBFormDSFields>();
                foreach (FBDataModelCols col in model.ColList)
                {
                    collist.Add(new JFBFormDSFields {
                        id = col.Label, fieldid = col.ID, text = col.Label + "[" + col.Name + "]", type = col.DataType, isrelated = col.isRelated == "1"
                    });
                }
                info.columns = collist;
                ds.Add(info);
            }
            //添加用户自定义数据源信息
            List <FBDataSource> customDS = DataSourceCom.getFormDataSource(frmid, base.Db);

            foreach (var model in customDS)
            {
                JFBFormDS info = new JFBFormDS();
                info.id      = model.ID;
                info.ismain  = false;
                info.issys   = false;
                info.dataid  = model.ID;
                info.modelid = model.ID;
                info.text    = model.Name;
                List <JFBFormDSFields> collist = new List <JFBFormDSFields>();
                foreach (FBDataSourceCols col in model.ColList)
                {
                    collist.Add(new JFBFormDSFields {
                        id = col.Code, fieldid = col.ID, text = col.Code + "[" + col.Name + "]", type = col.DataType, isrelated = false
                    });
                }
                info.columns = collist;
                ds.Add(info);
            }
            return(ds);
        }
Beispiel #4
0
 /// <summary>
 /// List Save
 /// </summary>
 /// <param name="modelID"></param>
 /// <param name="ds"></param>
 /// <param name="dsDel"></param>
 public void saveModelList(string modelID, DataSet ds, DataTable dsDel)
 {
     //try
     //{
     //    base.Db.BeginTransaction();
     DataModelCom.saveModelList(modelID, ds, dsDel, base.Db);
     //    base.Db.CompleteTransaction();
     //}
     //catch (Exception ex)
     //{
     //    base.Db.AbortTransaction();
     //    log.Error(ex.Message, ex);
     //    throw ex;
     //}
 }
Beispiel #5
0
        public void deleteModel(string modelID, string dataid)
        {
            //try
            //{
            //    base.Db.BeginTransaction();

            // 启用依赖检查
            DataModelCom.deleteModelByDataID(modelID, dataid, true, base.Db);
            //    this.Db.CompleteTransaction();
            //}
            //catch (Exception ex)
            //{
            //    base.Db.AbortTransaction();
            //    throw ex;
            //}
        }
        public JFBSmartHelp getRuntimeModel(string helpid)
        {
            Sql sql = new Sql(@"select id,modelID,title,viewtype as type,pageOption,pageSize,autoCol,filter,sort from FBSmartHelp  where  ID=@0", helpid);

            JFBSmartHelp model = base.Db.FirstOrDefault <JFBSmartHelp>(sql);

            var dmmodel = DataModelCom.getModelMainSchemaForWeb(model.modelID, base.Db);

            model.treeInfo = dmmodel.treeInfo;//树形结构
            model.pkCol    = dmmodel.pkCol;

            sql = new Sql(@"select ColName as name,ColCode as code,align,width, ord,Visible from  FBSmartHelpCols where HelpID =@0 order by ord asc", helpid);

            model.ColList = base.Db.Fetch <JFBSmartHelpCols>(sql);

            return(model);
        }
Beispiel #7
0
        public void saveModelALL(string modelID, string dataID, DataSet ds, string status, TreeNode tree)
        {
            //try
            //{
            //    base.Db.BeginTransaction();
            FBDataModel model = this.GetModel(modelID);

            DataModelCom.saveModelALL(modelID, model, dataID, ds, status, tree, base.Db);

            //    base.Db.CompleteTransaction();
            //}
            //catch (Exception ex)
            //{
            //    base.Db.AbortTransaction();
            //    log.Error(ex.Message, ex);
            //    throw ex;
            //}
        }
        public string remoteCheck(CheckExits model, string frmID, string dataModelID)
        {
            Sql sql = new NPoco.Sql(string.Format("select count(1) from {0} where {1}='{2}'", model.TableName, model.ValidField, model.ValidValue));

            if (!string.IsNullOrEmpty(model.DataID))
            {
                sql.Append(string.Format(" and {0}<>'{1}' ", model.KeyField, model.DataID));
            }
            if (model.Filter != null)
            {
                sql.Append(ConditionParser.Serialize(model.Filter));
            }
            var      ds   = DataModelCom.getDataSource(dataModelID, this.Db);
            Database ywdb = DataBaseManger.GetDB(ds);

            if (ywdb.Single <long>(sql) > 0)
            {
                return(string.Format("{0}的值已存在", model.Label));
            }
            return("");
        }
Beispiel #9
0
 public List <Dictionary <string, object> > getModelTreeDataALL(string modeID, string keyWord, string filter, string order)
 {
     return(DataModelCom.getModelTreeDataALL(modeID, keyWord, filter, order, base.Db));
 }
Beispiel #10
0
 public List <Dictionary <string, object> > getModelTreeDataDictList(string modeID, string level, string path, string parentID, string keyWord, string filter, string order)
 {
     return(DataModelCom.getModelTreeData(modeID, level, path, parentID, keyWord, filter, order, base.Db));
 }
Beispiel #11
0
 public List <dynamic> getModelData(string modelID, string filter, string order)
 {
     return(DataModelCom.getModelData(modelID, filter, order, base.Db));
 }
Beispiel #12
0
 public GridViewModel <dynamic> getModelPageList(string modelID, int currentPage, int perPage, string filter, string order, out long totalPages, out long totalItems)
 {
     return(DataModelCom.getModelPageList(modelID, currentPage, perPage, filter, order, out totalPages, out totalItems, base.Db));
 }
Beispiel #13
0
 public List <dynamic> getModelDataByDataID(string modelID, string dataid, bool detail)
 {
     return(DataModelCom.getModelDataByDataID(modelID, dataid, detail, base.Db));
 }
Beispiel #14
0
 public List <JFBSchema> getModelSchemaForWeb(string modelID)
 {
     // 基础数据源
     return(DataModelCom.getModelSchemaForWeb(modelID, base.Db));
 }