public static bool CanApproveRates(int userID) { Function f = Function.GetFunctionByName(Function.RATES_APPROVER); UsersFunction uf = UsersFunction.GetByFunctionAndUser(f.ID, userID); if (uf != null) { return(true); } return(false); }
public static List <User> getRatesApprovers(User u) { Function f = Function.GetFunctionByName(Function.RATES_APPROVER); List <UsersFunction> listUsersFunctions = UsersFunction.getUsersWithFunction(f.ID); List <User> users = new List <User>(); if (CanApproveRates(u.ID)) { users.Add(u); } else { foreach (UsersFunction uf in listUsersFunctions) { users.Add(User.Get(uf.UserID)); } } return(users); }
/// <summary> /// vrakja web strana spored imeto na funkcijata /// </summary> /// <param name="name">string name</param> /// <returns>Vrakja object WebPage</returns> /// Se povikuva vo UsersManagementControllers\WebPagesVisibilityController.cs public static WebPage GetWebPageByFunctionName(string name) { Function f = Function.GetFunctionByName(name); return(GetWebPageByFunction(f)); }