Beispiel #1
0
        public void Cancel(int docEntry, Model.EnumObjType objType)
        {
            Documents document = GetDIObject(objType);

            try
            {
                if (document.GetByKey(docEntry))
                {
                    Documents documentC = document.CreateCancellationDocument();
                    if (documentC != null)
                    {
                        try
                        {
                            documentC.Add();
                        }
                        finally
                        {
                            Marshal.ReleaseComObject(documentC);
                            GC.Collect();
                        }
                    }

                    Controller.ConnectionController.Instance.VerifyBussinesObjectSuccess();
                }
            }
            finally
            {
                Marshal.ReleaseComObject(document);
                GC.Collect();
            }
        }