public JsonResult SaveAttr(string model)
        {
            try
            {
                //JsonSerializerSettings jsetting = new JsonSerializerSettings();
                //jsetting.NullValueHandling = NullValueHandling.Ignore;
                FBDataModel data = JsonConvert.DeserializeObject <FBDataModel>(model);

                data.LastModifyTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                data.LastModifyUser = SessionProvider.Provider.Current().UserName;
                this._service.SaveAttr(data);
                return(Json(new { res = true, mes = "保存成功" }));

                //return Content("213213");
            }
            catch (Exception ex)
            {
                return(Json(new { res = false, mes = "保存失败" + ex.Message }));
                //throw ex;
                //return Json(new { res = true, mes = "操作失败" + ex.Message });
            }
        }
        public JsonResult GetModel(string dataid)
        {
            FBDataModel model = this._service.GetModel(dataid);

            return(Json(new { res = true, data = model }));
        }
        public JsonResult createMetaData(string data, string type)
        {
            try
            {
                var lastTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                var lastUser = SessionProvider.Provider.Current().UserName;
                var entity   = Newtonsoft.Json.JsonConvert.DeserializeObject <FBMetaModel>(data);
                switch (type)
                {
                case "0":
                {
                    FBDataObject model = new FBDataObject();
                    model.ID        = Guid.NewGuid().ToString();
                    model.Code      = entity.Code;
                    model.AiasName  = entity.Name;
                    model.TableName = entity.TableName;
                    model.ParentID  = entity.ParentID;
                    this._serviceDO.AddObject(model);
                }
                break;

                case "1":
                {
                    FBDataModel model = new FBDataModel();
                    model.ID          = Guid.NewGuid().ToString();
                    model.Name        = entity.Name;
                    model.Code        = entity.Code;
                    model.MainObectID = entity.ModelID;
                    model.parentID    = entity.ParentID;
                    this._serviceDM.AddModel(model);
                }
                break;

                case "2":
                {
                    FBSmartHelp model = new FBSmartHelp();
                    model.ID       = Guid.NewGuid().ToString();
                    model.Code     = entity.Code;
                    model.Name     = entity.Name;
                    model.ModelID  = entity.ModelID;
                    model.parentID = entity.ParentID;
                    this._serviceHP.addData(model);
                }
                break;

                case "3":
                {
                    FBForm model = new FBForm();
                    model.ID       = Guid.NewGuid().ToString();
                    model.Code     = entity.Code;
                    model.Name     = entity.Name;
                    model.ModelID  = entity.ModelID;
                    model.parentID = entity.ParentID;
                    model.Type     = entity.FormType;
                    this._serviceFrm.addData(model);
                }
                break;

                case "5":
                {
                    FBDataSource model = new FBDataSource();
                    model.ID       = Guid.NewGuid().ToString();
                    model.Code     = entity.Code;
                    model.Name     = entity.Name;
                    model.parentID = entity.ParentID;
                    this._serviceDS.addData(model);
                }
                break;

                default:
                    break;
                }


                return(Json(new { res = true, mes = "删除成功!" }));
            }
            catch (Exception ex)
            {
                return(Json(new { res = false, mes = "重命名失败" + ex.Message }));
            }
        }