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 FrmAPPregion : Office2007Form { string strMark = ""; public FrmAPPregion(string str) { InitializeComponent(); dataGridViewX1.Columns["申请时间"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm:ss";//datagridview中时间格式显示控制 dataGridViewX1.Columns["审核时间"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm:ss"; strMark = str; if (strMark == "专题图审核") { this.Text = "专题图审核记录"; //dataGridViewX1.Columns["申请状态"].DataPropertyName = "mapstatus"; } if (strMark == "打印审核") { this.Text = "打印审核记录"; //dataGridViewX1.Columns["申请状态"].DataPropertyName = "printstatus"; } if (strMark == "拷贝审核") { this.Text = "拷贝审核记录"; //dataGridViewX1.Columns["申请状态"].DataPropertyName = "copystatus"; } } private void FrmAPPregion_Load(object sender, EventArgs e) { if (strMark == "专题图审核") { string sql = "select t1.DBID,t1.APPLICANT,t1.APPLICATIONTIME,t1.AUDITOR,t1.AUDITIONTIME,t1.CONTENT,t1.STATUS,t1.MEMO,t1.NT from CASIC_APP_WORKSHEET t1 join CASIC_APP_WORKSHEET_TYPE t2 on t1.worksheettype_id=t2.dbid where NAME='专题图' and (STATUS = '审核已通过' or STATUS = '审核未通过') order by t1.APPLICATIONTIME desc"; DataTable dt = OledbHelper.QueryTable(sql); dataGridViewX1.DataSource = dt; } if (strMark == "打印审核") { string sql = "select t1.DBID,t1.APPLICANT,t1.APPLICATIONTIME,t1.AUDITOR,t1.AUDITIONTIME,t1.CONTENT,t1.STATUS,t1.MEMO,t1.NT from CASIC_APP_WORKSHEET t1 join CASIC_APP_WORKSHEET_TYPE t2 on t1.worksheettype_id=t2.dbid where NAME='打印' and (STATUS = '审核已通过' or STATUS = '审核未通过') order by t1.APPLICATIONTIME desc"; DataTable dt = OledbHelper.QueryTable(sql); dataGridViewX1.DataSource = dt; } if (strMark == "拷贝审核") { string sql = "select t1.DBID,t1.APPLICANT,t1.APPLICATIONTIME,t1.AUDITOR,t1.AUDITIONTIME,t1.CONTENT,t1.STATUS,t1.MEMO,t1.NT from CASIC_APP_WORKSHEET t1 join CASIC_APP_WORKSHEET_TYPE t2 on t1.worksheettype_id=t2.dbid where NAME='拷贝' and (STATUS = '审核已通过' or STATUS = '审核未通过') order by t1.APPLICATIONTIME desc"; DataTable dt = OledbHelper.QueryTable(sql); dataGridViewX1.DataSource = dt; } } } }