Esempio n. 1
0
        public int getTotalRecords(UserGroupCriteria conditions)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

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

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                return(UserGroupDataLayer.GetInstance().GetListGroupPermission(connection, GroupID));
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
                }
            }
        }
Esempio n. 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);
                }
            }
        }
Esempio n. 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);
                }
            }
        }