Esempio n. 1
0
        public void Update01(DataTable dt)
        {
            if (dt == null)
            {
                return;
            }

            foreach (DataRow row in dt.Rows)
            {
                ParameterPackageCollection parameters = new ParameterPackageCollection();
                parameters.AddParameter("USER_ID", row["USER_ID"]);
                parameters.AddParameter("VIEW_ID", row["VIEW_ID"]);
                parameters.AddParameter("AUTH_KIND", row["AUTH_KIND"]);
                parameters.AddParameter("AUTH_YN", row["AUTH_YN"]);
                parameters.AddParameter("LOGIN_ID", SharedCache.UserId);

                IDBHelper helper = DbHelperFactory.CreateDbHelper("MES_DB");
                helper.ExecuteNonQuery(
                    @"UPDATE TB_VIEW_AUTH 
                         SET AUTH_KIND    = @AUTH_KIND      
                           , AUTH_YN      = @AUTH_YN 
                           , UPDATE_USER  = @LOGIN_ID
                           , UPDATE_TIME  = GETDATE()
                       WHERE USER_ID   = @USER_ID
                         AND VIEW_ID   = @VIEW_ID
                         AND AUTH_KIND = @AUTH_KIND"
                    , CommandType.Text
                    , parameters);
            }
        }
Esempio n. 2
0
        public DataTable Select01()
        {
            IDBHelper helper      = DbHelperFactory.CreateDbHelper("MES_DB");
            DataTable resultTable = helper.FillTable
                                    (
                cmdText: @"SELECT MENU_ID
                                 ,MENU_DESC
                                 ,PARENT_ID
                                 ,VIEW_ID
                                 ,ORDER_SEQ
                                 ,USE_YN
                                 ,ASSEMBLY_NAME
                                 ,USER_GROUP
                                 ,INSERT_USER
                                 ,INSERT_TIME
                                 ,UPDATE_USER
                                 ,UPDATE_TIME
                                 ,ROW_ID
                            FROM TB_MENU_INFO
                           ORDER BY PARENT_ID, ORDER_SEQ",
                cmdType:    CommandType.Text,
                parameters: null
                                    );

            return(resultTable);
        }
Esempio n. 3
0
        public void Update01(DataTable dt)
        {
            if (dt == null)
            {
                return;
            }

            foreach (DataRow row in dt.Rows)
            {
                ParameterPackageCollection parameters = new ParameterPackageCollection();
                parameters.AddParameter("MENU_ID", row["MENU_ID"]);
                parameters.AddParameter("MENU_DESC", row["MENU_DESC"]);
                parameters.AddParameter("PARENT_ID", row["PARENT_ID"]);
                parameters.AddParameter("VIEW_ID", row["VIEW_ID"]);
                parameters.AddParameter("ORDER_SEQ", row["ORDER_SEQ"]);
                parameters.AddParameter("USE_YN", row["USE_YN"]);
                parameters.AddParameter("ASSEMBLY_NAME", row["ASSEMBLY_NAME"]);
                parameters.AddParameter("LOGIN_ID", SharedCache.UserId);

                IDBHelper helper = DbHelperFactory.CreateDbHelper("MES_DB");
                helper.ExecuteNonQuery(
                    @"UPDATE TB_MENU_INFO 
                         SET MENU_DESC      = @MENU_DESC
                           , PARENT_ID      = @PARENT_ID
                           , VIEW_ID        = @VIEW_ID
                           , ORDER_SEQ      = @ORDER_SEQ
                           , USE_YN         = @USE_YN
                           , ASSEMBLY_NAME  = @ASSEMBLY_NAME
                           , UPDATE_USER    = @LOGIN_ID
                           , UPDATE_TIME    = GETDATE()
                       WHERE MENU_ID = @MENU_ID"
                    , CommandType.Text
                    , parameters);
            }
        }
