private void CopyToPO_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            PurchaseRequest sObject = (PurchaseRequest)View.CurrentObject;
            IObjectSpace    ios     = Application.CreateObjectSpace();
            PurchaseOrder   tObject = ios.CreateObject <PurchaseOrder>();

            if (copyCon.CopyToDocument(sObject, tObject, ios, (DetailView)View))
            {
                if (tObject.CardCode != null)
                {
                    tObject.IsCopy = true;
                }

                genCon.showMsg("Operation Done", "New Purchase Order copied. Please save it.", InformationType.Success);
                genCon.openNewView(ios, tObject, ViewEditMode.Edit);
                return;
            }

            genCon.showMsg("Operation Done", "No Open Item for copied.", InformationType.Info);
        }
        private void CopyToDO_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            PurchaseOrder sObject = (PurchaseOrder)View.CurrentObject;

            if (GeneralValues.LiveWithPost)
            {
                if (sObject.VerNo > sObject.PostVerNo)
                {
                    genCon.showMsg("Operation fail", "Document has not yet sync. Please wait.", InformationType.Error);
                    return;
                }
                foreach (PurchaseOrderDetail dtl in sObject.PurchaseOrderDetail)
                {
                    if (dtl.VerNo > dtl.PostVerNo)
                    {
                        genCon.showMsg("Operation fail", "Document has not yet sync. Please wait.", InformationType.Error);
                        return;
                    }
                }
            }
            IObjectSpace     ios     = Application.CreateObjectSpace();
            PurchaseDelivery tObject = ios.CreateObject <PurchaseDelivery>();

            if (copyCon.CopyToDocument(sObject, tObject, ios, (DetailView)View))
            {
                if (tObject.CardCode != null)
                {
                    tObject.IsCopy = true;
                }

                genCon.showMsg("Operation Done", "New Purchase Delivery copied. Please save it.", InformationType.Success);
                genCon.openNewView(ios, tObject, ViewEditMode.Edit);
                return;
            }

            genCon.showMsg("Operation Done", "No Open Item for copied.", InformationType.Info);
        }