public IList<Sys_Role> GetAllRole(string applicationName)
 {
     String stmtId = "Sys_Role.GetAllRole";
     Sys_Role r = new Sys_Role();
     r.ApplicationName = applicationName;
     IList<Sys_Role> result = SqlMapper.QueryForList<Sys_Role>(stmtId, r);
     return result;
 }
 public Sys_Role Find(string applicationName, string roleName)
 {
     String stmtId = "Sys_Role.FindByName";
     Sys_Role r = new Sys_Role();
     r.ApplicationName = applicationName;
     r.RoleName = roleName;
     Sys_Role result = SqlMapper.QueryForObject<Sys_Role>(stmtId, r);
     return result;
 }
 public bool Delete(string applicationName, string roleName)
 {
     String stmtId = "Sys_Role.DeleteByName";
     Sys_Role role = new Sys_Role();
     role.ApplicationName = applicationName;
     role.RoleName = roleName;
     if (SqlMapper.Update(stmtId, role) > 0) {
         return true;
     }
     else return false;
 }
        public override void CreateRole(string rolename)
        {
            if (rolename.IndexOf(',') > 0) {
                throw new ArgumentException("Role names cannot contain commas.");
            }

            if (RoleExists(rolename)) {
                throw new ProviderException("Role name already exists.");
            }

            Sys_Role role = new Sys_Role();
            role.ApplicationName = ApplicationName;
            role.RoleName = rolename;
            _roleRepository.Insert(role);
        }
 public bool Insert(Sys_Role obj)
 {
     if (obj == null) throw new ArgumentNullException("obj");
     String stmtId = "Sys_Role.Insert";
     if (SqlMapper.Update(stmtId, obj) > 0) {
         return true;
     }
     else return false;
 }