Beispiel #1
0
        private void Sel_File_ByCodeContents(HttpContext context, int IDLang)
        {
            String jSonString = "";

            string CodeContents = context.Request.QueryString["CodeContents"];

            ContentsBO aContentsBO = new ContentsBO();

            //List<Contents> aListContents = aContentsBO.Sel_all_ByIDLang(IDLang).Where(p => p.Code == CodeContents).ToList();
            //string[] arrImageName = new string[0];
            //List<Files> obj = new List<Files>();

            //if (aListContents.Count > 0)
            //{
            //    int? IDAlbum = aListContents[0].IDAlbum;
            //    AlbumsBO aAlbumBO = new AlbumsBO();
            //    Albums aAlbums = new Albums();
            //    aAlbums = aAlbumBO.Sel(IDAlbum.GetValueOrDefault(0));
            //    if (aAlbums != null)
            //    {
            //        string CodeAlbums = aAlbumBO.Sel(IDAlbum.GetValueOrDefault(0)).Code;
            //        FilesBO aFilesBO = new FilesBO();
            //        obj = aFilesBO.Sel_all_ByIDLang(IDLang).Where(p => p.CodeAlbums == CodeAlbums).ToList();
            //        arrImageName = new string[obj.Count];

            //        for (int ii = 0; ii < obj.Count; ii++)
            //        {
            //            arrImageName[ii] = obj[ii].Image;
            //        }
            //    }
            //    if (obj != null)
            //    {
            //        _converter.DateTimeFormat = "dd/MM/yyyy";

            //        jSonString = JsonConvert.SerializeObject(arrImageName, _converter);
            //    }
            //    jSonString = "{\"Files\":" + jSonString + "}";
            //    context.Response.Write(jSonString);

            //}
            //else
            //{
            //    jSonString = "{\"Files\":" + jSonString + "}";
            //    context.Response.Write(jSonString);
            //}


            context.Response.Write(jSonString);
        }
Beispiel #2
0
        public bool Delete(Guid Id, Guid?userId)
        {
            try
            {
                ConnectionHandler.StartTransaction(IsolationLevel.ReadUncommitted);
                var contentObj = new ContentsBO().Get(ConnectionHandler, Id);
                if (new ContentsBO().Delete(ConnectionHandler, Id) == false)
                {
                    throw new Exception();
                }
                new SyncAdapterBO().DeprecateOldVersion(ConnectionHandler, contentObj.CongressId);
                new SyncAdapterBO().Insert(ConnectionHandler, createSyncAdapter(contentObj, Enums.QueryTypes.Delete, userId));

                ConnectionHandler.CommitTransaction();

                return(true);
            }
            catch (Exception exp)
            {
                ConnectionHandler.RollBack();
            }

            return(false);
        }
Beispiel #3
0
        public IEnumerable <Contents> GetListByCategory(Guid congressId, Guid categoryId)
        {
            var list = new ContentsBO().GetListByCategory(ConnectionHandler, congressId, categoryId);

            return(list);
        }