Newer
Older
EMS_SZ / FrmAPPFORASKReason.cs
root on 21 Mar 2016 1 KB first
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace Cyberpipe
{
    public partial class FrmAPPFORASKReason : Office2007Form
    {
        public string auditor;
        public int dbid;
        public FrmAPPFORASKReason()
        {
            InitializeComponent();
        }

        public FrmAPPFORASKReason(string _auditor,int _dbid) {

            InitializeComponent();
            auditor = _auditor;
            dbid = _dbid;
        }
        private void buttonX2_Click(object sender, EventArgs e)
        {
            FrmAPPFORASK.refuseReason = "待审核"; 
            Close();
        }

        private void buttonX1_Click(object sender, EventArgs e)
        {
            System.DateTime current = new System.DateTime();
            current = System.DateTime.Now;
            string reason = reasonTxt.Text;

            if (reason.Trim() != "")
            {
                if (MessageBox.Show("你确认不批准该申请?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    string sql = "update casic_app_worksheet set STATUS = '" + "审核未通过" + "',AUDITIONTIME = to_date('"
                        + current.ToString("yyyy-MM-dd HH:mm:ss") + "','yyyy-MM-dd hh24:mi:ss'),AUDITOR = '" + auditor
                        + "',MEMO='" + reason
                        + "' where DBID = " + dbid;
                    OledbHelper.sqlExecuteNonQuery(sql);

                    FrmAPPFORASK.refuseReason = "审核未通过";
                    Close();
                }
            }
            else {
                MessageBox.Show("请填写不批准的理由!");
            }
           
        }
    }
}