Exemplo n.º 1
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();
        }
Exemplo n.º 2
0
        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();
        }