Exemple #1
0
 public void fseshow_OnSave(object sender, OnSaveEventArgs e)
 {
     if (this.OnWindowSave != null)
     {
         this.OnWindowSave(this, new OnSaveEventArgs(e.fieldid, e.tabid, e.strcode, e.tag));
     }
 }
Exemple #2
0
        /// <summary>
        /// 保存文档到数据库
        /// </summary>
        /// <returns></returns>
        public bool Save()
        {
            m_fsv = this.MdiParent as frmScriptView;
            if (this.filename != "")
            {
                //保存文件到磁盘
                StringToFile(luaEditorControl1.Text, filename);
            }
            else
            {
                //保存脚本到dbclass
                if (this.OnSave != null && m_bLocalLocked)
                {
                    OnSaveEventArgs osea = new OnSaveEventArgs(this.fieldid, this.tabid, luaEditorControl1.Text, this.tag);
                    this.OnSave(this, osea);
                    //m_slLock = new ScriptLock(m_fsv.Conn, Convert.ToInt32(this.fieldid), Convert.ToInt32(this.tabid), "", "");
                    m_slLock.UnLock();
                    m_bLocalLocked = false;
                    m_bLocked      = false;

                    if (osea.fieldid == "NG")
                    {
                        return(false);
                    }
                }
                else if (!m_bLocalLocked && m_bLocked)
                {
                    MessageBox.Show("内容被锁定,无法保存到数据库!");
                }
            }

            this.strCode = luaEditorControl1.Text;
            if (this.Text.EndsWith("*"))
            {
                this.Text = this.Text.Substring(0, this.Text.Length - 1);
            }

            return(true);
        }
Exemple #3
0
        /// <summary>
        /// 保存文档到数据库
        /// </summary>
        /// <returns></returns>
        public bool Save()
        {
            m_fsv = this.MdiParent as frmScriptView;
            if(this.filename != "")
            {
                //保存文件到磁盘
                StringToFile(luaEditorControl1.Text, filename);
            }
            else
            {
                //保存脚本到dbclass
                if(this.OnSave != null && m_bLocalLocked)
                {
                    OnSaveEventArgs osea = new OnSaveEventArgs(this.fieldid, this.tabid, luaEditorControl1.Text, this.tag);
                    this.OnSave(this, osea);
                    //m_slLock = new ScriptLock(m_fsv.Conn, Convert.ToInt32(this.fieldid), Convert.ToInt32(this.tabid), "", "");
                    m_slLock.UnLock();
                    m_bLocalLocked = false;
                    m_bLocked = false;

                    if( osea.fieldid == "NG")
                    {
                        return false;
                    }
                }
                else if (!m_bLocalLocked && m_bLocked)
                {
                    MessageBox.Show("内容被锁定,无法保存到数据库!");
                }
            }
            
            this.strCode = luaEditorControl1.Text;
            if (this.Text.EndsWith("*")) this.Text = this.Text.Substring(0, this.Text.Length - 1);

            return true;
        }
Exemple #4
0
 public void fseshow_OnSave(object sender, OnSaveEventArgs e)
 {
     if(this.OnWindowSave != null)
     {
         this.OnWindowSave(this, new OnSaveEventArgs(e.fieldid, e.tabid, e.strcode, e.tag));
     }
 }