Exemple #1
0
 public ActionResult Sharpp([Bind(Include = "Texto")] Sharpp _sharpp)
 {
     _sharpp.Autor    = SessionService.Instance.GetUsuarioLogado().Username;
     _sharpp.Registro = DateTime.Now;
     _sharpp.Save();
     return(RedirectToAction("Index"));
 }
Exemple #2
0
        public bool ExcluiSharpp(Sharpp _sharpp)
        {
            var sharpps = _sharpps.db.GetCollection <Sharpp> ("sharpps");

            sharpps.DeleteOne(new BsonDocument("_id", _sharpp._id));
            return(true);
        }
Exemple #3
0
        public ActionResult Create([Bind(Include = "Id,Autor,Texto,Registro,Like,Resposta")] Sharpp sharpp)
        {
            if (ModelState.IsValid)
            {
                _sharpp.PostSharpp(sharpp);
                return(RedirectToAction("Index"));
            }

            return(View(sharpp));
        }
Exemple #4
0
 public bool ExcluiSharpp(Sharpp _sharpp)
 {
     db.Sharpps.Remove(_sharpp);
     db.SaveChanges();
     return(true);
 }
Exemple #5
0
 public bool PostSharpp(Sharpp _sharpp)
 {
     db.Sharpps.Add(_sharpp);
     return(true);
 }
Exemple #6
0
 public bool PostSharpp(Sharpp _sharpp)
 {
     this._sharpps.collection.InsertOne(_sharpp);
     return(true);
 }