public static IProject Get(Guid project_id) { using (Context ctx = new Context("")) { return ProjectUtility.Get(ctx, project_id); } }
public static List<IProject> GetAll() { using (Context ctx = new Context("")) { return ProjectUtility.GetAll(ctx); } }
public static void Update(IProject project) { if (project == null) return; using (Context ctx = new Context("")) { ProjectUtility.Update(ctx, project); } }
public static void Delete(Guid project_id) { if(project_id == null) return; using (Context ctx = new Context("")) { ProjectUtility.Delete(ctx, project_id); } }
public static ITask Get(Guid task_id) { if(task_id == null) return null; using (Context ctx = new Context("")) { return TaskUtility.Get(ctx, task_id); } }
public static List<ITask> GetAllProjectTask(Guid project_id) { List<ITask> projectTasks = null; if (project_id == null) return projectTasks; using (Context ctx = new Context("")) { projectTasks = TaskUtility.GetAllProjectTasks(ctx, project_id); } return projectTasks; }
public static IUser Get(Guid user_id) { IUser user = null; using (Context context = new Context("")) { if (user_id != null) { user = UserUtility.Get(context, user_id); } } return user; }
public static bool AuthorizedByRole(Guid userId, Guid resourceId) { bool result = false; using(Context ctx = new Context("")) { SqlCommand command = new SqlCommand("isAuthorizedByRole", ctx.Connection); command.Parameters.Add(new SqlParameter("UserID", userId)); command.Parameters.Add(new SqlParameter("ResourceID", resourceId)); command.Parameters.Add(new SqlParameter("Result", SqlDbType.Bit, 32, ParameterDirection.Output, false, 0, 0, "", DataRowVersion.Default, result)); command.CommandType = CommandType.StoredProcedure; command.ExecuteNonQuery(); return (bool)command.Parameters["Result"].Value; } }
public static string Login(string login, string password) { var token = (from u in _loggedInUsersByGuid where u.Value.Name.Equals(login) select u.Key).FirstOrDefault(); if (token != null) return token.ToString(); IUser user = null; using (Context context = new Context("")) { user = UserUtility.GetByLogin(context, login); } token = Guid.NewGuid(); _loggedInUsersByGuid.Add(token, user); return token.ToString(); }
public static IUser GetByLogin(Context context, string login) { throw new NotImplementedException(); }