Exemple #1
0
        private void commandBar1_DelCommandPressed(object sender, EventArgs e)
        {
            WIN.SCHEDULING_APPLICATION.DOMAIN.Document label = null;
            if (gridView1.FocusedRowHandle >= 0)
            {
                label = gridView1.GetRow(gridView1.FocusedRowHandle) as WIN.SCHEDULING_APPLICATION.DOMAIN.Document;
                if (label == null)
                {
                    return;
                }
            }


            try
            {
                if (XtraMessageBox.Show("Sicuro di voler procedere? ", "Elimina documento", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    Nested_CheckSecurityForDeletion();

                    DocumentHandler h = new DocumentHandler();
                    h.Delete(_current);

                    IBindingList g = gridView1.DataSource as IBindingList;
                    g.Remove(label);
                }
            }
            catch (AccessDeniedException)
            {
                XtraMessageBox.Show("Impossibile accedere alla funzionalità richiesta. Accesso negato", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception ex)
            {
                ErrorHandler.Show(ex);
            }
        }
Exemple #2
0
        private void ShowDialogForm(WIN.SCHEDULING_APPLICATION.DOMAIN.Document label)
        {
            try
            {
                //frm = null;

                //Thread t = new Thread(() => Sleep(label));
                //t.Start();



                //if (!t.Join(3000))
                //{
                //    t.Abort();
                //    XtraMessageBox.Show("Si è verifica un problema nell'apertura del documento riprovare!", "Messaggio", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                //    return;
                //}

                DocumentForm frm = new DocumentForm(label);
                frm.CheckSecurityForView();

                frm.ShowDialog();
                frm.Dispose();
                MemoryHelper.ReduceMemory();
                //GC.Collect();
                //GC.WaitForPendingFinalizers();
            }
            catch (Exception ex)
            {
                ErrorHandler.Show(ex);
            }
        }
Exemple #3
0
        private void ShowDocumentPreviewAt(int index)
        {
            gridView2.FocusedRowHandle = index;
            WIN.SCHEDULING_APPLICATION.DOMAIN.Document doc = gridView2.GetRow(index) as WIN.SCHEDULING_APPLICATION.DOMAIN.Document;
            _previewDoc = doc;

            if (index >= 0)
            {
                using (MemoryStream m = new MemoryStream(doc.Body.Document))
                {
                    lblSub.Text      = doc.Subject;
                    lblCreated.Text  = string.Format("Creato: {0}", doc.Date.ToLongDateString());
                    lblPriority.Text = string.Format("Priorità: {0}", doc.PriorityToString);
                    lblContatti.Text = string.Format("Contatti: {0}", doc.ContactList);
                    lblType.Text     = string.Format("Documento: {0} - {1}", doc.Protocol, doc.NatureToString);
                    lblCausale.Text  = string.Format("Causale: {0}", doc.Type != null? doc.Type.Descrizione:"");


                    //svuoto la imagelist
                    imageList1.Images.Clear();
                    imageListBoxControl1.Items.Clear();
                    foreach (AttachmentForDocument item in doc.Attachments)
                    {
                        imageListBoxControl1.Items.Add(item, GetFileImageIndex(item));
                    }


                    rchbody.LoadDocument(m, DevExpress.XtraRichEdit.DocumentFormat.Rtf);
                }
            }
            else
            {
                LoadNotAvailablePreviewOnRichtext();
            }
        }
Exemple #4
0
 private void gridView1_CustomColumnDisplayText_1(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName == "Date")
     {
         WIN.SCHEDULING_APPLICATION.DOMAIN.Document app = gridView1.GetRow(e.RowHandle) as WIN.SCHEDULING_APPLICATION.DOMAIN.Document;
         if (app != null)
         {
             e.DisplayText = app.Date.ToLongDateString();
         }
     }
 }
Exemple #5
0
        private void Goto(WIN.SCHEDULING_APPLICATION.DOMAIN.Document label)
        {
            //Hashtable h = new Hashtable();
            //h.Add("Id", label.Id);
            //h.Add("Task", label);
            //NavigateTo("Tasks", h);
            DocumentForm frm = new DocumentForm(label);

            frm.CheckSecurityForView();
            frm.ShowDialog();
            frm.Dispose();
        }
Exemple #6
0
        private void DoRowDoubleClick(GridView view, Point pt)
        {
            GridHitInfo info = view.CalcHitInfo(pt);

            if (view.FocusedRowHandle >= 0)
            {
                WIN.SCHEDULING_APPLICATION.DOMAIN.Document label = view.GetRow(view.FocusedRowHandle) as WIN.SCHEDULING_APPLICATION.DOMAIN.Document;
                if (label != null)
                {
                    Goto(label);
                }
            }
        }
Exemple #7
0
 private void DoRowDoubleClick(GridView view)
 {
     //GridHitInfo info = view.CalcHitInfo(pt);
     if (view.FocusedRowHandle >= 0)
     {
         WIN.SCHEDULING_APPLICATION.DOMAIN.Document label = view.GetRow(view.FocusedRowHandle) as WIN.SCHEDULING_APPLICATION.DOMAIN.Document;
         if (label != null)
         {
             ShowDialogForm(label);
             ShowDocumentPreviewAt(view.FocusedRowHandle);
         }
     }
 }
Exemple #8
0
        private void TryDelete(WIN.SCHEDULING_APPLICATION.DOMAIN.Document myTask, int rowIndex)
        {
            if (myTask == null)
            {
                return;
            }

            if (XtraMessageBox.Show("Rimuovere il documento selezionato?", "Domanda", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                DocumentHandler h = new DocumentHandler();
                h.Delete(myTask);

                IBindingList h1 = gridView2.DataSource as IBindingList;
                h1.Remove(myTask);
            }
        }
Exemple #9
0
 private void LoadNotAvailablePreviewOnRichtext()
 {
     _previewDoc = null;
     if (!splitContainerControl3.Collapsed)
     {
         lblSub.Text      = "";
         lblCreated.Text  = "";
         lblPriority.Text = "";
         lblContatti.Text = "";
         lblType.Text     = "";
         rchbody.RtfText  = PreviewNotavailableBody.Body;
         lblCausale.Text  = "";
         //svuoto la imagelist
         imageList1.Images.Clear();
         imageListBoxControl1.Items.Clear();
     }
 }
Exemple #10
0
        private ArrayList GetVisibleRecords()
        {
            ArrayList l = new ArrayList();

            if (gridView2.RowCount > 0)
            {
                gridView2.ExpandAllGroups();
            }
            for (int i = 0; i < gridView2.RowCount; i++)
            {
                int handle = gridView2.GetVisibleRowHandle(i);
                if (!gridView2.IsGroupRow(handle))
                {
                    WIN.SCHEDULING_APPLICATION.DOMAIN.Document a = gridView2.GetRow(handle) as WIN.SCHEDULING_APPLICATION.DOMAIN.Document;
                    if (a != null)
                    {
                        l.Add(a);
                    }
                }
            }
            return(l);
        }
Exemple #11
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            try
            {
                DocumentReport c = new DocumentReport();
                ArrayList      l = new ArrayList();

                if (gridView2.FocusedRowHandle >= 0)
                {
                    WIN.SCHEDULING_APPLICATION.DOMAIN.Document label = gridView2.GetRow(gridView2.FocusedRowHandle) as WIN.SCHEDULING_APPLICATION.DOMAIN.Document;
                    if (label != null)
                    {
                        l.Add(label);

                        c.DataSource = l;
                        c.ShowPreviewDialog();
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorHandler.Show(ex);
            }
        }