Beispiel #1
0
        public void SetAttachment(string path)
        {
            hyperLinkEdit2.EditValue = path;
            NetworkFileSystemUtilsProxy p = new NetworkFileSystemUtilsProxy();

            if (p.UncFileExist(path))
            {
                hyperLinkEdit2.Properties.Image = Properties.Resources.tick_16;
            }
            else
            {
                hyperLinkEdit2.Properties.Image = Properties.Resources.warning_16;
            }
        }
Beispiel #2
0
        private string CostruisciNuovoNomeFile()
        {
            int i = 1;
            //destinazione
            string m_destination = hyperLinkEdit1.EditValue.ToString();
            //nome del file
            NetworkFileSystemUtilsProxy p = new NetworkFileSystemUtilsProxy();
            string m_FileRegistry         = p.CretateUncFileFinfo(hyperLinkEdit2.Text).Name;

            string temp = System.IO.Path.Combine(m_destination, m_FileRegistry);

            while (p.UncFileExist(temp))
            {
                temp = "";
                temp = String.Format("{0}-{1}", i, m_FileRegistry);
                temp = Path.Combine(m_destination, temp);
                i++;
            }
            return(String.Format("{0}-{1}", i - 1, m_FileRegistry));
        }
Beispiel #3
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            try
            {
                FrmAttachments frm = new FrmAttachments();
                if (_new)
                {
                    frm.SetDestination(_document.Scope.DefaultPath);
                    frm.SetAttachment("-Nessun allegato-");
                }
                else
                {
                    frm.SetDestination(_current.Path);
                    frm.SetAttachment(_current.AttachmentCompletePath);
                }

                if (frm.ShowDialog() == DialogResult.OK)
                {
                    hyperLinkEdit1.EditValue = frm.CreatedAttachement;
                    NetworkFileSystemUtilsProxy p = new NetworkFileSystemUtilsProxy();


                    if (p.UncFileExist(frm.CreatedAttachement))
                    {
                        hyperLinkEdit1.Properties.Image = Properties.Resources.tick_16;
                    }
                    else
                    {
                        hyperLinkEdit1.Properties.Image = Properties.Resources.warning_16;
                    }
                    _current.SetAttachment(frm.CreatedAttachement);
                }
                frm.Dispose();
            }
            catch (Exception ex)
            {
                ErrorHandler.Show(ex);
            }
        }