Esempio n. 4
0
        public void Update02(DataTable dt)
        {
            if (dt == null)
            {
                return;
            }

            foreach (DataRow row in dt.Rows)
            {
                ParameterPackageCollection parameters = new ParameterPackageCollection();
                parameters.AddParameter("MCODE", row["MCODE"]);
                parameters.AddParameter("CODE", row["CODE"]);
                parameters.AddParameter("NAME", row["NAME"]);
                parameters.AddParameter("ORDER_SEQ", row["ORDER_SEQ"]);
                parameters.AddParameter("USE_YN", row["USE_YN"]);
                parameters.AddParameter("LOGIN_ID", SharedCache.UserId);

                IDBHelper helper = DbHelperFactory.CreateDbHelper("MES_DB");
                helper.ExecuteNonQuery(
                    @"UPDATE TB_CODE_D 
                         SET CODE          = @CODE    
                           , NAME          = @NAME 
                           , ORDER_SEQ     = @ORDER_SEQ    
                           , USE_YN        = @USE_YN    
                           , UPDATE_USER   = @LOGIN_ID
                           , UPDATE_TIME   = GETDATE()
                       WHERE MCODE = @MCODE
                         AND CODE  = @CODE"
                    , CommandType.Text
                    , parameters);
            }
        }
Esempio n. 5
0
        public DataTable Select01(string userNo, string userName)
        {
            ParameterPackageCollection parameters = new ParameterPackageCollection();

            parameters.AddParameter("USER_ID", userNo);
            parameters.AddParameter("USER_NAME", userName);

            IDBHelper helper      = DbHelperFactory.CreateDbHelper("MES_DB");
            DataTable resultTable = helper.FillTable(
                @"SELECT USER_ID
                        ,USER_NAME
                        ,PASSWD
                        ,REMARK
                        ,INSERT_USER
                        ,INSERT_TIME
                        ,UPDATE_USER
                        ,UPDATE_TIME
                        ,ROW_ID
                    FROM TB_USER_INFO
                   WHERE (@USER_ID = ''   OR USER_ID   = @USER_ID)
                     AND (@USER_NAME = '' OR USER_NAME = @USER_NAME)"
                , CommandType.Text
                , parameters
                );

            return(resultTable);
        }
Esempio n. 6
0
        public void Update01(DataTable dt)
        {
            if (dt == null)
            {
                return;
            }

            foreach (DataRow row in dt.Rows)
            {
                ParameterPackageCollection parameters = new ParameterPackageCollection();
                parameters.AddParameter("USER_ID", row["USER_ID"]);
                parameters.AddParameter("USER_NAME", row["USER_NAME"]);
                parameters.AddParameter("USER_GROUP", row["USER_GROUP"]);
                parameters.AddParameter("DEPARTMENT", row["DEPARTMENT"]);
                parameters.AddParameter("RANK_CODE", row["RANK_CODE"]);
                parameters.AddParameter("ENTER_TIME", row["ENTER_TIME"]);
                parameters.AddParameter("LOGIN_ID", SharedCache.UserId);

                IDBHelper helper = DbHelperFactory.CreateDbHelper("MES_DB");
                helper.ExecuteNonQuery(
                    @"UPDATE TB_USER_INFO
                         SET USER_NAME   = @USER_NAME
                           , USER_GROUP  = @USER_GROUP
                           , DEPARTMENT  = @DEPARTMENT
                           , RANK_CODE   = @RANK_CODE
                           , ENTER_TIME  = @ENTER_TIME
                           , UPDATE_USER = @LOGIN_ID
                           , UPDATE_TIME = GETDATE()
                       WHERE USER_ID     = @USER_ID"
                    , CommandType.Text
                    , parameters);
            }
        }
