示例#1
0
        protected override void OnOpenRecord(long Id)
        {
            base.OnOpenRecord(Id);

            if (DocumentType == null)
            {
                XDB.SYS_DOC_Header entry = ((XDB.ORG_TRX_Header)((DevExpress.Data.Async.Helpers.ReadonlyThreadSafeProxyForObjectFromAnotherThread)(GridView.GetFocusedRow())).OriginalRow).HeaderId;
                DocumentType = ((BL.SYS.SYS_DOC_Type)entry.TypeId.Id);
            }
            Essential.BaseForm child = null;

            switch (DocumentType)
            {
            case BL.SYS.SYS_DOC_Type.Quote:
                child = new Document.Customer.QuoteForm(Id);
                break;

            case BL.SYS.SYS_DOC_Type.SalesOrder:
                child = new Document.Customer.SalesOrderForm(Id);
                break;

            case BL.SYS.SYS_DOC_Type.TAXInvoice:
                child = new Document.Customer.TAXInvoiceForm(Id);
                break;

            case BL.SYS.SYS_DOC_Type.CreditNote:
                child = new Document.Customer.CreditNoteForm(Id);
                break;

            case BL.SYS.SYS_DOC_Type.PurchaseOrder:
                child = new Document.Supplier.PurchaseOrderForm(Id);
                break;

            case BL.SYS.SYS_DOC_Type.GoodsReceived:
                child = new Document.Supplier.GoodsReceivedForm(Id);
                break;

            case BL.SYS.SYS_DOC_Type.GoodsReturned:
                child = new Document.Supplier.GoodsReturnedForm(Id);
                break;

            case BL.SYS.SYS_DOC_Type.BackOrder:
                child = new Document.Customer.BackOrderForm(Id);
                break;

            case BL.SYS.SYS_DOC_Type.JobQuote:
                child = new Document.Customer.JobQuoteForm(Id);
                break;
            }
            ShowForm(child);
        }
示例#2
0
        protected override void OnNewRecord()
        {
            base.OnNewRecord();

            Essential.BaseForm child = null;

            switch (DocumentType)
            {
            case BL.SYS.SYS_DOC_Type.Quote:
                child = new Document.Customer.QuoteForm();
                break;

            case BL.SYS.SYS_DOC_Type.SalesOrder:
                child = new Document.Customer.SalesOrderForm();
                break;

            case BL.SYS.SYS_DOC_Type.TAXInvoice:
                //Werner: Cannot create TAX Invoice from scratch
                child = new Document.Customer.SalesOrderForm();
                break;

            case BL.SYS.SYS_DOC_Type.CreditNote:
                child = new Document.Customer.CreditNoteForm();
                break;

            case BL.SYS.SYS_DOC_Type.PurchaseOrder:
                child = new Document.Supplier.PurchaseOrderForm();
                break;

            case BL.SYS.SYS_DOC_Type.GoodsReceived:
                child = new Document.Supplier.GoodsReceivedForm();
                break;

            case BL.SYS.SYS_DOC_Type.GoodsReturned:
                child = new Document.Supplier.GoodsReturnedForm();
                break;

            case BL.SYS.SYS_DOC_Type.BackOrder:
                child = new Document.Customer.BackOrderForm();
                break;

            case BL.SYS.SYS_DOC_Type.JobQuote:
                child = new Document.Customer.JobQuoteForm();
                break;
            }

            ShowForm(child);
        }
