//------------------------------------------------------------------ public ActionResult RemoveMember(int?id, int?uid) { if (id == null || uid == null) { return(RedirectToAction("Index")); } if (!users.isUser(uid.Value)) { return(RedirectToAction("Index")); } if (!leaders.isIdRelated(id.Value, Convert.ToInt32(Session["userID"]))) { return(RedirectToAction("Index")); } teamLeaderProjects t = leaders.getItem(id.Value); if (t.memberOne == uid.Value) { t.memberOne = 0; } if (t.memberTwo == uid.Value) { t.memberTwo = 0; } if (t.memberThree == uid.Value) { t.memberThree = 0; } leaders.updateItem(id.Value, t); return(RedirectToAction("Index")); }
//-------------------------------------------------------------- public ActionResult LeaveProject(int?id) { if (id == null) { return(RedirectToAction("Index")); } if (!projects.isProject(id.Value)) { return(RedirectToAction("Index")); } if (!leaders.isProjectRelated(Convert.ToInt32(Session["userID"]), id.Value)) { return(RedirectToAction("Index")); } teamLeaderProjects p = leaders.getItemByProjectId(id.Value); if (p.ProjectState != 1) { return(RedirectToAction("Index")); } p.ProjectState = 3; p.memberOne = 0; p.memberTwo = 0; p.memberThree = 0; leaders.updateItem(p.Id, p); return(RedirectToAction("Index")); }
//----------------------------------------------------------------- public ActionResult AcceptRequested(int?id) { if (id == null) { return(RedirectToAction("Requested")); } teamLeaderProjects item = leaders.getItem(id.Value); if (item != null && item.teamleaderID == Convert.ToInt32(Session["userID"])) //here it's 11 waiting for sessio { item.ProjectState = 1; } leaders.updateItem(id.Value, item); return(RedirectToAction("Requested")); }