public ActionResult AssignIngUser() { if (Convert.ToBoolean(Session["loggedOn"]) == true && Convert.ToInt32(Session["userType"]) == 2) { ViewBag.userTypeName = Session["UserTypeName"]; ViewBag.userEmail = Session["UserEmail"]; if (Request.Form["SubmitName"] != null) { Assign_Person asp = new Assign_Person(); asp.ProjectID = Convert.ToInt32(Request.Form["ProjectName"]); asp.UserID = Convert.ToInt32(Request.Form["UserName"]); try { assiPersons.Insert(asp); return(View("Index")); } catch (Exception e) { Response.Write(e); } } } return(View("Index", "Error")); }
public void Insert(Assign_Person assignPerson) { this.data.Insert(assignPerson); }
public void Insert(Assign_Person assignPerson) { this.context.Assign_Person.Add(assignPerson); this.context.SaveChanges(); }