示例#1
0
        public static DbQueryResult GetPhotoList(string keyword, int?categoryId, int pageIndex, PhotoListOrder order)
        {
            Pagination pagination = new Pagination();

            pagination.PageSize  = 20;
            pagination.PageIndex = pageIndex;
            pagination.IsCount   = true;
            switch (order)
            {
            case PhotoListOrder.UploadTimeDesc:
                pagination.SortBy    = "UploadTime";
                pagination.SortOrder = SortAction.Desc;
                break;

            case PhotoListOrder.UploadTimeAsc:
                pagination.SortBy    = "UploadTime";
                pagination.SortOrder = SortAction.Asc;
                break;

            case PhotoListOrder.NameAsc:
                pagination.SortBy    = "PhotoName";
                pagination.SortOrder = SortAction.Asc;
                break;

            case PhotoListOrder.NameDesc:
                pagination.SortBy    = "PhotoName";
                pagination.SortOrder = SortAction.Desc;
                break;

            case PhotoListOrder.UpdateTimeDesc:
                pagination.SortBy    = "LastUpdateTime";
                pagination.SortOrder = SortAction.Desc;
                break;

            case PhotoListOrder.UpdateTimeAsc:
                pagination.SortBy    = "LastUpdateTime";
                pagination.SortOrder = SortAction.Asc;
                break;

            case PhotoListOrder.SizeDesc:
                pagination.SortBy    = "FileSize";
                pagination.SortOrder = SortAction.Desc;
                break;

            case PhotoListOrder.SizeAsc:
                pagination.SortBy    = "FileSize";
                pagination.SortOrder = SortAction.Asc;
                break;
            }
            return(GalleryProvider.Instance().GetPhotoList(keyword, categoryId, pagination));
        }
示例#2
0
 public static bool DeletePhoto(int photoId)
 {
     return(GalleryProvider.Instance().DeletePhoto(photoId));
 }
示例#3
0
 public static bool AddPhote(int categoryId, string photoName, string photoPath, int fileSize)
 {
     return(GalleryProvider.Instance().AddPhote(categoryId, photoName, photoPath, fileSize));
 }
示例#4
0
 public static bool AddPhotoCategory(string name)
 {
     return(GalleryProvider.Instance().AddPhotoCategory(name));
 }
示例#5
0
 public static void SwapSequence(int categoryId1, int categoryId2)
 {
     GalleryProvider.Instance().SwapSequence(categoryId1, categoryId2);
 }
示例#6
0
 public static bool DeletePhotoCategory(int categoryId)
 {
     return(GalleryProvider.Instance().DeletePhotoCategory(categoryId));
 }
示例#7
0
 public static System.Data.DataTable GetPhotoCategories()
 {
     return(GalleryProvider.Instance().GetPhotoCategories());
 }
示例#8
0
 public static int MovePhotoType(List <int> pList, int pTypeId)
 {
     return(GalleryProvider.Instance().MovePhotoType(pList, pTypeId));
 }
示例#9
0
 public static int UpdatePhotoCategories(Dictionary <int, string> photoCategorys)
 {
     return(GalleryProvider.Instance().UpdatePhotoCategories(photoCategorys));
 }
示例#10
0
 public static int GetDefaultPhotoCount()
 {
     return(GalleryProvider.Instance().GetDefaultPhotoCount());
 }
示例#11
0
 public static string GetPhotoPath(int photoId)
 {
     return(GalleryProvider.Instance().GetPhotoPath(photoId));
 }
示例#12
0
 public static void ReplacePhoto(int photoId, int fileSize)
 {
     GalleryProvider.Instance().ReplacePhoto(photoId, fileSize);
 }
示例#13
0
 public static void RenamePhoto(int photoId, string newName)
 {
     GalleryProvider.Instance().RenamePhoto(photoId, newName);
 }
示例#14
0
 static GalleryProvider()
 {
     GalleryProvider._defaultInstance = (DataProviders.CreateInstance("Hidistro.ControlPanel.Data.GalleryData,Hidistro.ControlPanel.Data") as GalleryProvider);
 }