public void PostEdit(int photoGraphID, int catalogID, string subject, string imageUrl, string linkUrl, int sortNum) { int _code = 0; string _message = "修改内容失败"; if (!string.IsNullOrEmpty(imageUrl)) { PhotoGraph _photoGraph = new PhotoGraph(); _photoGraph.ID = photoGraphID; _photoGraph.CatalogID = catalogID; _photoGraph.Subject = subject; _photoGraph.ImageUrl = imageUrl; _photoGraph.LinkUrl = linkUrl; _photoGraph.SortNum = sortNum; _code = _photoGraphService.UpdatePhotoGraph(_photoGraph); if (_code > 0) { _message = "修改图片内容成功"; } else { _message = "对不起,修改失败!"; } } else { _message = "图片路径不能为空!"; } RenderText("{\"code\":\"" + _code + "\",\"message\":\"" + _message + "\"}"); CancelLayout(); }
public void PostCreate(int catalogID, string subject, string imageUrl, string linkUrl) { int _code = 0; string _message = "上传图片失败"; if (!string.IsNullOrEmpty(imageUrl)) { PhotoGraph _photoGraph = new PhotoGraph(); _photoGraph.CatalogID = catalogID; _photoGraph.Subject = subject; _photoGraph.ImageUrl = imageUrl; _photoGraph.LinkUrl = linkUrl; _code = _photoGraphService.InsertPhotoGraph(_photoGraph); if (_code > 0) { _message = "上传图片成功"; } else { _message = "对不起,上传图片失败,可能有重名!"; } } else { _message = "图片的地址不能为空!"; } RenderText("{\"code\":\"" + _code + "\",\"message\":\"" + _message + "\"}"); CancelLayout(); }
public void Edit(int photoGraphID, int pageIndex) { PropertyBag["params"] = new { PageIndex = pageIndex }; PhotoGraph _photoGraph = _photoGraphService.GetPhotoGraphByID(photoGraphID); PropertyBag["photoGraph"] = _photoGraph; }
/// <summary> /// 插入PhotoGraph /// </summary> /// <param name="PhotoGraph">PhotoGraph</param> public int InsertPhotoGraph(PhotoGraph photoGraph) { Hashtable _map = new Hashtable(); _map.Add("CatalogID", photoGraph.CatalogID); _map.Add("Subject", photoGraph.Subject); _map.Add("ImageUrl", photoGraph.ImageUrl); _map.Add("LinkUrl", photoGraph.LinkUrl); _map.Add("ID", photoGraph.ID); photoGraph.ID = (int)ExecuteInsert("JNyulu.InsertPhotoGraph", _map); return(photoGraph.ID); }
/// <summary> /// 插入PhotoGraph /// </summary> /// <param name="photoGraph">PhotoGraph</param> public int InsertPhotoGraph(PhotoGraph photoGraph) { int _id = -1; try { //_daoManager.BeginTransaction(); _id = _photoGraphDao.InsertPhotoGraph(photoGraph); //_daoManager.CommitTransaction(); } catch (Exception ex) { //_daoManager.RollBackTransaction(); throw ex; } return(_id); }
public void Index() { PropertyBag["catalog"] = 0; int _totalNums = 0, _pageSize = 4, pageIndex = 1; IList <PhotoGraph> _photoGrapList1 = _photoGraphService.PaginatedPhotoGraph(pageIndex, _pageSize, "SortNum", "catalogID = 1", ref _totalNums); PropertyBag["photoGrapList1"] = _photoGrapList1; _pageSize = 6; IList <PhotoGraph> _photoGrapList2 = _photoGraphService.PaginatedPhotoGraph(pageIndex, _pageSize, "SortNum", "catalogID = 2", ref _totalNums); PropertyBag["photoGrapList2"] = _photoGrapList2; IList <PhotoGraph> _photoGrapList4 = _photoGraphService.PaginatedPhotoGraph(pageIndex, 1, "SortNum", "catalogID = 4", ref _totalNums); if (_photoGrapList4.Count > 0) { PropertyBag["photoGrap"] = _photoGrapList4[0]; } _pageSize = 8; string _conAttr = "catalogID = 2"; IList <Article> _artilceList2 = _articleService.PaginatedArticle(pageIndex, _pageSize, "ID", _conAttr, ref _totalNums); PropertyBag["artilceList2"] = _artilceList2; _conAttr = "catalogID = 3"; IList <Article> _artilceList3 = _articleService.PaginatedArticle(pageIndex, _pageSize, "ID", _conAttr, ref _totalNums); PropertyBag["artilceList3"] = _artilceList3; _conAttr = "catalogID = 4"; IList <Article> _artilceList4 = _articleService.PaginatedArticle(pageIndex, _pageSize, "ID", _conAttr, ref _totalNums); PropertyBag["artilceList4"] = _artilceList4; IList <Video> _videoList = _videoService.PaginatedVideo(pageIndex, 4, "SortNum", "permit = 0", ref _totalNums); PropertyBag["videoList"] = _videoList; PhotoGraph _photoGraph = _photoGraphService.GetBasePhotoGraphByID(171); PropertyBag["photoGraph"] = _photoGraph; }
/// <summary> /// 获取PhotoGraph列表(包含父对象) /// </summary> /// <param name="photoGraph">PhotoGraph</param> /// <returns>PhotoGraph集合</returns> public IList <PhotoGraph> GetPhotoGraph(PhotoGraph photoGraph) { return(ExecuteQueryForList <PhotoGraph>("JNyulu.GetPhotoGraph", photoGraph)); }
/// <summary> /// 更新PhotoGraph /// </summary> /// <param name="PhotoGraph">PhotoGraph</param> public int UpdatePhotoGraph(PhotoGraph photoGraph) { int i = ExecuteUpdate("JNyulu.UpdatePhotoGraph", photoGraph); return(i); }
/// <summary> /// 获取PhotoGraph列表(包含父对象) /// </summary> /// <param name="photoGraph">PhotoGraph</param> /// <returns>PhotoGraph集合</returns> public IList <PhotoGraph> GetPhotoGraph(PhotoGraph photoGraph) { return(_photoGraphDao.GetPhotoGraph(photoGraph)); }
/// <summary> /// 更新PhotoGraph /// </summary> /// <param name="photoGraph">PhotoGraph</param> public int UpdatePhotoGraph(PhotoGraph photoGraph) { return(_photoGraphDao.UpdatePhotoGraph(photoGraph)); }