public bool roleFunGive(string funids) { userfunDao ufundao = new userfunDao(); string[] funs = funids.Split(','); List <userfun> listfun = (List <userfun>)ufundao.FindAll_userfun(" 1=1 "); for (int i = 0; i < funs.Length - 1; i++) { int fatherid = -1; int funid = int.Parse(funs[i]); while (fatherid != 0) { userfun ufun = listfun.Find(delegate(userfun fun) { return(fun.funid == funid); }); rolefun _rolefun = new rolefun(); _rolefun.roleid = int.Parse(funs[funs.Length - 1]); _rolefun.rolep = 0; _rolefun.funid = ufun.funid; rolefunDao.Add_rolefun(_rolefun); funid = ufun.fatherid; fatherid = ufun.fatherid; } } return(true); }
public IList <userfun> FindAll_userfun() { return(userfunDao.FindAll_userfun("")); }