示例#3
0
        /// <summary>
        /// Call this method to open a New Generated document.
        /// </summary>
        /// <param name="header">Newly generated SYS_DOC_Header of document you are opening.</param>
        /// <remarks>Created: Henko Rabie 29/01/2015</remarks>
        public void ShowDocumentForm(DB.SYS_DOC_Header header)
        {
            CDS.Client.Desktop.Document.BaseDocument childForm = null;
            //TODO: Fill in the rest for the other document forms
            switch (header.TypeId)
            {
            case (byte)BL.SYS.SYS_DOC_Type.Quote:
                childForm = new Document.Customer.QuoteForm();
                break;

            case (byte)BL.SYS.SYS_DOC_Type.SalesOrder:
                childForm = new Document.Customer.SalesOrderForm();
                break;

            case (byte)BL.SYS.SYS_DOC_Type.TAXInvoice:
                childForm = new Document.Customer.TAXInvoiceForm();
                break;

            case (byte)BL.SYS.SYS_DOC_Type.CreditNote:
                childForm = new Document.Customer.CreditNoteForm();
                break;

            case (byte)BL.SYS.SYS_DOC_Type.PickingSlip:
                break;

            case (byte)BL.SYS.SYS_DOC_Type.PurchaseOrder:
                childForm = new Document.Supplier.PurchaseOrderForm();
                break;

            case (byte)BL.SYS.SYS_DOC_Type.GoodsReceived:
                childForm = new Document.Supplier.GoodsReceivedForm();
                break;

            case (byte)BL.SYS.SYS_DOC_Type.GoodsReturned:
                childForm = new Document.Supplier.GoodsReturnedForm();
                break;

            case (byte)BL.SYS.SYS_DOC_Type.TransferRequest:
                break;

            case (byte)BL.SYS.SYS_DOC_Type.TransferShipment:
                break;

            case (byte)BL.SYS.SYS_DOC_Type.TransferReceived:
                break;

            case (byte)BL.SYS.SYS_DOC_Type.InventoryAdjustment:
                break;

            case (byte)BL.SYS.SYS_DOC_Type.BackOrder:
                childForm = new Document.Customer.BackOrderForm();
                break;
            }

            if (childForm != null)
            {
                childForm.Doc_Header = header;
                childForm.ItemState  = Essential.BaseForm.EntityState.Generated;
                ShowForm(childForm);
            }
        }
示例#4
0
        /// <summary>
        /// Call this method to Open an existing document.
        /// </summary>
        /// <param name="id">Primary key of the document you want to open.</param>
        /// <param name="typeId">Document type that you are opening.</param>
        /// <remarks>Created: Henko Rabie 29/01/2015</remarks>
        public void ShowDocumentForm(Int64 id, Int64 typeId)
        {
            CDS.Client.Desktop.Essential.BaseForm childForm = null;
            //TODO: Fill in the rest for the other document forms
            switch (typeId)
            {
            case (byte)BL.SYS.SYS_DOC_Type.Quote:
                childForm = new Document.Customer.QuoteForm(id);
                break;

            case (byte)BL.SYS.SYS_DOC_Type.SalesOrder:
                childForm = new Document.Customer.SalesOrderForm(id);
                break;

            case (byte)BL.SYS.SYS_DOC_Type.TAXInvoice:
                childForm = new Document.Customer.TAXInvoiceForm(id);
                break;

            case (byte)BL.SYS.SYS_DOC_Type.CreditNote:
                childForm = new Document.Customer.CreditNoteForm(id);
                break;

            case (byte)BL.SYS.SYS_DOC_Type.PickingSlip:

                break;

            case (byte)BL.SYS.SYS_DOC_Type.PurchaseOrder:
                childForm = new Document.Supplier.PurchaseOrderForm(id);
                break;

            case (byte)BL.SYS.SYS_DOC_Type.GoodsReceived:
                childForm = new Document.Supplier.GoodsReceivedForm(id);
                break;

            case (byte)BL.SYS.SYS_DOC_Type.GoodsReturned:
                childForm = new Document.Supplier.GoodsReturnedForm(id);
                break;

            //Werner: is this supposed to be here?
            case (byte)BL.SYS.SYS_DOC_Type.Job:
                childForm = new Workshop.Job.JobForm(id);
                break;

            case (byte)BL.SYS.SYS_DOC_Type.TransferRequest:

                break;

            case (byte)BL.SYS.SYS_DOC_Type.TransferShipment:

                break;

            case (byte)BL.SYS.SYS_DOC_Type.TransferReceived:

                break;

            case (byte)BL.SYS.SYS_DOC_Type.InventoryAdjustment:
                break;

            case (byte)BL.SYS.SYS_DOC_Type.BackOrder:
                childForm = new Document.Customer.BackOrderForm(id);
                break;
            }

            if (childForm != null)
            {
                ShowForm(childForm);
            }
        }