Esempio n. 1
0
        public bool DeleteAllArchive()
        {
            JArchiveDocument archive = new JArchiveDocument(DataBaseClassName, DataBaseObjectCode);

            try
            {
                return(archive.DeleteArchive(ClassName, ObjectCode, true));
            }
            finally
            {
                archive.Dispose();
            }
        }
Esempio n. 2
0
        public bool DeleteAchive()
        {
            JArchiveDocument archive = new JArchiveDocument(DataBaseClassName, DataBaseObjectCode);

            try
            {
                for (int i = 0; i < DeleteCodes.Count; i++)
                {
                    if (!archive.DeleteArchive(DeleteCodes[i], false))
                    {
                        return(false);
                    }
                }
                return(true);
            }
            finally
            {
                archive.Dispose();
            }
        }
Esempio n. 3
0
        public int ArchiveImage()
        {
            JArchiveDocument archive = new JArchiveDocument(SubjectCode, PlaceCode);

            try
            {
                /// حذف
                if (Image == null && State == JFormState.Delete)
                {
                    if (archive.DeleteArchive(_ArchiveCode, DeleteCompeletly))
                    {
                        return(0);
                    }
                    else
                    {
                        return(0);
                    }
                }
                /// جدید
                //if (ArchiveCode == 0)
                {
                    if (this.Image != null && (State == JFormState.Insert || State == JFormState.Update))
                    {
                        _ArchiveCode = archive.ArchiveDocument(ImageFile, this.ClassName, this.ObjectCode, this.Description, true);
                    }
                    return(_ArchiveCode);
                }
                //else
                /// ویرایش
                //if (ArchiveCode > 0 && Changed)
                //{
                //return archive.ArchiveDocument(ImageFile, ArchiveCode, this.Description, DeleteCompeletly, true);
                //}
                return(0);
            }
            finally
            {
                archive.Dispose();
            }
        }