public ActionResult AddSubscribe(int id) { Subscribe subscribe = new Subscribe { RateId = id, SubscribeDate = DateTime.Now, UserId = db.UserDb.GetAll().First(x => x.Email == User.Identity.Name).UserId }; db.SubscribeDb.Insert(subscribe); return RedirectToAction("SeeRateList", new {area = "Common", controller = "Home"}); }
public bool Update(Subscribe subscribe) { try { subscribeDb.Update(subscribe); return true; } catch (Exception) { return false; } }
public bool Insert(Subscribe subscribe) { try { subscribeDb.Insert(subscribe); return true; } catch (Exception) { return false; } }
public void Update(Subscribe subscribe) { db.Entry(subscribe).State = EntityState.Modified; this.Save(); }
public void Insert(Subscribe subscribe) { db.Subscribe.Add(subscribe); this.Save(); }