Ejemplo n.º 1
0
        private void _LoadImagesFromArchive()
        {
            JFile content;

            if (_DataTable != null)
            {
                int OldTop = 0;
                foreach (DataRow DR in _DataTable.Rows)
                {
                    /// کد آرشیو انتخاب شده در گرید
                    int Code = DR["ArchiveCode"].GetHashCode();
                    JArchiveDocument archive = new JArchiveDocument(DataBaseClassName, DataBaseObjectCode);
                    try
                    {
                        //// بازیابی محتوای آرشیو
                        content = archive._RetrieveContent(Code);

                        if (content != null && content.Extension.ToLower() == ".jpg")
                        {
                            CreateThumbLine(content, DR);
                        }
                    }
                    catch (Exception ex)
                    {
                        JSystem.Except.AddException(ex);
                    }
                    finally
                    {
                        archive.Dispose();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void jdgRequestList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (jdgRequestList.SelectedRows.Count == 0)
            {
                return;
            }
            JFile content;

            try
            {
                int Status = 0;
                if (this.State == JFormState.Update)
                {
                    if (jdgRequestList.DataSource == null)
                    {
                        Status = Convert.ToInt32(jdgRequestList[0, jdgRequestList.SelectedRows[0].Index].Value);
                    }
                    else
                    {
                        Status = Convert.ToInt32(jdgRequestList.CurrentRow.Cells["Status"].Value);
                    }
                }
                if (ClassLibrary.Domains.Employment.JVacationStatus.Confirm == Status)//
                {
                    /// در صورتی که فایل جدیداً به لیست اضافه شده، بازیابی نمیشود، بلکه محتوای فایل از دیتاتیبل خوانده میشود
                    //if (e.RowIndex != -1)
                    /// کد آرشیو انتخاب شده در گرید
                    int Code = Convert.ToInt32(jdgRequestList[JArchiveFields.ArchiveCode.ToString(), jdgRequestList.SelectedRows[0].Index].Value);
                    JArchiveDocument archive = new JArchiveDocument();
                    archive.GetData(Code);
                    try
                    {
                        //// بازیابی محتوای آرشیو
                        content = archive._RetrieveContent(archive.ArchiveCode);
                        content.Open();
                    }
                    catch (Exception ex)
                    {
                        JSystem.Except.AddException(ex);
                    }
                    finally
                    {
                        archive.Dispose();
                    }
                }
            }
            catch (Exception ex)
            {
                JSystem.Except.AddException(ex);
            }
        }
Ejemplo n.º 3
0
        private void grdArchive_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (grdArchive.SelectedRows.Count == 0)
            {
                return;
            }
            JFile content;

            try
            {
                /// در صورتی که فایل جدیداً به لیست اضافه شده، بازیابی نمیشود، بلکه محتوای فایل از دیتاتیبل خوانده میشود
                if (e.RowIndex != -1)
                {
                    if (grdArchive.CurrentRow.Cells[JArchiveFields.Action.ToString()].Value != null)
                    {
                        if (grdArchive.CurrentRow.Cells[JArchiveFields.Action.ToString()].Value.ToString() == FileActions.Insert.ToString())
                        {
                            content = (JFile)grdArchive.CurrentRow.Cells["JFile"].Value; // (JFile)_DataTable.Rows[e.RowIndex][JArchiveFields.JFile.ToString()];
                            content.Open();
                        }
                        else
                        {
                            /// کد آرشیو انتخاب شده در گرید
                            int Code = (int)grdArchive[JArchiveFields.ArchiveCode.ToString(), grdArchive.SelectedRows[0].Index].Value;
                            JArchiveDocument archive = new JArchiveDocument(DataBaseClassName, DataBaseObjectCode);
                            try
                            {
                                //// بازیابی محتوای آرشیو
                                content = archive._RetrieveContent(Code);
                                content.Open();
                            }
                            catch (Exception ex)
                            {
                                JSystem.Except.AddException(ex);
                            }
                            finally
                            {
                                archive.Dispose();
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                JSystem.Except.AddException(ex);
            }
        }