private void DuplicateDetail_Execute(object sender, SimpleActionExecuteEventArgs e) { if (!ObjectSpace.IsModified) { genCon.showMsg("", "View Mode cannot proceed.", InformationType.Error); return; } if (((ListView)View).SelectedObjects.Count != 1) { genCon.showMsg("", "Please select only 1 item.", InformationType.Error); return; } IObjectSpace os = Application.CreateObjectSpace(); if (typeof(ClassDocumentDetail).IsAssignableFrom(View.ObjectTypeInfo.Type)) { foreach (ClassDocumentDetail dtl in ((ListView)View).SelectedObjects) { if (View.ObjectTypeInfo.Type == typeof(PurchaseRequestDetail)) { sDtl = dtl; } if (View.ObjectTypeInfo.Type == typeof(PurchaseOrderDetail)) { sDtl = dtl; } if (View.ObjectTypeInfo.Type == typeof(PurchaseDeliveryDetail)) { sDtl = dtl; } if (View.ObjectTypeInfo.Type == typeof(PurchaseReturnDetail)) { sDtl = dtl; } if (View.ObjectTypeInfo.Type == typeof(PurchaseQuotationDetail)) { sDtl = dtl; } //copyCon.copyClassDocumentDetail(dtl, sDtl, os); } } if (typeof(ClassStockTransferDocumentDetail).IsAssignableFrom(View.ObjectTypeInfo.Type)) { foreach (ClassStockTransferDocumentDetail dtl in ((ListView)View).SelectedObjects) { if (View.ObjectTypeInfo.Type == typeof(StockTransferRequestDetail)) { sDtlS = dtl; } //copyCon.copyClassStockTransferDocumentDetail(dtl, sDtlS, os); } } NewObjectViewController newobjectcon = Frame.GetController <NewObjectViewController>(); newobjectcon.NewObjectAction.DoExecute(newobjectcon.NewObjectAction.Items.FirstActiveItem); }
private void PQCopyFromPR_Execute(object sender, PopupWindowShowActionExecuteEventArgs e) { PurchaseQuotation masterobject = (PurchaseQuotation)View.CurrentObject; IObjectSpace ios = View is DetailView ? ObjectSpace : Application.CreateObjectSpace(); if (copyCon.CopyFromDocument(masterobject, (ListView)e.PopupWindow.View, ios)) { masterobject.IsCopy = true; genCon.showMsg("Operation Done", "Item Copied.", InformationType.Success); return; } }
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); }