public ActionResult OnBoardingUserAdd(OnBoardingUsers user) //public ActionResult OnBoardingUserAdd() { try { //OnBoardingUsers user = new OnBoardingUsers(); //user.Email = "*****@*****.**"; //unique //user.FirstName = "Taiwo"; //user.LastName = "oye"; //user.MISCode = "miscode123"; //unique //user.StaffId = "staffid001"; //unique //user.TeamDefinitionCode = "tdefcode"; //user.UserName = "******"; //ViewBag.Message = "Your application description page."; MPR.Report.Data.Business.DataRepositories.OnBoardingUsersRepository h = new MPR.Report.Data.Business.DataRepositories.OnBoardingUsersRepository(); h.Add(user); //return View(); return(Json(new { v = "success", JsonRequestBehavior.AllowGet })); } catch (Exception ex) { appLog.InfoFormat("{0}{1}", "InnerException exception: ", ex.InnerException.Message); } return(View()); }
//protected void Remove(int Id) public void Remove(int Id) { OnBoardingUsers p = context2.OnBoardingUsersSet.Find(Id); context2.OnBoardingUsersSet.Remove(p); context2.SaveChanges(); }
public OnBoardingUsers GetOnBoardingUsers() { using (MPRContext2 entityContext = new MPRContext2()) { OnBoardingUsers query = (from a in entityContext.OnBoardingUsersSet select a).FirstOrDefault(); return(query); } }
//protected void Edit(OnBoardingUsers b) public void Edit(OnBoardingUsers b) { context2.Entry(b).State = System.Data.Entity.EntityState.Modified; }
//protected void Add(OnBoardingUsers b) public void Add(OnBoardingUsers b) { context2.OnBoardingUsersSet.Add(b); context2.SaveChanges(); }