public ActionResult Add_Edit_Post(string ActTodo, int WrittenBy_AdminId, string Title, string Text_min, string Text, int weight, int Cat_Id, int IsImportant, int GroupId, string Pictures, string Blog_Tags, int TypeId, int id_pr = 0) { string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null) { HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null) { SSSession = cookie.Value; } else { SSSession = "N.A"; } } else { SSSession = "N.A"; } CheckAccess check = new CheckAccess(SSSession); if (check.HasAccess) { Blog_ModelFiller BMF = new Blog_ModelFiller(); return(Content(BMF.Post_Action(ActTodo, WrittenBy_AdminId, Title, Text_min, Text, weight, Cat_Id, IsImportant, GroupId, Pictures, Blog_Tags, TypeId, id_pr))); } else { return(RedirectToAction("NotAccess", "MS")); } }
public ActionResult PostTable() { string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null) { HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null) { SSSession = cookie.Value; } else { SSSession = "N.A"; } } else { SSSession = "N.A"; } CheckAccess check = new CheckAccess(SSSession); if (check.HasAccess) { Blog_ModelFiller BMF = new Blog_ModelFiller(); return(View(BMF.Posttable())); } else { return(RedirectToAction("NotAccess", "MS")); } }
public ActionResult Add_Update_Tags(string ActToDo, string T_Name, int CatId, int id = 0) { string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null) { HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null) { SSSession = cookie.Value; } else { SSSession = "N.A"; } } else { SSSession = "N.A"; } CheckAccess check = new CheckAccess(SSSession); if (check.HasAccess) { Blog_ModelFiller BMF = new Blog_ModelFiller(); // var model = BMF.B_Tags_Filler(CatId); return(Content(BMF.Add_Update_Tag(ActToDo, T_Name, CatId, id))); //return Content("hello"); } else { return(RedirectToAction("NotAccess", "MS")); } }
public ActionResult TagFiller(int CatId) { string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null) { HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null) { SSSession = cookie.Value; } else { SSSession = "N.A"; } } else { SSSession = "N.A"; } CheckAccess check = new CheckAccess(SSSession); if (check.HasAccess) { Blog_ModelFiller BMF = new Blog_ModelFiller(); var model = BMF.B_Tags_Filler(CatId); return(Json(model)); } else { return(RedirectToAction("NotAccess", "MS")); } }
/// /////////////////////{ end : blog_post }//////////////////////// public ActionResult BlogMainPageSectionofPost() { Blog_ModelFiller BMF = new Blog_ModelFiller(); var model = new BlogPostsModel() { Posts = BMF.UserPostModels("همه", 1, 7, "") }; return(View(model)); }
public ActionResult AfraMaterPostsTypes() { Blog_ModelFiller BMF = new Blog_ModelFiller(); BlogPostsModel bpm = new BlogPostsModel() { GroupsList = BMF.Groups_Filler() }; return(View(bpm)); }
public ActionResult Index() { Blog_ModelFiller BMF = new Blog_ModelFiller(3); var model = new BlogPostsModel() { Posts = BMF.UserPostModels("همه", 1, 0, "") }; return(View(model)); }
/// /////////////////////{ end : blog }//////////////////////// /// ////////////////////////{ start : blog_post }////////////////////////6 ////مثال ////url = MS/blog_post?IdPage=1 public ActionResult Blog_Post(int Id) { Blog_ModelFiller BMF = new Blog_ModelFiller(3); var model = new SinglePostModel() { PostModel = BMF.UserPostModels("همه", 1, 0, ""), SPPD = BMF.SinglePostFiller(Id), BlogPicSlider = BMF.GetAllBlogPostPics(Id) }; return(View(model)); }
public ActionResult NewBlogPost() { string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null) { HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null) { SSSession = cookie.Value; } else { SSSession = "N.A"; } } else { SSSession = "N.A"; } CheckAccess check = new CheckAccess(SSSession); if (check.HasAccess) { //ControllerContext.ParentActionViewContext.ViewBag.PageTitle = ""; Blog_ModelFiller BMF = new Blog_ModelFiller(); var Model = new Blog_Post_insert_Model() { Category = BMF.BCategory_Filler(), Groups = BMF.Groups_Filler(), Type = BMF.B_Types_Filler(), PostData = new PostModel() { Id = 0, AdminPic = "", Category = "", ImagePath = "", InGroup = "", title = "", text_min = "", text = "", tags = "", date = "", by = "", Tags = new List <string>(), Comments__ = 0, IsDeleted = 0, IsDisabled = 0, IsImportant = 0, SearchGravity = 0 } }; return(View(Model)); } else { return(RedirectToAction("NotAccess", "MS")); } }
public ActionResult EditPost(int Post_id) { string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null) { HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null) { SSSession = cookie.Value; } else { SSSession = "N.A"; } } else { SSSession = "N.A"; } CheckAccess check = new CheckAccess(SSSession); if (check.HasAccess) { //ControllerContext.ParentActionViewContext.ViewBag.PageTitle = ""; Blog_ModelFiller BMF = new Blog_ModelFiller(); var Model = new Blog_Post_insert_Model() { Category = BMF.BCategory_Filler(), Groups = BMF.Groups_Filler(), Type = BMF.B_Types_Filler(), PostData = BMF.EditModelFiller(Post_id) }; Model.Tags = BMF.B_Tags_Filler(Convert.ToInt32(Model.PostData.Category)); return(View(Model)); } else { return(RedirectToAction("NotAccess", "MS")); } }
/// /////////////////////{ end : login }//////////////////////// ////////////////////////{ start : blog }////////////////////////5 ///مثال ////url = MS/blog?NamePage=post&page=1 ////url = MS/blog?NamePage=Categories&Valuepage=اخبار پاندایی&page=1 public ActionResult Blog(string Cat = "همه", int Page = 1, int Id = 0, string search = "") { PDBC db = new PDBC("PandaMarketCMS", true); string SearchNAmeHeader = "تمامی مطالب"; int num = 1; db.Connect(); if (Cat == "همه") { num = Convert.ToInt32(db.Select("SELECT Count(*) FROM [tbl_BLOG_Post] where Is_Deleted=0 AND Is_Disabled=0").Rows[0][0]); db.DC(); } else if (Cat == "دسته بندی") { num = Convert.ToInt32(db.Select("SELECT Count(*) FROM [tbl_BLOG_Post] where Is_Deleted=0 AND Is_Disabled=0 AND Cat_Id=" + Id).Rows[0][0]); using (DataTable dt2 = db.Select("SELECT [name] FROM [tbl_BLOG_Categories] WHERE [Id] =" + Id)) { SearchNAmeHeader = dt2.Rows[0][0].ToString(); } db.DC(); } else if (Cat == "گروه بندی") { num = Convert.ToInt32(db.Select("SELECT Count(*) FROM [tbl_BLOG_Post] where Is_Deleted=0 AND Is_Disabled=0 AND [GroupId] = " + Id).Rows[0][0]); using (DataTable dt2 = db.Select("SELECT [name] FROM [tbl_BLOG_Groups] WHERE [G_Id] =" + Id)) { SearchNAmeHeader = dt2.Rows[0][0].ToString(); } db.DC(); } else if (Cat == "برچسب") { num = Convert.ToInt32(db.Select("SELECT COUNT(*) FROM [tbl_BLOG_TagConnector] as A inner join [tbl_BLOG_Post] as B on A.Post_Id=B.Id where Is_Deleted=0 AND Is_Disabled=0 AND Tag_Id=" + Id).Rows[0][0]); using (DataTable dt2 = db.Select("SELECT [name] FROM [tbl_BLOG_Tags] WHERE [Id] =" + Id)) { SearchNAmeHeader = dt2.Rows[0][0].ToString(); } db.DC(); } else if (Cat == "جست و جو") { num = Convert.ToInt32(db.Select("SELECT Count(*) FROM [tbl_BLOG_Post] where (Is_Deleted=0 AND Is_Disabled=0) AND (Title Like N'%" + search + "%' OR Text_min Like N'%" + search + "%' OR [Text] Like N'%" + search + "%') ").Rows[0][0]); db.DC(); } if (num % 15 == 0) { num = (num / 15); } else { num = (num / 15) + 1; } Blog_ModelFiller BMF = new Blog_ModelFiller(); var model = new BlogPostsModel() { Categories = BMF.BCategory_Filler(), Tags = BMF.B_AllTags_Filler(), Posts = BMF.UserPostModels(Cat, Page, Id, search), GroupsList = BMF.C_AllTags_Filler(), Pages = num, Page = Page, Cat = Cat, Id = Id, SearchNAmeHeaderH1 = SearchNAmeHeader }; return(View(model)); }
public ActionResult PostList(string search) { Blog_ModelFiller BMF = new Blog_ModelFiller(); return(View(BMF.SearchResult(search))); }
public ActionResult PostModels_ByType(string Type_Token) { Blog_ModelFiller BMF = new Blog_ModelFiller(); return(Json(BMF.PostModels_ByType(Type_Token))); }