Esempio n. 7
0
        public DataTable Select01(string userNo, string userName, string userRank)
        {
            ParameterPackageCollection parameters = new ParameterPackageCollection();

            parameters.AddParameter("USER_ID", userNo);
            parameters.AddParameter("USER_NAME", userName);
            parameters.AddParameter("RANK_CODE", userRank);

            IDBHelper helper      = DbHelperFactory.CreateDbHelper("MES_DB");
            DataTable resultTable = helper.FillTable(
                @"SELECT USER_ID
                        ,USER_NAME
                        ,USER_GROUP
                        ,RANK_CODE
                        ,DEPARTMENT
                        ,CONVERT(CHAR(10),ENTER_TIME,120) AS ENTER_TIME
                        ,INSERT_USER
                        ,INSERT_TIME
                        ,UPDATE_USER
                        ,UPDATE_TIME
                        ,ROW_ID
                    FROM TB_USER_INFO
                   WHERE (@USER_ID = ''   OR USER_ID   = @USER_ID)
                     AND (@USER_NAME = '' OR USER_NAME = @USER_NAME)
                     AND (@RANK_CODE = '' OR RANK_CODE = @RANK_CODE)"
                , CommandType.Text
                , parameters
                );

            return(resultTable);
        }
Esempio n. 8
0
        public DataTable Select02(string code)
        {
            ParameterPackageCollection parameters = new ParameterPackageCollection();

            parameters.AddParameter("CODE", code);

            IDBHelper helper      = DbHelperFactory.CreateDbHelper("MES_DB");
            var       query       = @"SELECT USER_ID
                                ,USER_NAME
                                ,USER_GROUP
                                ,RANK_CODE
                                ,DEPARTMENT
                                ,CONVERT(CHAR(10),ENTER_TIME,120) AS ENTER_TIME
                                ,INSERT_USER
                                ,INSERT_TIME
                                ,UPDATE_USER
                                ,UPDATE_TIME
                                ,ROW_ID
                            FROM TB_USER_INFO
                           WHERE USER_GROUP = @CODE
                           ORDER BY USER_ID";
            var       resultTable = helper.FillTable(query, CommandType.Text, parameters);

            return(resultTable);
        }
Esempio n. 9
0
        public void Insert01(DataTable dt)
        {
            if (dt == null)
            {
                return;
            }

            foreach (DataRow row in dt.Rows)
            {
                ParameterPackageCollection parameters = new ParameterPackageCollection();
                parameters.AddParameter("USER_ID", row["USER_ID"]);
                parameters.AddParameter("USER_NAME", row["USER_NAME"]);
                parameters.AddParameter("RANK_CODE", row["RANK_CODE"]);
                parameters.AddParameter("DEPARTMENT", row["DEPARTMENT"]);
                parameters.AddParameter("ENTER_TIME", row["ENTER_TIME"]);
                parameters.AddParameter("LOGIN_ID", SharedCache.UserId);


                IDBHelper helper = DbHelperFactory.CreateDbHelper("MES_DB");
                helper.ExecuteNonQuery(
                    @"INSERT TB_USER_INFO (USER_ID, USER_NAME, RANK_CODE, ENTER_TIME, DEPARTMENT, INSERT_USER, INSERT_TIME)
                              VALUES (@USER_ID, @USER_NAME, @RANK_CODE, @ENTER_TIME, @DEPARTMENT, @LOGIN_ID, GETDATE())"
                    , CommandType.Text
                    , parameters);
            }
        }
Esempio n. 10
0
        public DataTable Select01(string MCODE = "")
        {
            ParameterPackageCollection parameters = new ParameterPackageCollection();

            parameters.AddParameter("MCODE", MCODE);

            IDBHelper helper      = DbHelperFactory.CreateDbHelper("MES_DB");
            DataTable resultTable = helper.FillTable
                                    (
                cmdText: @"SELECT MCODE
                                , NAME
                                , USE_YN
                                , REMARK
                                , INSERT_USER
                                , INSERT_TIME
                                , UPDATE_USER
                                , UPDATE_TIME
                                FROM TB_CODE_M
                               WHERE (ISNULL(@MCODE, '') = '' OR MCODE = @MCODE)
                               ORDER BY MCODE",
                cmdType:    CommandType.Text,
                parameters: parameters
                                    );

            return(resultTable);
        }
