コード例 #1
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        this.DDTClass.Visible = this.cbkmark.Checked;
        this.c1.Visible       = this.cbkmark.Checked;
        AffairModel aM = new AffairModel();

        aM = this.GetValueFromText();
        if (base.Request.QueryString["Type"] == "Add")
        {
            int num = AffairAction.ADD(aM);
            if (num != 1)
            {
                this.JS.Text = "alert('保存失败!');";
                return;
            }
            base.RegisterScript("top.ui.tabSuccess({ parentName: '_ProjectSupervise' })");
            return;
        }
        else
        {
            if (AffairAction.Update(aM) != 1)
            {
                this.JS.Text = "alert('修改失败!');";
                return;
            }
            this.cen.Visible = false;
            base.RegisterScript("top.ui.tabSuccess({ parentName: '_ProjectSupervise' })");
            return;
        }
    }
コード例 #2
0
ファイル: affairedit.aspx.cs プロジェクト: zxl881203/src
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        if (this.TxtAffairTitle.Text == "")
        {
            this.JS.Text = "alert('" + AffairEdit._showAffairTitle + "不能为空!');";
            return;
        }
        AffairModel affairModel = new AffairModel();

        affairModel = this.GetValueFromText();
        StringBuilder stringBuilder = new StringBuilder();

        stringBuilder.Append(" INSERT INTO EPM_Datum_Affair (");
        stringBuilder.Append("i_id, PrjCode,AffairClass,AffairTitle,AddDate,Remark,Context,DatumClass,CA,mark,filesType) ");
        stringBuilder.Append("VALUES(");
        stringBuilder.Append("'").Append(affairModel.i_id).Append("',");
        stringBuilder.Append("'").Append(affairModel.PrjCode).Append("',");
        stringBuilder.Append("'").Append(affairModel.AffairClass).Append("',");
        stringBuilder.Append("'").Append(affairModel.AffairTitle).Append("',");
        stringBuilder.Append("'").Append(affairModel.Date).Append("',");
        stringBuilder.Append("'").Append(affairModel.Remark).Append("',");
        stringBuilder.Append("'").Append(affairModel.Context).Append("',");
        stringBuilder.Append("").Append(affairModel.Flage).Append(",");
        stringBuilder.Append("").Append(0).Append(" ,");
        if (this.cbkmark.Checked)
        {
            stringBuilder.Append(" ").Append(3).Append(", ");
            if (this.DDTClass.SelectedValue == null || !(this.DDTClass.SelectedValue != ""))
            {
                this.JS.Text = "alert('请选择归档类型!');";
                this.JS.Text = "window.parent.lframe.location.href +='';";
                return;
            }
            stringBuilder.Append("").Append(this.DDTClass.SelectedValue).Append("");
        }
        else
        {
            stringBuilder.Append(" ").Append(2).Append(", ");
            stringBuilder.Append("").Append(0).Append("");
        }
        stringBuilder.Append(" )");
        int num = publicDbOpClass.ExecSqlString(stringBuilder.ToString());

        if (base.Request.QueryString["Type"] == "Add")
        {
            if (num != 1)
            {
                base.RegisterScript("top.ui.alert('新增失败');");
                return;
            }
            base.RegisterScript("top.ui.tabSuccess({ parentName: '_quaitysafetyaffairlist' })");
            return;
        }
        else
        {
            if (AffairAction.Update(affairModel) != 1)
            {
                base.RegisterScript("top.ui.alert('修改失败');");
                return;
            }
            StringBuilder stringBuilder2 = new StringBuilder();
            stringBuilder2.Append("UPDATE EPM_Datum_Affair").Append(" ");
            stringBuilder2.Append("SET").Append(" ");
            if (this.cbkmark.Checked)
            {
                stringBuilder2.Append(" [mark] =").Append(3).Append(", ");
            }
            else
            {
                stringBuilder2.Append(" [mark] =").Append(2).Append(", ");
            }
            stringBuilder2.Append(" filesType =").Append(this.DDTClass.SelectedValue).Append(" ");
            stringBuilder2.Append(" ").Append(" WHERE i_id='" + affairModel.i_id + "'");
            publicDbOpClass.ExecSqlString(stringBuilder2.ToString());
            this.cen.Visible = false;
            base.RegisterScript("top.ui.tabSuccess({ parentName: '_quaitysafetyaffairlist' })");
            return;
        }
    }