Exemplo n.º 1
0
    //保存
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.EditBulletinTitleTextBox.Text == string.Empty)
        {
            PageUtility.ShowModelDlg(this.Page, "请录入标题");
            return;
        }
        if (this.EditBulletinContentTextBox.Text == string.Empty)
        {
            PageUtility.ShowModelDlg(this.Page, "请录入内容");
            return;
        }

        //新增
        if (string.IsNullOrEmpty(EditID.Text))
        {
            ms.InsertBulletin(this.EditBulletinTitleTextBox.Text, this.EditBulletinContentTextBox.Text, this.EditIsHotCheckBox.Checked, this.EditUCFileUpload.AttachmentFileName, this.EditUCFileUpload.RealAttachmentFileName);
        }
        //更新
        else
        {
            ms.UpdateBulletin(int.Parse(this.EditID.Text), this.EditBulletinTitleTextBox.Text, this.EditBulletinContentTextBox.Text, this.EditIsHotCheckBox.Checked, this.EditIsActiveCheckBox.Checked, this.EditUCFileUpload.AttachmentFileName, this.EditUCFileUpload.RealAttachmentFileName);
        }
        this.BulletinGridView.DataBind();
        btnCancel_Click(sender, e);
    }