Na MOST JÓ !!!

This commit is contained in:
2018-04-22 23:46:07 +02:00
parent 714241c3a0
commit c4223f324d
7 changed files with 85 additions and 14 deletions
@@ -28,14 +28,44 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.aPrintLastInvoice = new DevExpress.ExpressApp.Actions.SimpleAction(this.components);
this.aPrintLastDeliveryNoteOut = new DevExpress.ExpressApp.Actions.SimpleAction(this.components);
//
// aOrderInStorageOutDeliveryNoteOutInvoice
// aPrintLastInvoice
//
this.aOrderInStorageOutDeliveryNoteOutInvoice.CustomizePopupWindowParams += new DevExpress.ExpressApp.Actions.CustomizePopupWindowParamsEventHandler(this.InvoiceCustomization);
this.aOrderInStorageOutDeliveryNoteOutInvoice.Execute += new DevExpress.ExpressApp.Actions.PopupWindowShowActionExecuteEventHandler(this.aOrderInStorageOutDeliveryNoteOutInvoice_Execute);
this.aPrintLastInvoice.Caption = "aPrint Last Invoice";
this.aPrintLastInvoice.ConfirmationMessage = null;
this.aPrintLastInvoice.Id = "aPrintLastInvoice";
this.aPrintLastInvoice.TargetObjectType = typeof(Nuvolar.Module.OrderInHeader);
this.aPrintLastInvoice.TargetViewNesting = DevExpress.ExpressApp.Nesting.Root;
this.aPrintLastInvoice.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView;
this.aPrintLastInvoice.ToolTip = null;
this.aPrintLastInvoice.TypeOfView = typeof(DevExpress.ExpressApp.DetailView);
this.aPrintLastInvoice.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aPrintLastInvoice_Execute);
//
// aPrintLastDeliveryNoteOut
//
this.aPrintLastDeliveryNoteOut.Caption = "aPrint Last Delivery Note Out";
this.aPrintLastDeliveryNoteOut.ConfirmationMessage = null;
this.aPrintLastDeliveryNoteOut.Id = "aPrintLastDeliveryNoteOut";
this.aPrintLastDeliveryNoteOut.TargetObjectType = typeof(Nuvolar.Module.OrderInHeader);
this.aPrintLastDeliveryNoteOut.TargetViewNesting = DevExpress.ExpressApp.Nesting.Root;
this.aPrintLastDeliveryNoteOut.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView;
this.aPrintLastDeliveryNoteOut.ToolTip = null;
this.aPrintLastDeliveryNoteOut.TypeOfView = typeof(DevExpress.ExpressApp.DetailView);
this.aPrintLastDeliveryNoteOut.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aPrintLastDeliveryNoteOut_Execute);
//
// OrderIn_VC
//
this.Actions.Add(this.aPrintLastInvoice);
this.Actions.Add(this.aPrintLastDeliveryNoteOut);
}
#endregion
private DevExpress.ExpressApp.Actions.SimpleAction aPrintLastInvoice;
private DevExpress.ExpressApp.Actions.SimpleAction aPrintLastDeliveryNoteOut;
}
}
@@ -11,8 +11,10 @@ using DevExpress.ExpressApp.Model.NodeGenerators;
using DevExpress.ExpressApp.SystemModule;
using DevExpress.ExpressApp.Templates;
using DevExpress.ExpressApp.Utils;
using DevExpress.ExpressApp.Xpo;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.Validation;
using DevExpress.Xpo;
namespace Nuvolar.Module.CSharp
{
@@ -39,17 +41,44 @@ namespace Nuvolar.Module.CSharp
// Unsubscribe from previously subscribed events and release other references and resources.
base.OnDeactivated();
}
public override void aOrderInStorageOutDeliveryNoteOutInvoice_Execute(object sender, PopupWindowShowActionExecuteEventArgs e)
{
base.aOrderInStorageOutDeliveryNoteOutInvoice_Execute(sender, e);
private void aPrintLastInvoice_Execute(object sender, SimpleActionExecuteEventArgs e)
{
XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
OrderInHeader _OrderInHeader = View.SelectedObjects[0] as OrderInHeader;
XPCollection<InvoiceRows> _InvoiceRows_Collection = new XPCollection<InvoiceRows>(_ocur.Session,
CriteriaOperator.Parse("(OrderInRows.OrderInHeader = ? or OrderInRowsOther.OrderInHeader = ?) and IsNull(InvoiceHeader.GCRecord)=True and IsNull(InvoiceHeader)=False",
_OrderInHeader.Oid, _OrderInHeader.Oid));
if (_InvoiceRows_Collection.Count > 0)
{
_InvoiceRows_Collection.Sorting.Add(new SortProperty("InvoiceHeader.DateCreated", DevExpress.Xpo.DB.SortingDirection.Descending));
_InvoiceRows_Collection.Sorting.Add(new SortProperty("InvoiceHeader.DocumentNumber", DevExpress.Xpo.DB.SortingDirection.Ascending));
InvoiceHeader _InvoiceHeader = _InvoiceRows_Collection[0].InvoiceHeader;
XAFPrintHelper _XAFPrintHelper = new XAFPrintHelper(_ocur, Frame, _InvoiceHeader.InvoiceType.ReportDataV2, CriteriaOperator.Parse("InvoiceHeader.Oid = ?", _InvoiceHeader.Oid));
_XAFPrintHelper.ShowPreviewV2();
}
}
public override void InvoiceCustomization(object sender, CustomizePopupWindowParamsEventArgs e)
private void aPrintLastDeliveryNoteOut_Execute(object sender, SimpleActionExecuteEventArgs e)
{
base.InvoiceCustomization(sender, e);
}
XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
OrderInHeader _OrderInHeader = View.SelectedObjects[0] as OrderInHeader;
XPCollection<DeliveryNoteOutRows> _DeliveryNoteOutRows_Collection = new XPCollection<DeliveryNoteOutRows>(_ocur.Session,
CriteriaOperator.Parse("StorageOutRowsInRows.StorageOutRows.OrderInRows.OrderInHeader.Oid = ?",_OrderInHeader.Oid));
if (_DeliveryNoteOutRows_Collection.Count>0)
{
_DeliveryNoteOutRows_Collection.Sorting.Add(new SortProperty("DeliveryNoteOutHeader.DateCreated", DevExpress.Xpo.DB.SortingDirection.Descending));
_DeliveryNoteOutRows_Collection.Sorting.Add(new SortProperty("DeliveryNoteOutHeader.DocumentNumber", DevExpress.Xpo.DB.SortingDirection.Ascending));
DeliveryNoteOutHeader _DeliveryNoteOutHeader = _DeliveryNoteOutRows_Collection[0].DeliveryNoteOutHeader;
XAFPrintHelper _XAFPrintHelper = new XAFPrintHelper(_ocur, Frame, _DeliveryNoteOutHeader.DeliveryNoteOutType.ReportDataV2, CriteriaOperator.Parse("DeliveryNoteOutHeader.Oid = ?", _DeliveryNoteOutHeader.Oid));
_XAFPrintHelper.ShowPreviewV2();
}
}
}
}
@@ -120,6 +120,12 @@
<metadata name="aOrderInStorageOutDeliveryNoteOutInvoice.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="aPrintLastInvoice.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>310, 17</value>
</metadata>
<metadata name="aPrintLastDeliveryNoteOut.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>453, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>