public ActionResult EdytujPost(int id) { var post = ObsługaBazyDanych.zwrocPostPoId(id); TempData["BlogPostId"] = post.Blogs.Blog_ID; return(View(post)); }
public ActionResult blogPartialView(string blogID) { var lookupId = int.Parse(blogID); var model = ObsługaBazyDanych.zwrocBlogPoId(lookupId); return(PartialView("blogFollowButton", model)); }
public ActionResult LogIn(LogInModel model) { if (!ModelState.IsValid) { if (model.Email == null || model.Password == null) { ModelState.AddModelError("", "Pole email i haslo nie mogą być puste!"); return(View()); } return(View()); } if (model.Email.Equals("") || model.Password.Equals("")) { ModelState.AddModelError("", "Pole email i haslo nie mogą być puste!"); return(View()); } var user = ObsługaBazyDanych.sprawdzCzyUzytkownikIsniteje(model.Email, model.Password); if (!(user is null)) { FormsAuthentication.SetAuthCookie(user.username, false); return(RedirectToAction("Index", "Main")); } ModelState.AddModelError("", "Niepoprawny email lub hasło"); return(View()); }
public ActionResult commentPartialView(string commentId) { var lookupId = int.Parse(commentId); var model = ObsługaBazyDanych.zwrocKomentarzPoID(lookupId); return(PartialView("commentsPartial", model)); }
public ActionResult commentListPartialView(string postID) { Debug.WriteLine(postID); var post = ObsługaBazyDanych.zwrocPostPoId(Int32.Parse(postID)); return(PartialView("commentListPartial", post)); }
public ActionResult UsunKomentarz(int id, int idPostu) { ObsługaBazyDanych.usunKomentarz(id); var post = ObsługaBazyDanych.zwrocPostPoId(idPostu); return(View("WyswietlPost", post)); }
public ActionResult UsunPost(int id, int idBlog) { ObsługaBazyDanych.usunPost(id); var blog = ObsługaBazyDanych.zwrocBlogPoId(idBlog); return(RedirectToAction("WyswietlBlog", new { id = idBlog })); }
public ActionResult stworztagasync(string tagName) { Debug.WriteLine(tagName); ObsługaBazyDanych.dodajTag(tagName); var tag = ObsługaBazyDanych.ZwrocTagPoNazwie(tagName); return(Json(new { id = tag.Tag_ID, nazwa = tag.tagName }, JsonRequestBehavior.AllowGet)); }
public ActionResult UsunTag(int id) { if (ObsługaBazyDanych.sprawdzCzyUzytkownikJestAdminem(User.Identity.Name)) { ObsługaBazyDanych.UsunTag(id); } return(RedirectToAction("ListaTagow")); }
public ActionResult blogUnFollow(string userName, string blogID) { Debug.WriteLine(userName + " " + blogID + "pierwszyGet"); ObsługaBazyDanych.UsunFollowZBloga(userName, blogID); var blog = ObsługaBazyDanych.zwrocBlogPoId(Int32.Parse(blogID)); return(Json(new { followCount = blog.followCount, id = blog.Blog_ID, user = userName }, JsonRequestBehavior.AllowGet)); }
public ActionResult komentarzDownVote(string userName, string commentID) { Debug.WriteLine(userName + " " + commentID + "pierwszyGet"); ObsługaBazyDanych.UsunGlosDoKomentarza(userName, commentID); //ObsługaBazyDanych.bazadanych.VotesSet.Add(); var comment = ObsługaBazyDanych.zwrocKomentarzPoID(Int32.Parse(commentID)); return(Json(new { upVotes = comment.upVotes, id = comment.Comment_ID, user = userName }, JsonRequestBehavior.AllowGet)); }
public ActionResult StworzTag(Tags tag) { if (ModelState.IsValid) { ObsługaBazyDanych.dodajTag(tag); return(RedirectToAction("ListaTagow")); } return(View()); }
public ActionResult StworzKind(Kinds kind) { if (ModelState.IsValid) { ObsługaBazyDanych.dodajKind(kind); return(RedirectToAction("ListaKind")); } return(View()); }
public ActionResult ListaUzytkownikow() { if (ObsługaBazyDanych.sprawdzCzyUzytkownikJestAdminem(User.Identity.Name)) { List <Users> listauzytkownikow = ObsługaBazyDanych.zwrocListeUzytkownikow(); return(View(listauzytkownikow)); } return(RedirectToAction("Index")); }
public ActionResult EdytujBlog(Blogs blog, FormCollection form) { if (ModelState.IsValid) { var test = form["KindsIds"]; ObsługaBazyDanych.EdytujBlog(blog, test); return(RedirectToAction("ListaBlogow")); } return(RedirectToAction("ListaBlogow")); }
public ActionResult EdytujPost(Post post, FormCollection form) { var idBlogu = (int)TempData["BlogPostId"]; if (ModelState.IsValid) { var test = form["TagsIds"]; ObsługaBazyDanych.EdytujPost(post, test); return(RedirectToAction("WyswietlBLog", new { id = idBlogu })); } return(RedirectToAction("WyswietlBLog", new { id = idBlogu })); }
public ActionResult StworzKomentarzJava(int id, string content) { Debug.WriteLine(id + content); Comments comment = new Comments(); comment.content = content; comment.User_ID = ObsługaBazyDanych.zwrocIdUzytkownikaPoUsername(User.Identity.Name); ObsługaBazyDanych.dodajKomentarz(id, comment); return(Json(new { id1 = id }, JsonRequestBehavior.AllowGet)); }
public ActionResult StworzKomentarz(Comments comment) { var idPostu = (int)TempData["PostCommentId"]; if (ModelState.IsValid) { comment.User_ID = ObsługaBazyDanych.zwrocIdUzytkownikaPoUsername(User.Identity.Name); ObsługaBazyDanych.dodajKomentarz(idPostu, comment); return(RedirectToAction("WyswietlPost", new { id = idPostu })); } return(View()); }
public ActionResult Register(Users user) { if (ModelState.IsValid) { user.dataAktualizacji = DateTime.Now; user.dataStworzenia = DateTime.Now; user.isAdmin = false; ObsługaBazyDanych.dodajNowegoUzytkownika(user); return(RedirectToAction("Index", "Main")); } return(View()); }
public ActionResult StworzBlog(Blogs blog, FormCollection form) { if (ModelState.IsValid) { //foreach (int i in kindID) Debug.WriteLine(i.ToString()); var test = form["KindsIds"]; blog.dataAktualizacji = DateTime.Now; blog.dataZalozenia = DateTime.Now; blog.followCount = 0; ObsługaBazyDanych.dodajNowyBlog(User.Identity.Name, blog, test); return(RedirectToAction("ListaBlogow")); } return(View()); }
public GraInwestycyjna() { InitializeComponent(); var service = new ObsługaBazyDanych(); hasło_txt.PasswordChar = '*'; hasło_txt.MaxLength = 8; // StwórzFirmy(); // UsunNiepotrzebne_Sprzatacz(); // StwórzWaluty(); // service.PobieranieDanychAkcje(); // service.PobieranieDanychWaluty(); // uwaga -> trwa około 30 minut // service.DodajPrzykladowoInwestycje(); // service.WypiszInwestycje(); // MessageBox.Show("Done!"); }
//na razie authorize public ActionResult WyswietlBlog(int id) { var blog = ObsługaBazyDanych.zwrocBlogPoId(id); return(View(blog)); }
public ActionResult ListaBlogowUzytkownika(string username) { var listablogow = ObsługaBazyDanych.zwrocListeBlogowUzytkownika(username); return(View(listablogow)); }
public ActionResult ListaPostowPoTagu(int id) { var listapostow = ObsługaBazyDanych.zwrocPostyDanegoTagu(id); return(View(listapostow)); }
public ActionResult ListaBlogowPoKind(int id) { var listablogow = ObsługaBazyDanych.zwrocBlogiDanegoKind(id); return(View("ListaBlogow", listablogow)); }
public ActionResult ListaBlogow() { var listablogow = ObsługaBazyDanych.zwrocListeBlogow(); return(View(listablogow)); }
public ActionResult PostyFollowedBlogs() { var listapostow = ObsługaBazyDanych.zwrocPostyZFollowanychBlogow(User.Identity.Name); return(View(listapostow)); }
public ActionResult WyswietlPost(int id) { var post = ObsługaBazyDanych.zwrocPostPoId(id); return(View(post)); }
public ActionResult ListaTagow() { return(View(ObsługaBazyDanych.zwrocListeTag())); }
public ActionResult ListaKind() { return(View(ObsługaBazyDanych.zwrocListeKind())); }