Пример #1
0
        public ActionResult GenerateDataAccess()
        {
            var model = new Mo.SysDatabase();

            UpdateModel(model);

            var actionResult = default(AgileJsonResult);

            try
            {
                dynamic wherePart = new ExpandoObject();

                wherePart.DBName = model.DbName;

                wherePart.ID = model.TableID;

                var columns = Da.Sys.GetColumns(Config.ConnectionString_Read, wherePart);

                actionResult = new AgileJsonResult()
                {
                    Content = AgileJson.ToJson(new
                    {
                        result = HttpUtility.UrlDecode(GenerateCode.GetDataAccess(columns, model.TableName))
                    })
                };
            }
            catch { }

            return(actionResult);
        }
Пример #2
0
        // GET: Database
        public ActionResult GetAllDatabases()
        {
            var actionResult = default(AgileJsonResult);

            try
            {
                var databases = Da.Sys.GetAllDatabases(Config.ConnectionString_Read);

                actionResult = new AgileJsonResult()
                {
                    Content = AgileJson.ToJson(new { result = databases })
                };
            }
            catch { }

            return(actionResult);
        }
Пример #3
0
        public ActionResult GetAllTables()
        {
            var model = new Mo.SysDatabase();

            UpdateModel(model);

            var actionResult = default(AgileJsonResult);

            try
            {
                var tables = Da.Sys.GetAllTables(Config.ConnectionString_Read, model.DbName);

                actionResult = new AgileJsonResult()
                {
                    Content = AgileJson.ToJson(new
                    {
                        result = tables
                    })
                };
            }
            catch { }

            return(actionResult);
        }