示例#1
0
        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());
        }
示例#2
0
        //protected void Remove(int Id)
        public void Remove(int Id)
        {
            OnBoardingUsers p = context2.OnBoardingUsersSet.Find(Id);

            context2.OnBoardingUsersSet.Remove(p);
            context2.SaveChanges();
        }
示例#3
0
        public OnBoardingUsers GetOnBoardingUsers()
        {
            using (MPRContext2 entityContext = new MPRContext2())
            {
                OnBoardingUsers query = (from a in entityContext.OnBoardingUsersSet
                                         select a).FirstOrDefault();

                return(query);
            }
        }
示例#4
0
 //protected void Edit(OnBoardingUsers b)
 public void Edit(OnBoardingUsers b)
 {
     context2.Entry(b).State = System.Data.Entity.EntityState.Modified;
 }
示例#5
0
 //protected void Add(OnBoardingUsers b)
 public void Add(OnBoardingUsers b)
 {
     context2.OnBoardingUsersSet.Add(b);
     context2.SaveChanges();
 }