コード例 #1
0
ファイル: FormViewFrm.cs プロジェクト: ruo2012/CodeHelper
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(this.txtName.Text))
            {
                MessageBox.Show("名字不能为空");
                return;
            }

            var folder = new ServiceFolder(this.formView.Dom.ParentNode);
            var hash   = this.formView.Dom.GetHashCode();

            foreach (var s in folder.Services)
            {
                if (s.Dom.GetHashCode() == hash)
                {
                    continue;
                }

                if (s.Name == this.txtName.Name)
                {
                    MessageBox.Show("同个文件夹下名字不能重复");
                    return;
                }
            }
            this.formView.Name = this.txtName.Text.Trim();
            this.formView.Code = this.textEditorControl.Text.Trim();


            DBGlobalService.Save();
        }
コード例 #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(this.txtName.Text))
            {
                MessageBox.Show("名字不能为空");
                return;
            }

            var folder = new ServiceFolder(this.service.Dom.ParentNode);
            var hash   = this.service.Dom.GetHashCode();

            foreach (var s in folder.Services)
            {
                if (s.Dom.GetHashCode() == hash)
                {
                    continue;
                }

                if (s.Name == this.txtName.Name)
                {
                    MessageBox.Show("同个文件夹下名字不能重复");
                    return;
                }
            }
            this.service.Name = this.txtName.Text.Trim();
            this.service.Code = this.textEditorControl.Text.Trim();

            //this._sqlType.AddName(this.txtName.Text.Trim()));
            //if ( this._sqlType.HasPagerContentTable())
            //    this._sqlType.RemovePagerContentTable();
            //if ( this._sqlType.HasPagerRecordCountTable())
            //    this._sqlType.RemovePagerRecordCountTable();

            ////this.DialogResult = System.Windows.Forms.DialogResult.OK;

            //while (this._sqlType.HasSqlStatement())
            //{
            //    this._sqlType.RemoveSqlStatement();
            //}


            //SqlStatementType sql = new SqlStatementType();
            //sql.AddStatement(this.textEditorControl.Document.TextContent));

            //this._sqlType.AddSqlStatement(sql);
            //if (Save != null)
            //{
            //    this.Save(_sqlType,ref this.Node_HashCode);
            //}

            DBGlobalService.Save();
        }
コード例 #3
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(this.txtProjectFile.Text))
            {
                if (!string.IsNullOrEmpty(DBGlobalService.ProjectFile))
                {
                    DBGlobalService.Save();
                }
                DBGlobalService.ProjectFile = this.txtProjectFile.Text.Trim();

                //ProjectDoc doc = new ProjectDoc();
                var doc = new Document();
                doc.Load(DBGlobalService.ProjectFile);
                DBGlobalService.CurrentProject = new ProjectType(doc);
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
        }