public posts NewPost(posts post) { try { Posts posts = new Posts(); post.agree_count = 0; post.disagree_count = 0; post.date_added = DateTime.Now; post.is_approved = true; post.is_deleted = true; posts.AddPost(post); return post; } catch (Exception ex) { return null; } }
public ActionResult Index() { try { //var sms = SmileSMS.Send("03445810804", "test"); Categories cats = new Categories(); Posts posts = new Posts(); ViewBag.categories = cats.getAllCategories(""); ViewBag.posts = posts.getAllPosts(""); ViewBag.isLoggedIn = false; if (Session["pp_user_id"] != null) { ViewBag.isLoggedIn = true; } } catch (Exception ex) { } return View(); }