Esempio n. 11
0
        public DataTable Select02(string MCODE)
        {
            ParameterPackageCollection parameters = new ParameterPackageCollection();

            parameters.AddParameter("MCODE", MCODE);

            IDBHelper helper      = DbHelperFactory.CreateDbHelper("MES_DB");
            DataTable resultTable = helper.FillTable
                                    (
                cmdText: @"SELECT MCODE
                                , CODE
                                , NAME
                                , ORDER_SEQ
                                , USE_YN
                                , INSERT_USER
                                , INSERT_TIME
                                , UPDATE_USER
                                , UPDATE_TIME
                                FROM TB_CODE_D
                               WHERE MCODE = @MCODE
                               ORDER BY ORDER_SEQ",
                cmdType:    CommandType.Text,
                parameters: parameters
                                    );

            return(resultTable);
        }
Esempio n. 12
0
        public void Update01(DataTable dt)
        {
            if (dt == null)
            {
                return;
            }

            foreach (DataRow row in dt.Rows)
            {
                ParameterPackageCollection parameters = new ParameterPackageCollection();
                parameters.AddParameter("USER_ID", row["USER_ID"]);
                parameters.AddParameter("USER_NAME", row["USER_NAME"]);
                parameters.AddParameter("PASSWD", row["PASSWD"]);
                parameters.AddParameter("REMARK", row["REMARK"]);
                parameters.AddParameter("LOGIN_ID", SharedCache.UserId);

                IDBHelper helper = DbHelperFactory.CreateDbHelper("MES_DB");
                helper.ExecuteNonQuery(
                    @"UPDATE TB_USER_INFO
                         SET USER_NAME   = @USER_NAME
                           , PASSWD      = @PASSWD
                           , REMARK      = @REMARK
                           , UPDATE_USER = @LOGIN_ID
                           , UPDATE_TIME = GETDATE()
                       WHERE USER_ID     = @USER_ID"
                    , CommandType.Text
                    , parameters);
            }
        }
Esempio n. 13
0
        public DataTable MenuSelect()
        {
            var       query       = @"SELECT * FROM TB_MENU_INFO ORDER BY PARENT_ID,ORDER_SEQ";
            IDBHelper helper      = DbHelperFactory.CreateDbHelper("MES_DB");
            DataTable resultTable = helper.FillTable(query, CommandType.Text, null);

            return(resultTable);
        }
Esempio n. 14
0
        public DataTable ComboBoxCodeSelect(string masterCode)
        {
            ParameterPackageCollection parameters = new ParameterPackageCollection();

            parameters.AddParameter("MCODE", masterCode);
            var query = @"SELECT * FROM TB_CODE_D WHERE MCODE = @MCODE ORDER BY ORDER_SEQ";

            IDBHelper helper      = DbHelperFactory.CreateDbHelper("MES_DB");
            DataTable resultTable = helper.FillTable(query, CommandType.Text, parameters);

            return(resultTable);
        }
Esempio n. 15
0
        public DataTable AuthInfoSelect()
        {
            ParameterPackageCollection parameters = new ParameterPackageCollection();

            parameters.AddParameter("USER_ID", SharedCache.UserId);
            var       query       = @"SELECT * 
                            FROM TB_VIEW_AUTH 
                           WHERE USER_ID = @USER_ID";
            IDBHelper helper      = DbHelperFactory.CreateDbHelper("MES_DB");
            DataTable resultTable = helper.FillTable(query, CommandType.Text, parameters);

            return(resultTable);
        }
