예제 #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);
 }