Newer
Older
GHFX_REFACTOR / FrmAPPregion.cs
wxn on 9 Nov 2016 2 KB 冗余代码整理
using System;
using System.Data;
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 == "专题图审核")
            {
                Text = "专题图审核记录";
                //dataGridViewX1.Columns["申请状态"].DataPropertyName = "mapstatus";
            }
            if (strMark == "打印审核")
            {
                Text = "打印审核记录";
                //dataGridViewX1.Columns["申请状态"].DataPropertyName = "printstatus";
            }
            if (strMark == "拷贝审核")
            {
                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;
            }
        }
    }
}