public Boolean approve(Int32 image) { if (Context.Session["user_id"] != null) { Media m = _media.get_by_id(image); _media.approve(m); return(true); } else { return(false); } }
protected void Page_PreInit(object sender, EventArgs e) { if (Session["user_id"] != null) { overrideSocial.mediaManager _media = new overrideSocial.mediaManager(); Media m = _media.get_by_id(Convert.ToInt32(Page.RouteData.Values["id"] as string)); m.approved_by = Convert.ToInt32(Session["user_id"].ToString()); m.approved_date = DateTime.Now; _media.approve(m); Response.Redirect(Request.UrlReferrer.ToString()); } else { Response.Redirect("/login"); } }
public Boolean approve_list(string images) { if (Context.Session["user_id"] != null) { List <string> _images = images.Split(',').ToList <string>(); foreach (string s in _images) { Media m = _media.get_by_id(Convert.ToInt32(s)); m.approved_by = Convert.ToInt32(Context.Session["user_id"] as string); _media.approve(m); } return(true); } else { return(false); } }