Beispiel #1
0
        private async void ModelRun()
        {
            await Task.Run(() =>
            {
                if (!string.IsNullOrEmpty(DBName))
                {
                    ModelHelper model  = new ModelHelper();
                    SqlSugar.DbType ty = SqlSugar.DbType.SqlServer;
                    switch (Constraint.value)
                    {
                    case 3:
                        ty = SqlSugar.DbType.MySql;
                        break;

                    case 4:
                        ty = SqlSugar.DbType.Oracle;
                        break;
                    }
                    string json = model.GetTableJson(DBName, ty);
                    if (IsSugar)
                    {
                        SqlText = Common.format(model.ModelCreate(json, "MeiCloud.DataAccess", "Sugar"));
                    }
                    else
                    {
                        SqlText = Common.format(model.ModelCreate(json, "MeiCloud.DataAccess"));
                    }

                    SqlText = SqlText.Replace("\nusing Creative.ODA;", "");
                    Loading.Framework.HideLoading();
                }
            }).ConfigureAwait(true);
        }
Beispiel #2
0
        private void AddCommand()
        {
            if (String.IsNullOrEmpty(SqlText))
            {
                return;
            }
            StringBuilder str = new StringBuilder("");

            str.Append("public SimpleCommand " + SqlText.Replace("\n", "") + " => new SimpleCommand(){ExecuteDelegate = x =>{},CanExecuteDelegate = o =>{return true;}};");
            SqlText = Common.format(str.ToString());
        }