Esempio n. 1
0
        private void CreateCSFiles(int _dbtype = 1)
        {
            string _tableViewShowStr = string.Empty;

            if (_dbtype == 1)
            {
                _tableViewShowStr = "表";
            }
            if (_dbtype == 2)
            {
                _tableViewShowStr = "视图";
            }
            if (_CurrentSelectNode == null)
            {
                MsgBox.Infor("请先选中需要生成的'" + _tableViewShowStr + "'节点");
                return;
            }
            DevExpress.XtraTreeList.Nodes.TreeListNode _ParantNode = _CurrentSelectNode.ParentNode;
            if (_ParantNode == null)
            {
                MsgBox.Warning("'" + _tableViewShowStr + "'节点无父节点....");
                return;
            }
            DbLoginFor _DbLoginFor = _ParantNode.Tag as DbLoginFor;

            if (_DbLoginFor == null)
            {
                MsgBox.Warning("'" + _tableViewShowStr + "'节点的连接信息错误....");
                return;
            }
            if (this.comboBox1.SelectedIndex == 0)
            {
                MsgBox.Warning("您选中的模板有问题,请前去确认.......");
                return;
            }
            CodeTemplet __CodeTemplet = this.comboBox1.SelectedItem as CodeTemplet;

            if (null == __CodeTemplet)
            {
                MsgBox.Warning("您选中的模板有问题,请前去确认.......");
                return;
            }
            string _FolderName = DialogUnitity.DialogFolderBrowser();

            if (string.IsNullOrEmpty(_FolderName.Trim()))
            {
                MsgBox.Infor("没有您选中的文件夹....");
                return;
            }

            string _Conn = _DbLoginFor.ConnString;

            CreateCSFileOneByOne(_DbLoginFor, __CodeTemplet, _FolderName, _dbtype);
            MsgBox.Infor("文件保存完成....");
        }
Esempio n. 2
0
        private void simpleButton3_Click(object sender, EventArgs e)
        {
            string _FileName = DialogUnitity.DialogFolderBrowser();

            if (string.IsNullOrEmpty(_FileName.Trim()))
            {
                MsgBox.Infor("没有您选中的文件夹....");
                return;
            }
            _FileName += @"\" + _CodeClassPref + _CodeClassName + ".cs";
            FileUnitity.StringToNewFile(_FileName, this.fastColoredTextBox1.Text, System.Text.Encoding.UTF8);

            MsgBox.Infor("文件保存完成....");
        }