public static int [] ValidateUserForAction(int projectId) { int [] result; List <MainActivity.Membership> memberships = RedMineManager.Get <List <MainActivity.Membership> >("/projects/" + projectId + "/memberships.json?nometa=1", "mebmerships"); var query = from r in memberships where r.user.id == currUser.id select r.roles; try { var intQuery = from g in query.SingleOrDefault() select g.id; result = intQuery.ToArray(); return(result); } catch { return(new int[1] { 0 }); } }
public RedMineManager(string login, string pass, string domen = @"http://dev.bidon-tech.com:65500/redmine") { client = new RestClient(domen); client.Authenticator = new RestSharp.Authenticators.HttpBasicAuthenticator(login, pass); currUser = RedMineManager.Get <MainActivity.User>("/users/current.json", "user"); }