public object GetAlbumDetails_New(ClsGetAlbumDetailsInput album)
        {
            dynamic       TBAlbumDetailResult;
            List <object> AlbumDetailResult = new List <object>();

            try
            {
                List <ClsGetAlbumDetailsOutput> Result = Gallery.GetAlbumDetails_New(album);

                for (int i = 0; i < Result.Count; i++)
                {
                    AlbumDetailResult.Add(new { AlbumDetail = Result[i] });
                }

                if (Result != null && Result.Count != 0)
                {
                    TBAlbumDetailResult = new { status = "0", message = "success", AlbumDetailResult = AlbumDetailResult };
                }
                else
                {
                    TBAlbumDetailResult = new { status = "0", message = "Record not found", AlbumDetailResult = AlbumDetailResult };
                }
            }
            catch
            {
                TBAlbumDetailResult = new { status = "1", message = "failed" };
            }

            return(new { TBAlbumDetailResult });
        }
Exemple #2
0
        public static List <ClsGetAlbumDetailsOutput> GetAlbumDetails(ClsGetAlbumDetailsInput album)
        {
            try
            {
                MySqlParameter[] parameterList = new MySqlParameter[1];

                parameterList[0] = new MySqlParameter("?AlbumId", album.albumId);
                //parameterList[1] = new MySqlParameter("?GroupId", album.grpId);
                //parameterList[2] = new MySqlParameter("?ProfileId", album.memberProfileId);

                using (TouchBaseWebAPI.Data.row_productionEntities context = new TouchBaseWebAPI.Data.row_productionEntities())
                {
                    context.Connection.Open();
                    var Result = context.ExecuteStoreQuery <ClsGetAlbumDetailsOutput>("CALL V6_1_USPGetAlbumDetails(?AlbumId)", parameterList).ToList();

                    foreach (ClsGetAlbumDetailsOutput objAlbum in Result)
                    {
                        if (!string.IsNullOrEmpty(objAlbum.albumImage))
                        {
                            string announ_Image = objAlbum.albumImage.ToString();
                            string path         = ConfigurationManager.AppSettings["imgPath"] + "Documents/gallery/Group" + objAlbum.groupId + "/";
                            objAlbum.albumImage = path + announ_Image;
                        }
                    }
                    return(Result);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static List <ClsGetAlbumDetailsOutput> GetAlbumDetails(ClsGetAlbumDetailsInput album)
        {
            try
            {
                MySqlParameter[] parameterList = new MySqlParameter[1];

                parameterList[0] = new MySqlParameter("?AlbumId", album.albumId);
                //parameterList[1] = new MySqlParameter("?GroupId", album.grpId);
                //parameterList[2] = new MySqlParameter("?ProfileId", album.memberProfileId);

                var Result = _DBTouchbase.ExecuteStoreQuery <ClsGetAlbumDetailsOutput>("CALL V6_USPGetAlbumDetails(?AlbumId)", parameterList).ToList();

                foreach (ClsGetAlbumDetailsOutput objAlbum in Result)
                {
                    if (!string.IsNullOrEmpty(objAlbum.albumImage))
                    {
                        string announ_Image = objAlbum.albumImage.ToString();
                        string path         = ConfigurationManager.AppSettings["imgPath"] + "Documents/announcement/Group" + album.grpId + "/";
                        objAlbum.albumImage = path + announ_Image;
                    }
                }
                return(Result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }