public ViewResult HomePage(int myid, Blog b) { string name = HttpContext.Session.GetString("Name"); int id = PublicUserRepo.GetId(name); PublicUser usr = PublicUserRepo.getUserbyId(id); return(View(usr)); }
public ViewResult CreateBlog(string nam, Blog b) { b.Date = DateTime.Today.ToString(); if (ModelState.IsValid) { string name = HttpContext.Session.GetString("Name"); int id = PublicUserRepo.GetId(name); BlogRepo.AddBlog(b, id); PublicUser usr = PublicUserRepo.getUserbyId(id); return(View("HomePage", usr)); } else { ModelState.AddModelError(String.Empty, "Please enter correct data"); return(View()); } }
public ViewResult Update(int id) { PublicUser pu = PublicUserRepo.getUserbyId(id); return(View("Update", pu)); }