//获取员工权限 public static bool getAuthority(WatcherDBDataContext db, Employee employee, string pro) { var authority = db.Authority.FirstOrDefault(x => x.emplyeeId == employee.id); if (authority == null) authority = db.Authority.FirstOrDefault(x => x.jobId == employee.jobId); var proVal = authority.GetType().GetProperty(pro); //if (proVal == null) //return true; return Convert.ToBoolean(proVal.GetValue(authority, null)); }
partial void UpdateEmployee(Employee instance);
partial void DeleteEmployee(Employee instance);
partial void InsertEmployee(Employee instance);