Esempio n. 16
0
        public void Insert01(DataTable dt)
        {
            if (dt == null)
            {
                return;
            }

            foreach (DataRow row in dt.Rows)
            {
                ParameterPackageCollection parameters = new ParameterPackageCollection();
                parameters.AddParameter("MENU_ID", row["MENU_ID"]);
                parameters.AddParameter("MENU_DESC", row["MENU_DESC"]);
                parameters.AddParameter("PARENT_ID", row["PARENT_ID"]);
                parameters.AddParameter("VIEW_ID", row["VIEW_ID"]);
                parameters.AddParameter("ORDER_SEQ", row["ORDER_SEQ"]);
                parameters.AddParameter("USE_YN", row["USE_YN"]);
                parameters.AddParameter("ASSEMBLY_NAME", row["ASSEMBLY_NAME"]);
                parameters.AddParameter("LOGIN_ID", SharedCache.UserId);

                IDBHelper helper = DbHelperFactory.CreateDbHelper("MES_DB");
                helper.ExecuteNonQuery(
                    @"INSERT 
                        INTO TB_MENU_INFO 
                             ( MENU_ID
                              ,MENU_DESC    
                              ,PARENT_ID    
                              ,VIEW_ID      
                              ,ORDER_SEQ    
                              ,USE_YN       
                              ,ASSEMBLY_NAME
                              ,INSERT_USER
                              ,INSERT_TIME  
                             )
                      VALUES ( @MENU_ID
                              ,@MENU_DESC    
                              ,@PARENT_ID    
                              ,@VIEW_ID      
                              ,@ORDER_SEQ    
                              ,@USE_YN       
                              ,@ASSEMBLY_NAME
                              ,@LOGIN_ID
                              ,GETDATE()  
                             )"
                    , CommandType.Text
                    , parameters);
            }
        }
Esempio n. 17
0
        public DataTable Select01()
        {
            IDBHelper helper      = DbHelperFactory.CreateDbHelper("MES_DB");
            var       query       = @"SELECT CODE
                               , NAME        
                               , INSERT_USER
                               , INSERT_TIME
                               , UPDATE_USER
                               , UPDATE_TIME
                               , ROW_ID     
                            FROM TB_CODE_D 
                           WHERE MCODE  = 'USER_GROUP' 
                             AND USE_YN = 'Y'
                           ORDER BY ORDER_SEQ";
            var       resultTable = helper.FillTable(query, CommandType.Text, null);

            return(resultTable);
        }
Esempio n. 18
0
        public void Delete01(DataTable dt)
        {
            if (dt == null)
            {
                return;
            }

            foreach (DataRow row in dt.Rows)
            {
                ParameterPackageCollection parameters = new ParameterPackageCollection();
                parameters.AddParameter("MENU_ID", row["MENU_ID", DataRowVersion.Original]);

                IDBHelper helper = DbHelperFactory.CreateDbHelper("MES_DB");
                helper.ExecuteNonQuery(
                    @"DELETE FROM TB_MENU_INFO
                   WHERE MENU_ID = @MENU_ID"
                    , CommandType.Text
                    , parameters);
            }
        }
Esempio n. 19
0
        public void Insert02(DataTable dt)
        {
            if (dt == null)
            {
                return;
            }

            foreach (DataRow row in dt.Rows)
            {
                ParameterPackageCollection parameters = new ParameterPackageCollection();
                parameters.AddParameter("MCODE", row["MCODE"]);
                parameters.AddParameter("CODE", row["CODE"]);
                parameters.AddParameter("NAME", row["NAME"]);
                parameters.AddParameter("ORDER_SEQ", row["ORDER_SEQ"]);
                parameters.AddParameter("USE_YN", row["USE_YN"]);
                parameters.AddParameter("LOGIN_ID", SharedCache.UserId);

                IDBHelper helper = DbHelperFactory.CreateDbHelper("MES_DB");
                helper.ExecuteNonQuery(
                    @"INSERT 
                        INTO TB_CODE_D 
                             ( MCODE
                              ,CODE    
                              ,NAME    
                              ,ORDER_SEQ
                              ,USE_YN    
                              ,INSERT_USER
                              ,INSERT_TIME  
                             )
                      VALUES ( @MCODE
                              ,@CODE      
                              ,@NAME      
                              ,@ORDER_SEQ
                              ,@USE_YN    
                              ,@LOGIN_ID  
                              ,GETDATE()  
                             )"
                    , CommandType.Text
                    , parameters);
            }
        }
