using System; using System.Data; using System.Windows.Forms; using DevComponents.DotNetBar; namespace Cyberpipe { public partial class FrmAPP : Office2007Form { string sqType; int type; public FrmAPP(string _sqType) { InitializeComponent(); sqType = _sqType; if (sqType == "专题图申请") { Text = "专题图申请"; type = 10; } else if (sqType == "打印申请") { type = 11; Text = "打印申请"; } else if (sqType == "拷贝申请") { type = 12; Text = "拷贝申请"; } txtApplicant.Text = Utility.userName; dateApplicant.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); ////////hellow } /// <summary> /// 添加、保存按钮事件处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonX1_Click(object sender, EventArgs e) { //casic_app_worksheet //获得当前时间 string now = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string sql = ""; if (txtName.Text.Trim() == "") { MessageBox.Show("请填写申请内容"); } else { sql = "insert into casic_app_worksheet(APPLICANT,APPLICATIONTIME,CONTENT,NT,STATUS,WORKSHEETTYPE_ID)"//,WORKSHEETTYPE_ID + " values ('" + txtApplicant.Text.Trim() + "',to_date('" + now + "','yyyy-MM-dd hh24:mi:ss'),'" + txtName.Text.Trim() + "','" + txtNt.Text.Trim() + "','待审核',"+type+")"; } try { int count = OledbHelper.sqlExecuteNonQuery(sql); if (count != -1) { MessageBox.Show("申请成功"); Close(); } } catch (Exception ex) { LogError.PublishError(ex); } } /// <summary> /// 关闭按钮事件处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonX2_Click(object sender, EventArgs e) { Close(); } DataTable table; /// <summary> /// 窗体初始化事件处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmAPP_Load(object sender, EventArgs e) { } private void labelX2_Click(object sender, EventArgs e) { } } }