public ActionResult Create([Bind(Include = "name")] Rank rank, bool IsAdmin = false, bool CanReadDept = true, bool CanEditDept = false, bool CanReadProj = true, bool CanEditProj = false, bool CanReadTeam = true, bool CanEditTeam = false, bool CanReadUser = true, bool CanEditUser = false, bool CanReadTask = true, bool CanEditTask = true, bool CanReadMesg = true, bool CanEditMesg = true, bool CanReadNoti = true, bool CanEditNoti = true) { try { // rank.rights = (IsAdmin ? "1" : "0") + (CanReadDept ? "1" : "0") + (CanEditDept ? "1" : "0") + (CanReadProj ? "1" : "0") + (CanEditProj ? "1" : "0") + (CanReadTeam ? "1" : "0") + (CanEditTeam ? "1" : "0") + (CanReadUser ? "1" : "0") + (CanEditUser ? "1" : "0") + (CanReadTask ? "1" : "0") + (CanEditTask ? "1" : "0") + (CanReadMesg ? "1" : "0") + (CanEditMesg ? "1" : "0") + (CanReadNoti ? "1" : "0") + (CanEditNoti ? "1" : "0"); db.Rank.Add(rank); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View(rank)); } }
public ActionResult Create([Bind(Include = "Id,Batch1,Year")] batch batch) { if (ModelState.IsValid) { db.batches.Add(batch); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(batch)); }
public ActionResult Create([Bind(Include = "id,name,root")] Project project) { if (ModelState.IsValid) { db.Project.Add(project); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(project)); }
public ActionResult Create([Bind(Include = "Id,Firstname,Lastname,Username,Password")] user user) { if (ModelState.IsValid) { db.users.Add(user); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Create([Bind(Include = "id,name")] Department department) { if (ModelState.IsValid) { db.Department.Add(department); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(department)); }
public ActionResult Create([Bind(Include = "Id,Course1,Duration")] course course) { if (ModelState.IsValid) { db.courses.Add(course); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(course)); }
public ActionResult Create([Bind(Include = "Id,Firstname,Lastname,Nic,Course_id,Batch_id,Telno")] registration registration) { if (ModelState.IsValid) { db.registrations.Add(registration); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Batch_id = new SelectList(db.batches, "Id", "Batch1", registration.Batch_id); ViewBag.Course_id = new SelectList(db.courses, "Id", "Course1", registration.Course_id); return(View(registration)); }
public ActionResult Create([Bind(Include = "id,name,department_id,project_id")] Team team) { if (ModelState.IsValid) { db.Team.Add(team); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.department_id = new SelectList(db.Department, "id", "name", team.department_id); ViewBag.project_id = new SelectList(db.Project, "id", "name", team.project_id); return(View(team)); }
public ActionResult Create([Bind(Include = "id,username,password,encrypted,email,creationdate,team_id,rank")] Users users) { if (ModelState.IsValid) { users.profilepic = "Anonymous_user.jpg"; db.Users.Add(users); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.team_id = new SelectList(db.Team, "id", "name", users.team_id); ViewBag.rank = new SelectList(db.Rank, "name", "name", users.rank); return(View(users)); }