예제 #1
0
        public int getTotalRecords(UserGroupCriteria conditions)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                return(UserGroupDataLayer.GetInstance().GetTotalRecords(connection, conditions));
            }
        }
예제 #2
0
        public List <UserGroupPermission> GetListGroupPermission(int GroupID)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                return(UserGroupDataLayer.GetInstance().GetListGroupPermission(connection, GroupID));
            }
        }
예제 #3
0
        public void DeleteUser(string id)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                UsersDataLayer.GetInstance().DeleteUser(connection, id);
                UserGroupDataLayer.GetInstance().DeleteGroupOfUser(connection, id);
            }
        }
예제 #4
0
        public void CreateUserGroup(UserGroupInfo _userGroup)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();
            UserGroupInfo        record        = new UserGroupInfo();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                UserGroupDataLayer.GetInstance().CreateUserGroup(connection, _userGroup);
            }
        }
예제 #5
0
        public List <UserGroupInfo> GetList(UserGroupCriteria conditions)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                List <UserGroupInfo> ListUserInfo = UserGroupDataLayer.GetInstance().Getlist(connection, conditions);
                return(ListUserInfo);
            }
        }
예제 #6
0
        public List <UserGroupInfo> GetListGroupOfUser(String userID)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                List <UserGroupInfo> ListUserInfo = UserGroupDataLayer.GetInstance().GetListGroupOfUser(connection, userID);
                return(ListUserInfo);
            }
        }
예제 #7
0
        public void DeleteUserGroup(string id)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                UserGroupDataLayer.GetInstance().DeleteGroupPermission(connection, Int32.Parse(id));
                UserGroupDataLayer.GetInstance().DeleteUserGroup(connection, id);
                UserGroupDataLayer.GetInstance().DeleteUserGroupUserByGroupID(connection, id);
            }
        }
예제 #8
0
        public void UpdateUserGroup(string id, UserGroupInfo _userGroup)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();
            UserInfo             record        = new UserInfo();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                UserInfo data = UsersDataLayer.GetInstance().GetUser(connection, id);
                UserGroupDataLayer.GetInstance().UpdateUserGroup(connection, id, _userGroup);
            }
        }
예제 #9
0
        public UserGroupInfo GetDetail(int id)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();
            UserGroupInfo        record        = new UserGroupInfo();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                record = UserGroupDataLayer.GetInstance().GetUserGroup(connection, id);

                return(record);
            }
        }
예제 #10
0
        public void UpdateGroupOfUser(String userID, List <UserGroupUser> lstGroup)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                UserGroupDataLayer.GetInstance().DeleteGroupOfUser(connection, userID);
                foreach (UserGroupUser item in lstGroup)
                {
                    UserGroupDataLayer.GetInstance().InsertGroupOfUser(connection, userID, item.GroupID);
                }
            }
        }
예제 #11
0
        public void UpdateListPermission(int GroupID, List <UserGroupPermission> groupPermissions)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                UserGroupDataLayer.GetInstance().DeleteGroupPermission(connection, GroupID);
                foreach (UserGroupPermission item in groupPermissions)
                {
                    UserGroupDataLayer.GetInstance().InsertGroupPermission(connection, GroupID, item.Feature);
                }
            }
        }
예제 #12
0
        public void DeleteUserGroups(string ids)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                string[] IDsarray = ids.Split(',');
                foreach (string id in IDsarray)
                {
                    UserGroupDataLayer.GetInstance().DeleteGroupPermission(connection, Int32.Parse(id));
                    UserGroupDataLayer.GetInstance().DeleteUserGroup(connection, id);
                }
            }
        }