コード例 #1
0
    private void BindGrid11()
    {
        string connectionString = ConfigurationManager.ConnectionStrings["ERPconnectionstring"].ToString();

        Ede.Uof.Utility.Data.DatabaseHelper m_db = new Ede.Uof.Utility.Data.DatabaseHelper(connectionString);

        StringBuilder cmdTxt = new StringBuilder();
        StringBuilder QUERYS = new StringBuilder();


        cmdTxt.AppendFormat(@" 
                            SELECT 
                            [ID]
                            ,[KINDS]
                            ,[NAMES]
                            ,[MOQS]
                            ,[INDAYS]
                            ,[COMMENTS]
                            FROM [TKBUSINESS].[dbo].[TBPURMOQ]
                            WHERE [KINDS]=@KINDS
                            ORDER BY [ID]
                            ");



        m_db.AddParameter("@KINDS", "新版");
        //m_db.AddParameter("@EDATE", EDATE);

        DataTable dt = new DataTable();

        dt.Load(m_db.ExecuteReader(cmdTxt.ToString()));

        Grid11.DataSource = dt;
        Grid11.DataBind();
    }
コード例 #2
0
    private void BindGrid11(string SDATE, string EDATE, string COMPANY_NAME)
    {
        string connectionString = ConfigurationManager.ConnectionStrings["connectionstring"].ToString();

        Ede.Uof.Utility.Data.DatabaseHelper m_db = new Ede.Uof.Utility.Data.DatabaseHelper(connectionString);

        // AND (NOTE_CONTENT LIKE '%主管決議:是%' OR NOTE_CONTENT LIKE '%主管決議: 是%' OR NOTE_CONTENT LIKE '%主管決議:  是%')
        StringBuilder cmdTxt = new StringBuilder();

        cmdTxt.AppendFormat(@" 
                        SELECT [tb_USER].[USER_NAME],[COMPANY_NAME] ,REPLACE([NOTE_CONTENT],char(10),'<br/>') AS [NOTE_CONTENT] ,[tb_NOTE].[CREATE_DATETIME],CASE WHEN ([tb_NOTE].[FILE_NAME] LIKE '%.J%' OR [tb_NOTE].[FILE_NAME] LIKE '%.j%' OR [tb_NOTE].[FILE_NAME] LIKE '%.P%' OR [tb_NOTE].[FILE_NAME] LIKE '%.p%' ) THEN [tb_NOTE].[FILE_NAME] ELSE NULL END AS [FILE_NAME]
                        FROM [HJ_BM_DB].[dbo].[tb_NOTE],[HJ_BM_DB].[dbo].[tb_COMPANY] 
                        LEFT JOIN [HJ_BM_DB].[dbo].[tb_USER] ON [USER_ID]=[OWNER_ID]
                        LEFT JOIN [HJ_BM_DB].[dbo].[COPSALES] ON [COPSALES].[USER_ID]=[tb_USER].[USER_ID]
                        WHERE [tb_COMPANY].COMPANY_ID=[tb_NOTE].COMPANY_ID 
                        AND CONVERT(nvarchar,[tb_NOTE].[CREATE_DATETIME],111)>=@SDATE AND CONVERT(nvarchar,[tb_NOTE].[CREATE_DATETIME],111)<=@EDATE
                        AND [tb_NOTE].[COMPANY_ID]<>'0'
                        AND [COMPANY_NAME] LIKE '%{0}%'
                        ORDER BY [ORDERS],[USER_NAME],[COMPANY_NAME], [tb_NOTE].[CREATE_DATETIME]

                        ", COMPANY_NAME);

        m_db.AddParameter("@SDATE", SDATE);
        m_db.AddParameter("@EDATE", EDATE);

        DataTable dt = new DataTable();

        dt.Load(m_db.ExecuteReader(cmdTxt.ToString()));

        Grid11.DataSource = dt;
        Grid11.DataBind();
    }
コード例 #3
0
 private void BindGrid(int n)
 {
     if (n == 0)
     {
         EducationLevelBLL      objBLL  = new EducationLevelBLL();
         IList <EducationLevel> objList = objBLL.GetAllEducationLevel();
         Grid1.DataSource = objList;
         Grid1.DataBind();
         Grid1.Visible = true;
         Grid2.Visible = false;
         Grid3.Visible = false;
         Grid4.Visible = false;
         Grid5.Visible = false;
         Grid6.Visible = false;
         Grid7.Visible = false;
         Grid8.Visible = false;
         Grid9.Visible = false;
     }
     if (n == 1)
     {
         PoliticalStatusBLL      objBLL  = new PoliticalStatusBLL();
         IList <PoliticalStatus> objList = objBLL.GetAllPoliticalStatus();
         Grid2.DataSource = objList;
         Grid2.DataBind();
         Grid1.Visible = false;
         Grid2.Visible = true;
         Grid3.Visible = false;
         Grid4.Visible = false;
         Grid5.Visible = false;
         Grid6.Visible = false;
         Grid7.Visible = false;
         Grid8.Visible = false;
         Grid9.Visible = false;
     }
     if (n == 2)
     {
         WorkGroupLeaderLevelBLL      objBLL  = new WorkGroupLeaderLevelBLL();
         IList <WorkGroupLeaderLevel> objList = objBLL.GetAllWorkGroupLeaderLevel();
         Grid3.DataSource = objList;
         Grid3.DataBind();
         Grid1.Visible = false;
         Grid2.Visible = false;
         Grid3.Visible = true;
         Grid4.Visible = false;
         Grid5.Visible = false;
         Grid6.Visible = false;
         Grid7.Visible = false;
         Grid8.Visible = false;
         Grid9.Visible = false;
     }
     if (n == 3)
     {
         TechnicianTypeBLL      objBLL  = new TechnicianTypeBLL();
         IList <TechnicianType> objList = objBLL.GetAllTechnicianType();
         Grid4.DataSource = objList;
         Grid4.DataBind();
         Grid1.Visible = false;
         Grid2.Visible = false;
         Grid3.Visible = false;
         Grid4.Visible = true;
         Grid5.Visible = false;
         Grid6.Visible = false;
         Grid7.Visible = false;
         Grid8.Visible = false;
         Grid9.Visible = false;
     }
     if (n == 4)
     {
         TechnicianTitleTypeBLL      objBLL  = new TechnicianTitleTypeBLL();
         IList <TechnicianTitleType> objList = objBLL.GetAllTechnicianTitleType();
         Grid5.DataSource = objList;
         Grid5.DataBind();
         Grid1.Visible = false;
         Grid2.Visible = false;
         Grid3.Visible = false;
         Grid4.Visible = false;
         Grid5.Visible = true;
         Grid6.Visible = false;
         Grid7.Visible = false;
         Grid8.Visible = false;
         Grid9.Visible = false;
     }
     if (n == 5)
     {
         EducationEmployeeTypeBLL      objBLL  = new EducationEmployeeTypeBLL();
         IList <EducationEmployeeType> objList = objBLL.GetAllEducationEmployeeType();
         Grid6.DataSource = objList;
         Grid6.DataBind();
         Grid1.Visible = false;
         Grid2.Visible = false;
         Grid3.Visible = false;
         Grid4.Visible = false;
         Grid5.Visible = false;
         Grid6.Visible = true;
         Grid7.Visible = false;
         Grid8.Visible = false;
         Grid9.Visible = false;
     }
     if (n == 6)
     {
         CommitteeHeadShipBLL      objBLL  = new CommitteeHeadShipBLL();
         IList <CommitteeHeadShip> objList = objBLL.GetAllCommitteeHeadShip();
         Grid7.DataSource = objList;
         Grid7.DataBind();
         Grid1.Visible = false;
         Grid2.Visible = false;
         Grid3.Visible = false;
         Grid4.Visible = false;
         Grid5.Visible = false;
         Grid6.Visible = false;
         Grid7.Visible = true;
         Grid8.Visible = false;
         Grid9.Visible = false;
     }
     if (n == 7)
     {
         RandomExamModularTypeBLL      objBLL  = new RandomExamModularTypeBLL();
         IList <RandomExamModularType> objList = objBLL.GetAllRandomExamModularType();
         Grid8.DataSource = objList;
         Grid8.DataBind();
         Grid1.Visible = false;
         Grid2.Visible = false;
         Grid3.Visible = false;
         Grid4.Visible = false;
         Grid5.Visible = false;
         Grid6.Visible = false;
         Grid7.Visible = false;
         Grid8.Visible = true;
         Grid9.Visible = false;
     }
     if (n == 8)
     {
         OracleAccess oracle = new OracleAccess();
         DataTable    dt     = oracle.RunSqlDataSet("select * from zj_trainplan_type order by trainplan_type_id").Tables[0];
         Grid9.DataSource = dt;
         Grid9.DataBind();
         Grid1.Visible = false;
         Grid2.Visible = false;
         Grid3.Visible = false;
         Grid4.Visible = false;
         Grid5.Visible = false;
         Grid6.Visible = false;
         Grid7.Visible = false;
         Grid8.Visible = false;
         Grid9.Visible = true;
     }
     if (n == 9)
     {
         OracleAccess oracle = new OracleAccess();
         DataTable    dt     = oracle.RunSqlDataSet("select * from zj_safe_level order by order_index").Tables[0];
         Grid10.DataSource = dt;
         Grid10.DataBind();
         Grid1.Visible  = false;
         Grid2.Visible  = false;
         Grid3.Visible  = false;
         Grid4.Visible  = false;
         Grid5.Visible  = false;
         Grid6.Visible  = false;
         Grid7.Visible  = false;
         Grid8.Visible  = false;
         Grid9.Visible  = false;
         Grid10.Visible = true;
     }
     if (n == 10)
     {
         OracleAccess oracle = new OracleAccess();
         DataTable    dt     = oracle.RunSqlDataSet("select * from zj_certificate order by order_index").Tables[0];
         Grid11.DataSource = dt;
         Grid11.DataBind();
         Grid1.Visible  = false;
         Grid2.Visible  = false;
         Grid3.Visible  = false;
         Grid4.Visible  = false;
         Grid5.Visible  = false;
         Grid6.Visible  = false;
         Grid7.Visible  = false;
         Grid8.Visible  = false;
         Grid9.Visible  = false;
         Grid10.Visible = false;
         Grid11.Visible = true;
     }
     if (n == 11)
     {
         OracleAccess oracle = new OracleAccess();
         DataTable    dt     = oracle.RunSqlDataSet(@"select a.*,b.certificate_name from zj_certificate_level a 
                                               left join zj_certificate b on a.certificate_id=b.certificate_id order by a.order_index").Tables[0];
         Grid12.DataSource = dt;
         Grid12.DataBind();
         Grid1.Visible  = false;
         Grid2.Visible  = false;
         Grid3.Visible  = false;
         Grid4.Visible  = false;
         Grid5.Visible  = false;
         Grid6.Visible  = false;
         Grid7.Visible  = false;
         Grid8.Visible  = false;
         Grid9.Visible  = false;
         Grid10.Visible = false;
         Grid11.Visible = false;
         Grid12.Visible = true;
     }
     if (n == 12)
     {
         OracleAccess oracle = new OracleAccess();
         DataTable    dt     = oracle.RunSqlDataSet(" select * from zj_certificate_unit order by order_index").Tables[0];
         Grid13.DataSource = dt;
         Grid13.DataBind();
         Grid1.Visible  = false;
         Grid2.Visible  = false;
         Grid3.Visible  = false;
         Grid4.Visible  = false;
         Grid5.Visible  = false;
         Grid6.Visible  = false;
         Grid7.Visible  = false;
         Grid8.Visible  = false;
         Grid9.Visible  = false;
         Grid10.Visible = false;
         Grid11.Visible = false;
         Grid12.Visible = false;
         Grid13.Visible = true;
     }
     if (n == 13)
     {
         OracleAccess oracle = new OracleAccess();
         DataTable    dt     = oracle.RunSqlDataSet(" select * from zj_train_unit order by order_index").Tables[0];
         Grid14.DataSource = dt;
         Grid14.DataBind();
         Grid1.Visible  = false;
         Grid2.Visible  = false;
         Grid3.Visible  = false;
         Grid4.Visible  = false;
         Grid5.Visible  = false;
         Grid6.Visible  = false;
         Grid7.Visible  = false;
         Grid8.Visible  = false;
         Grid9.Visible  = false;
         Grid10.Visible = false;
         Grid11.Visible = false;
         Grid12.Visible = false;
         Grid13.Visible = false;
         Grid14.Visible = true;
     }
 }