public static void insertUser(string email, string name, string password, string gender) { User users = UserFront.createUser(email, name, password, gender); db.Users.Add(users); db.SaveChanges(); }
public IHttpActionResult PutUser(UserFront user) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } AppUser u1 = new AppUser(); List <AppUser> listaUsera = (List <AppUser>)unitOfWork.Users.GetAll(); foreach (var u in listaUsera) { if (u.Email == user.Email) { u1 = u; break; } } unitOfWork.Users.ApproveUser(u1.Id); unitOfWork.Complete(); return(Ok()); }
public ActionResult Index() { User user = (User)Session["user"]; if (user != null) { UserFront front = dbm.GetUserFrontpageInfo(user); Session["user"] = front.User; return(View(front)); } else { return(RedirectToAction("Index", "Home")); } }
public UserFront GetUserFrontpageInfo(User user) { UserFront front = new UserFront(); user = GetUserFull(user); if (user != null) { List <Machine> machines = db.Machines.Where(m => m.ServiceID == user.ServiceID).ToList(); CheckMachinesInUse(machines); front.User = user; front.Service = db.WasherServices.FirstOrDefault(s => s.Id == user.ServiceID); front.Machines = machines; front.Reservations = GetReservations(user); front.DoneReservations = GetDoneReservations(user); } return(front); }