Esempio n. 20
0
        public void Update02(DataTable dt)
        {
            if (dt == null)
            {
                return;
            }

            foreach (DataRow row in dt.Rows)
            {
                ParameterPackageCollection parameters = new ParameterPackageCollection();
                parameters.AddParameter("USER_ID", row["USER_ID"]);
                parameters.AddParameter("USER_GROUP", row["USER_GROUP"]);

                IDBHelper helper = DbHelperFactory.CreateDbHelper("MES_DB");
                var       query  = @"UPDATE TB_USER_INFO 
                                 SET USER_GROUP = @USER_GROUP
                               WHERE USER_ID    = @USER_ID";

                helper.ExecuteNonQuery(query, CommandType.Text, parameters);
            }
        }
Esempio n. 21
0
        public string PasswordCheck(string id, string password)
        {
            ParameterPackageCollection parameters = new ParameterPackageCollection();

            parameters.AddParameter("USER_ID", id);
            parameters.AddParameter("PASSWD", password);

            IDBHelper helper      = DbHelperFactory.CreateDbHelper("MES_DB");
            var       resultTable = helper.FillTable(
                cmdText: @"SELECT USER_ID
                             FROM TB_USER_INFO       A
                            WHERE A.USER_ID = @USER_ID
                              AND A.PASSWD  = @PASSWD"
                , cmdType: CommandType.Text
                , parameters: parameters);

            if (resultTable.Rows.Count == 0)
            {
                return(null);
            }
            return((resultTable.Rows[0] as DataRow)["USER_ID"].ToString());
        }
Esempio n. 22
0
        public void Insert01(DataTable dt)
        {
            if (dt == null)
            {
                return;
            }

            foreach (DataRow row in dt.Rows)
            {
                ParameterPackageCollection parameters = new ParameterPackageCollection();
                parameters.AddParameter("USER_ID", row["USER_ID"]);
                parameters.AddParameter("VIEW_ID", row["VIEW_ID"]);
                parameters.AddParameter("AUTH_KIND", row["AUTH_KIND"]);
                parameters.AddParameter("AUTH_YN", row["AUTH_YN"]);
                parameters.AddParameter("LOGIN_ID", SharedCache.UserId);

                IDBHelper helper = DbHelperFactory.CreateDbHelper("MES_DB");
                helper.ExecuteNonQuery(
                    @"INSERT 
                        INTO TB_VIEW_AUTH 
                             ( USER_ID
                              ,VIEW_ID    
                              ,AUTH_KIND    
                              ,AUTH_YN    
                              ,INSERT_USER
                              ,INSERT_TIME  
                             )
                      VALUES ( @USER_ID
                              ,@VIEW_ID    
                              ,@AUTH_KIND    
                              ,@AUTH_YN    
                              ,@LOGIN_ID
                              ,GETDATE()  
                             )"
                    , CommandType.Text
                    , parameters);
            }
        }
Esempio n. 23
0
        public DataTable Select01()
        {
            IDBHelper helper      = DbHelperFactory.CreateDbHelper("MES_DB");
            DataTable resultTable = helper.FillTable
                                    (
                cmdText: @"SELECT A.USER_ID
                                 ,A.VIEW_ID
                                 ,B.MENU_DESC
                                 ,A.AUTH_KIND
                                 ,A.AUTH_YN
                                 ,A.INSERT_USER
                                 ,A.INSERT_TIME
                                 ,A.UPDATE_USER
                                 ,A.UPDATE_TIME
                                 ,A.ROW_ID
                            FROM TB_VIEW_AUTH       A
                            LEFT JOIN TB_MENU_INFO  B ON A.VIEW_ID = B.VIEW_ID",
                cmdType: CommandType.Text,
                parameters: null
                                    );

            return(resultTable);
        }