public DataTable List(CommentForType commentForType) { try { SqlParameter[] param = new SqlParameter[1]; switch (commentForType) { case CommentForType.اخبار: { param[0] = new SqlParameter("@commentForType", commentForType); return(SQLHelper.GetDataTable(CommandType.StoredProcedure, "app.spGetCommentsForAdmin", param)); } case CommentForType.رویدادها: { param[0] = new SqlParameter("@commentForType", commentForType); return(SQLHelper.GetDataTable(CommandType.StoredProcedure, "app.spGetCommentsForAdmin", param)); } case CommentForType.محصولات: { param[0] = new SqlParameter("@commentForType", commentForType); return(SQLHelper.GetDataTable(CommandType.StoredProcedure, "app.spGetCommentsForAdmin", param)); } case CommentForType.مقالات: { param[0] = new SqlParameter("@commentForType", commentForType); return(SQLHelper.GetDataTable(CommandType.StoredProcedure, "app.spGetCommentsForAdmin", param)); } } return(null); } catch (Exception e) { throw; } }
public IHttpActionResult List(CommentForType commentForType) { try { var result = _service.List(commentForType); return(Ok(result)); } catch (Exception e) { return(NotFound()); } }
public Result <List <CommentForProductAdminListVM> > List(CommentForType commentForType) { var model = ConvertDataTableToList.BindList <CommentForProductAdminListVM>(_dataSource.List(commentForType)); if (model.Count > 0 || model.Count == 0) { return(Result <List <CommentForProductAdminListVM> > .Successful(data : model)); } else { return(Result <List <CommentForProductAdminListVM> > .Failure()); } }
public ActionResult Modify(Guid DocumentID, Guid?ParentID, CommentForType CommentForType) { if (string.IsNullOrEmpty(User.Identity.Name)) { ViewBag.TypeError = 1; return(PartialView("~/Views/Comment/_PartialError.cshtml")); } var result = _service.CanUserComment(DocumentID, SQLHelper.CheckGuidNull(User.Identity.Name)); if (!result.Success) { if (ParentID.HasValue) { ViewBag.ParentID = ParentID.Value; } ViewBag.CommentForType = CommentForType; return(PartialView("~/Views/Comment/_PartialModify.cshtml")); } else { ViewBag.TypeError = 2; return(PartialView("~/Views/Comment/_PartialError.cshtml")); } }