Ejemplo n.º 1
0
        private void btnPreviewRepo_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (DocActionGridView.GetFocusedRow() is DocumentActions item)
            {
                using (NetworkShareAccesser.Access("PLGUNV_NAS", @"", "pitd.is_user", "Apple_01"))
                {
                    StaticSettings staticSettings = new StaticSettings();
                    UnitOfWork     unitOfWork     = new UnitOfWork();
                    var            root           = $@"\\plgunv_nas\is_docs\ofmis\{staticSettings.Offices.OffcAcr}";
                    if (!Directory.Exists(root))
                    {
                        Directory.CreateDirectory(root);
                    }

                    var files = unitOfWork.FilesRepo.Find(x => x.RefId == item.Id && x.TableName == "Action");

                    if (files == null)
                    {
                        return;
                    }
                    var          path = Path.Combine(root, files.Path + ".png");
                    frmPreviewer frm  = new frmPreviewer(path);
                    frm.ShowDialog();
                }
            }
        }
Ejemplo n.º 2
0
        public virtual void btnPreview_Click(object sender, EventArgs e)
        {
            using (NetworkShareAccesser.Access("PLGUNV_NAS", @"", "pitd.is_user", "Apple_01"))
            {
                StaticSettings staticSettings = new StaticSettings();
                UnitOfWork     unitOfWork     = new UnitOfWork();
                var            root           = $@"\\plgunv_nas\is_docs\ofmis\{staticSettings.Offices.OffcAcr}";
                if (!Directory.Exists(root))
                {
                    Directory.CreateDirectory(root);
                }

                var files = unitOfWork.FilesRepo.Find(x => x.RefId == documentActions.Id && x.TableName == "Action");

                if (files == null)
                {
                    return;
                }
                var          path = Path.Combine(root, files.Path + ".png");
                frmPreviewer frm  = new frmPreviewer(path);
                frm.ShowDialog();
            }
        }