Exemplo n.º 1
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        string value    = this.tbx_title.Text.Trim();
        string value2   = this.tbx_url.Text.Trim();
        string value3   = this.tbx_sql.Text.Trim();
        string value4   = this.tbx_memo.Text.Trim();
        bool   @checked = this.rdi_Y.Checked;

        SqlParameter[] myparms = new SqlParameter[]
        {
            new SqlParameter("@title", value),
            new SqlParameter("@url", value2),
            new SqlParameter("@sql", value3),
            new SqlParameter("@memo", value4),
            new SqlParameter("@isvalid", @checked)
        };
        com.jwsoft.pm.entpm.action.WaitingJob waitingJob = new com.jwsoft.pm.entpm.action.WaitingJob(this._mkdm);
        try
        {
            if (this._InfoRow == null)
            {
                waitingJob.Insert(myparms);
                this.btn_Delete.Visible = true;
            }
            else
            {
                waitingJob.Update(myparms);
            }
            this.JavaScriptControl1.Text = "alert('保存成功!');";
        }
        catch (Exception ex)
        {
            this.JavaScriptControl1.Text = string.Format("alert(\"{0}\")", ex.Message.Replace("\r\n", "\\r\\n"));
        }
    }
Exemplo n.º 2
0
 protected void btn_Delete_Click(object sender, EventArgs e)
 {
     if (this._InfoRow == null)
     {
         return;
     }
     com.jwsoft.pm.entpm.action.WaitingJob waitingJob = new com.jwsoft.pm.entpm.action.WaitingJob(this._mkdm);
     try
     {
         waitingJob.Delete();
         this.JavaScriptControl1.Text = "alert('删除成功!');";
         this.btn_Delete.Visible      = false;
     }
     catch (Exception ex)
     {
         this.JavaScriptControl1.Text = string.Format("alert(\"{0}\");", ex.Message.Replace("\r\n", "\\r\\n"));
     }
 }