Ejemplo n.º 1
0
        private void lbl_Run_Click(object sender, EventArgs e)
        {
            var sql = textEditorControl1.SelectedText;

            if (string.IsNullOrEmpty(sql))
            {
                sql = textEditorControl1.Text;
            }

            if (string.IsNullOrEmpty(sql))
            {
                this.ShowLabel("空的查询语句。");
                return;
            }
            var    r         = this.InputBox("请输入实体的名称:", "类名");
            string className = null;

            if (!r.ShowDialog() ||
                string.IsNullOrEmpty(className = r.GetText(0)))
            {
                return;
            }

            ObjectInfo info = new ObjectInfo()
            {
                Name = className
            };
            var code = info.GenerateCode(Db.Engine, Shared.Setting, sql);

            new FormEditor("自定义 SQL 语句", code).ShowDialog();
        }
Ejemplo n.º 2
0
        private void DisplayObjectInfo(ObjectInfo info)
        {
            var code = info.GenerateCode(Db.Engine, Shared.Setting);

            new FormEditor(info.ToString(), code).ShowDialog();
        }
Ejemplo n.º 3
0
 private void DisplayObjectInfo(ObjectInfo info)
 {
     var code = info.GenerateCode(Db.Engine, Shared.Setting);
     new FormEditor(info.ToString(), code).ShowDialog();
 }
Ejemplo n.º 4
0
        private void lbl_Run_Click(object sender, EventArgs e)
        {
            var sql = textEditorControl1.SelectedText;
            if(string.IsNullOrEmpty(sql)) sql = textEditorControl1.Text;

            if(string.IsNullOrEmpty(sql))
            {
                this.ShowLabel("空的查询语句。");
                return;
            }
            var r = this.InputBox("请输入实体的名称:", "类名");
            string className = null;
            if(!r.ShowDialog()
                || string.IsNullOrEmpty(className = r.GetText(0))) return;

            ObjectInfo info = new ObjectInfo() { Name = className };
            var code = info.GenerateCode(Db.Engine, Shared.Setting, sql);
            new FormEditor("自定义 SQL 语句", code).ShowDialog();
        }