110 lines
4.4 KiB
C#
110 lines
4.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using System.Xml;
|
|
using DevExpress.Data.Filtering;
|
|
using DevExpress.ExpressApp;
|
|
using DevExpress.ExpressApp.Actions;
|
|
using DevExpress.ExpressApp.Editors;
|
|
using DevExpress.ExpressApp.Layout;
|
|
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;
|
|
|
|
namespace Nuvolar.Module.Win.CSharp.Controllers
|
|
{
|
|
// For more typical usage scenarios, be sure to check out https://documentation.devexpress.com/eXpressAppFramework/clsDevExpressExpressAppViewControllertopic.aspx.
|
|
public partial class VATReport_VC : ViewController
|
|
{
|
|
public VATReport_VC()
|
|
{
|
|
InitializeComponent();
|
|
// Target required Views (via the TargetXXX properties) and create their Actions.
|
|
}
|
|
protected override void OnActivated()
|
|
{
|
|
base.OnActivated();
|
|
// Perform various tasks depending on the target View.
|
|
}
|
|
protected override void OnViewControlsCreated()
|
|
{
|
|
base.OnViewControlsCreated();
|
|
// Access and customize the target View control.
|
|
}
|
|
protected override void OnDeactivated()
|
|
{
|
|
// Unsubscribe from previously subscribed events and release other references and resources.
|
|
base.OnDeactivated();
|
|
}
|
|
|
|
private void aVATReport_Create60XML_Execute(object sender, SimpleActionExecuteEventArgs e)
|
|
{
|
|
XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
|
|
VATReport _VATReport = View.SelectedObjects[0] as VATReport;
|
|
string _NAVProgramPath = "";
|
|
string _FileName60 = "";
|
|
|
|
SaveFileDialog _SaveFileDialog = new SaveFileDialog();
|
|
if (_NAVProgramPath != "")
|
|
{
|
|
_FileName60 = string.Format("{0}{1}.xml", Path.GetTempPath(), _VATReport.ShortName);
|
|
Create60XML(_ocur, _FileName60, _VATReport);
|
|
string _ShellCommand = String.Format("{0} \"cmd:open.xml {1}\" ", _NAVProgramPath, _FileName60);
|
|
ProcessStartInfo _ProcessStartInfo = new ProcessStartInfo();
|
|
_ProcessStartInfo.FileName = _ShellCommand;
|
|
|
|
Process.Start(_ProcessStartInfo);
|
|
}
|
|
else
|
|
{
|
|
_SaveFileDialog.Filter = "XML files (*.xml)|*.xml";
|
|
_SaveFileDialog.FileName = _VATReport.ShortName;
|
|
_SaveFileDialog.DefaultExt = "xml";
|
|
_SaveFileDialog.FilterIndex = 2;
|
|
_SaveFileDialog.RestoreDirectory = true;
|
|
|
|
if (_SaveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
|
{
|
|
_FileName60 = _SaveFileDialog.FileName;
|
|
|
|
Create60XML(_ocur, _FileName60, _VATReport);
|
|
|
|
|
|
//MsgBox(String.Format("Az XML file ""{0}"" névvel a következő helyen került elmentésre:" + vbNewLine + "{1}", System.IO.Path.GetFileName(_SaveFileDialog.FileName), IO.Path.GetFullPath(_SaveFileDialog.FileName)), _
|
|
// MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "Exportálás befejeződött!")
|
|
}
|
|
}
|
|
}
|
|
private void Create60XML(XPObjectSpace _ocur, string _FileName60, VATReport _VATReport)
|
|
{
|
|
XmlTextWriter _XmlTextWriter = new XmlTextWriter(_FileName60, System.Text.Encoding.UTF8);
|
|
_XmlTextWriter.WriteEndElement();
|
|
/* --Itt kezdődik ... -------------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/* -- Itt végződik ... ------------------------------------------------------------------------------------*/
|
|
_XmlTextWriter.Flush();
|
|
_XmlTextWriter.Close();
|
|
|
|
}
|
|
private void UploadField(XmlTextWriter _XmlTextWriter, string _FieldID, string _ValueString)
|
|
{
|
|
_XmlTextWriter.WriteStartElement("mezo");
|
|
_XmlTextWriter.WriteAttributeString("eazon", _FieldID);
|
|
_XmlTextWriter.WriteString(_ValueString);
|
|
_XmlTextWriter.WriteEndElement();
|
|
|
|
|
|
}
|
|
}
|
|
}
|