Пример #1
0
        public void EditRole(string Id,string roleName)
        {
            var role = new Role();

            role.Name = roleName;
            var userDa = new UserDa(databasecontext);
            //update
            userDa.UpdateRole(role);
        }
Пример #2
0
        public void SaveRole(int id, string Name)
        {
            var role = id > 0 ? GetRoleById(id) : new Role();

            role.Name = Name;
            var userDa = new UserDa(databasecontext);

            //if new
            if (id < 1) userDa.AddRole(role);
            //update
            else userDa.UpdateRole(role);
        }