Example #1
0
 internal virtual void OnDocumentSaved(Controls.DocControl cont, DocumentSavedEventArgs doc)
 {
     if (DocumentSaved != null)
     {
         DocumentSaved.DynamicInvoke(new object[] { cont, doc });
     }
 }
Example #2
0
 internal override void OnDocumentSaved(DocumentSavedEventArgs doc)
 {
     base.OnDocumentSaved(doc);
     if (saveFaxInfo.SenderId == 0)
     {
         CreateContactAfterFaxInSave(faxID, saveFaxInfo.RecipId, doc.DocID);
     }
 }
Example #3
0
 internal override void OnDocumentSaved(DocumentSavedEventArgs doc)
 {
     if (doc.DocID > 0 && doc.ImageID > 0)
     {
         docControl.FileName = "";
         Slave.DeleteFile(_filename);
         base.OnDocumentSaved(doc);
     }
 }
        internal override void OnDocumentSaved(DocumentSavedEventArgs doc)
        {
            if (doc.ImageID > 0 && faxID > 0)
            {
                Environment.FaxData.CheckFax(faxID, doc.ImageID);
            }

            doc.IsFax = true;
            base.OnDocumentSaved(doc);
        }
 internal override void OnDocumentSaved(DocumentSavedEventArgs doc)
 {
     Controls.DocControl doccont = null;
     if (docControl != null)
     {
         doccont             = docControl;
         docControl.FileName = "";
     }
     Slave.DeleteFile(filename);
     base.OnDocumentSaved(doccont, doc);
 }
        private void dialog_DialogEvent(object source, DialogEventArgs e)
        {
            var dialog = e.Dialog as Dialogs.AddDBDocDialog;

            if (dialog != null)
            {
                switch (dialog.DialogResult)
                {
                case DialogResult.Yes:
                case DialogResult.Retry:
                case DialogResult.OK:
                {
                    Console.Write("Document: " + dialog.DocID.ToString() + " Image: " + dialog.ImageID.ToString());
                    int docID   = dialog.DocID;
                    int imageID = dialog.ImageID;
                    if (docID == 0 || imageID == 0)
                    {
                        return;
                    }
                    bool work = dialog.DialogResult != DialogResult.Yes;
                    if (work && dialog.AddToWork)
                    {
                        Console.WriteLine("{0}: Add to Work", DateTime.Now.ToString("HH:mm:ss fff"));
                        Environment.WorkDocData.AddDocToEmployee(docID, Environment.CurEmp.ID);
                    }
                    Console.WriteLine("{0}: event", DateTime.Now.ToString("HH:mm:ss fff"));
                    var doc = new DocumentSavedEventArgs(docID, imageID, work && dialog.GotoDoc,
                                                         work && dialog.CreateEForm, dialog.CreateSlaveEForm);
                    Console.WriteLine("{0}: Send Message", DateTime.Now.ToString("HH:mm:ss fff"));
                    if (work && dialog.SendMessage && !dialog.CreateSlaveEForm)
                    {
                        var senddialog = new Dialogs.SendMessageDialog(dialog.DocID, GetStringToSave(),
                                                                       !dialog.AddToWork)
                        {
                            Owner = docControl.ParentForm
                        };
                        senddialog.DialogEvent += SendMessageAfterSave_DialogEvent;
                        senddialog.Show();
                    }
                    else
                    {
                        Console.WriteLine("{0}: link", DateTime.Now.ToString("HH:mm:ss fff"));
                        docControl.OnLinkDoc(docID);
                    }
                    Console.WriteLine("{0}: Save event", DateTime.Now.ToString("HH:mm:ss fff"));
                    OnDocumentSaved(doc);
                }
                break;
                }
            }
        }
        private void dialog_DialogEvent(object source, DialogEventArgs e)
        {
            Dialogs.AddDBDocDialog dialog = e.Dialog as Dialogs.AddDBDocDialog;
            if (dialog == null)
            {
                return;
            }
            Form form;

            Document.Objects.TmpFile tf = null;
            if (!string.IsNullOrEmpty(dialog.OldFileName))
            {
                Environment.DocToSave.TryRemove(dialog.OldFileName, out form);

                tf = Environment.GetTmpFileByValue(dialog.OldFileName);
            }
            switch (dialog.DialogResult)
            {
            case DialogResult.Yes:
            case DialogResult.Retry:
            case DialogResult.OK:
            {
                int docID   = dialog.DocID;
                int imageID = dialog.ImageID;

                Console.WriteLine("{0}: DocID: {1} ImageID: {2}", DateTime.Now.ToString("HH:mm:ss fff"), docID, imageID);
                if (docID > 0 && imageID > 0)
                {
                    bool work = dialog.DialogResult != DialogResult.Yes;
                    if (work && dialog.AddToWork)
                    {
                        Console.WriteLine("{0}: Add to Work", DateTime.Now.ToString("HH:mm:ss fff"));
                        Environment.WorkDocData.AddDocToEmployee(docID, Environment.CurEmp.ID);
                    }
                    DocumentSavedEventArgs doc = new DocumentSavedEventArgs(docID, imageID, work && dialog.GotoDoc, work && dialog.CreateEForm, dialog.CreateSlaveEForm);

                    if (work)
                    {
                        force        = !dialog.AddToWork;
                        sendMail     = dialog.SendMessage && !dialog.CreateSlaveEForm;
                        parentDocIDs = dialog.ParentDocIDs;
                        childDocIDs  = dialog.ChildDocIDs;
                        sendString   = GetStringToSave();
                        if (dialog.NeedOpenDoc)
                        {
                            Environment.OnNewWindow(this, doc);
                        }
                        Send(dialog.DocID);
                    }
                    Console.WriteLine("{0}: Save event", DateTime.Now.ToString("HH:mm:ss fff"));
                    OnDocumentSaved(doc);
                    Console.WriteLine("{0}: event", DateTime.Now.ToString("HH:mm:ss fff"));
                }
            }
                if (tf != null && tf.Window != null)
                {
                    tf.AscBeforeClose = false;
                    tf.Window.Close();
                }
                break;
            }

            if (tf != null)
            {
                tf.CurAct = Environment.ActionBefore.None;
                tf.LinkCnt--;
            }
        }