public void EditUser(UserModels newUser) { var user = GetUser(newUser.UserId); user.Name = newUser.Name; user.Gender = newUser.Gender; user.Email = newUser.Email; user.Experiance = newUser.Experiance; user.numberOfPosts = newUser.numberOfPosts; user.SignedDate = newUser.SignedDate; user.Validated = newUser.Validated; user.ValidationUrl = newUser.ValidationUrl; dbStore.Entry(user).State = System.Data.EntityState.Modified; dbStore.SaveChanges(); dbStore = new RazemTaniejEntities(); }
public bool CheckIfUserRankedDealBefore(DealModels deal, UserModels user) { var query = from p in user.RankedDeals where p == deal select p; if (query.Count() == 0) { return false; } return true; }
public void AddUser(RegisterModel model) { var user = new UserModels { Name = model.UserName, Email = model.Email, Comments = new List<CommentModels>(), Deals = new List<DealModels>(), Validated = false, ValidationUrl = Utils.ToolUtils.CreateValidationEmail(model.Email, "http://localhost:61382/") }; dbStore.User.Add(user); dbStore.SaveChanges(); }
public void AddUser(int fbId, string userName, string email, string gender) { var user = new UserModels { Name = userName, Email = email, Comments = new List<CommentModels>(), Deals = new List<DealModels>(), RankedDeals = new List<DealModels>(), FacebookId = fbId, Gender = gender, Validated = false }; dbStore.User.Add(user); dbStore.SaveChanges(); }
public void AddPositiveMark(DealModels deal, UserModels user) { deal.Rank = deal.Rank + 1; user.RankedDeals.Add(deal); dbStore.SaveChanges(); }
public ActionResult EditUser(UserModels newUser) { dbHelper.EditUser(newUser); return RedirectToAction("ShowAllUserPanel"); }