This commit is contained in:
2018-08-07 14:52:41 +02:00
parent 37c9ce7495
commit 788ea08e95
8 changed files with 149 additions and 208 deletions
@@ -1,36 +0,0 @@
namespace Nuvolar.Module.Win.CSharp.Controllers
{
partial class NAV_Online_WC
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
}
#endregion
}
}
@@ -1,99 +0,0 @@
using System;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Xpo;
using MySql.Data.MySqlClient;
namespace Nuvolar.Module.Win.CSharp.Controllers
{
/// <summary>
/// NAV Online számla ellenőrző rendszer ...
/// </summary>
public partial class NAV_Online_WC : WindowController
{
private System.Windows.Forms.Timer _NAV_Timer;
private int invokeCount;
private bool _OnTick;
public NAV_Online_WC()
{
InitializeComponent();
}
protected override void OnActivated()
{
base.OnActivated();
invokeCount = 0;
_OnTick = false;
_NAV_Timer = new System.Windows.Forms.Timer();
_NAV_Timer.Interval = 15000;
_NAV_Timer.Start();
_NAV_Timer.Tick += NAV_Timer_Tick;
}
/// <summary>
/// Időzített NAV Online számla feladás
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void NAV_Timer_Tick(object sender, EventArgs e)
{
if (_OnTick == false)
{
try
{
_OnTick = true;
MySqlConnection _MySqlConnection = new MySqlConnection(GeneralFunction.GLOBAL_ConnectionString.Replace("XpoProvider=MySql;",""));
_MySqlConnection.Open();
MySqlCommand _MySqlCommand = new MySqlCommand(" SELECT DocumentNumber " +
" FROM InvoiceHeader " +
" WHERE IsEditable=0 AND " +
" ABS(TotalVATHUF) >= 100000 AND " +
" IFNULL(DocumentNumber,'') !='' AND " +
" IsProforma=0 AND " +
" NAV_InvoiceStatus <> 'DONE' AND" +
" DateCreated >= '2018-07-01' ",
_MySqlConnection);
MySqlDataReader _MySqlDataReader = _MySqlCommand.ExecuteReader();
if (_MySqlDataReader.HasRows)
{
//string _message = string.Format("{0} NAV online számla ellenőrzés ... {1,2}.", DateTime.Now.ToString("h:mm:ss.fff"), (++invokeCount).ToString());
string _message = "NAV online számla feladás ...";
Application.ShowViewStrategy.ShowMessage(_message, InformationType.Info, 1000, InformationPosition.Bottom);
while (_MySqlDataReader.Read())
{
//NAV időzített feladás ...
string _DocumentNumber = _MySqlDataReader["DocumentNumber"] as string;
//HA VAN
XPObjectSpace _onew = Application.CreateObjectSpace() as XPObjectSpace;
}
}
_MySqlConnection.Close();
}
catch (Exception ex)
{
Application.ShowViewStrategy.ShowMessage(ex.Message, InformationType.Error, 5000, InformationPosition.Bottom);
}
finally
{
_OnTick = false;
}
}
}
protected override void OnDeactivated()
{
// Unsubscribe from previously subscribed events and release other references and resources.
base.OnDeactivated();
}
}
}