Exemplo n.º 1
0
        public static List <ClsPhotoList> GetAlbumPhotoList_New(ClsPhotoListInput album)
        {
            try
            {
                MySqlParameter[] parameterList = new MySqlParameter[1];

                parameterList[0] = new MySqlParameter("?AlbumId", album.albumId);


                DataSet result = MySqlHelper.ExecuteDataset(GlobalVar.strAppConn, CommandType.StoredProcedure, "V4_1_USPAlbumList_New", parameterList);

                DataTable dtNewPhoto = result.Tables[0];

                List <ClsPhotoList> NewPhotoList = new List <ClsPhotoList>();
                if (dtNewPhoto.Rows.Count > 0)
                {
                    NewPhotoList = GlobalFuns.DataTableToList <ClsPhotoList>(dtNewPhoto);

                    foreach (ClsPhotoList g in NewPhotoList)
                    {
                        if (!string.IsNullOrEmpty(g.url))
                        {
                            string ImageName = g.url.ToString();
                            string path      = ConfigurationManager.AppSettings["imgPath"] + "Documents/gallery/Group" + album.groupId + "/Album" + album.albumId + "/";
                            g.url = path + ImageName;
                        }
                    }
                }
                ClsPhotoListOutput photoList = new ClsPhotoListOutput();
                photoList.newPhotos = NewPhotoList;

                return(photoList.newPhotos);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public object GetAlbumPhotoList_New(ClsPhotoListInput album)
        {
            dynamic TBAlbumPhotoListResult;

            try
            {
                List <ClsPhotoList> Result = Gallery.GetAlbumPhotoList_New(album);

                if (Result.Count != 0)
                {
                    TBAlbumPhotoListResult = new { status = "0", message = "success", updatedOn = System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), Result };
                }
                else
                {
                    TBAlbumPhotoListResult = new { status = "0", message = "Record not found", Result };
                }
            }
            catch
            {
                TBAlbumPhotoListResult = new { status = "1", message = "failed" };
            }

            return(new { TBAlbumPhotoListResult });
        }