Rebase Develop
This commit is contained in:
@@ -4,6 +4,7 @@ using DevExpress.ExpressApp.Actions;
|
||||
using DevExpress.ExpressApp.Xpo;
|
||||
using DevExpress.Persistent.Base;
|
||||
using Newtonsoft.Json;
|
||||
using SISBusiness.Module.NAV;
|
||||
using SISBusiness.Module.StaticClass;
|
||||
|
||||
namespace SISBusiness.Module.Controllers
|
||||
@@ -90,61 +91,67 @@ namespace SISBusiness.Module.Controllers
|
||||
{
|
||||
XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
|
||||
InvoiceHeader _InvoiceHeader = View.SelectedObjects[0] as InvoiceHeader;
|
||||
string _operation = "CREATE";
|
||||
|
||||
if (_InvoiceHeader.IsStorno)
|
||||
{
|
||||
_operation = "STORNO";
|
||||
}
|
||||
var _postData = new
|
||||
{
|
||||
documentnumber = _InvoiceHeader.DocumentNumber,
|
||||
customersfrom = _InvoiceHeader.CustomersFrom.Oid.ToString(),
|
||||
operation = _operation,
|
||||
technicalAnnulment = false,
|
||||
softwareId = "123456789123456789",
|
||||
softwareName = "3C ERP System",
|
||||
softwareOperation = "ONLINE_SERVICE",
|
||||
softwareMainVersion = "17.2.3",
|
||||
softwareDevName = "3C Távközlési Kft.",
|
||||
softwareDevContact = "http:\\3ctelecom.hu",
|
||||
softwareDevCountryCode = "HU",
|
||||
softwareDevTaxNumber = "10644209-2-43"
|
||||
OnlineInvoiceHelper _OnlineInvoiceHelper = new OnlineInvoiceHelper(_ocur.Session);
|
||||
_OnlineInvoiceHelper.manageInvoice(_ocur, _InvoiceHeader, Application);
|
||||
|
||||
};
|
||||
//XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
|
||||
//InvoiceHeader _InvoiceHeader = View.SelectedObjects[0] as InvoiceHeader;
|
||||
//string _operation = "CREATE";
|
||||
|
||||
RestAPI.ExecuteRootePOST("onlineinvoice/manageinvoice", true, JsonConvert.SerializeObject(_postData));
|
||||
var _StatusCode = RestAPI.StatusCode;
|
||||
var _StatusDescription = RestAPI.StatusMessage;
|
||||
//if (_InvoiceHeader.IsStorno)
|
||||
//{
|
||||
// _operation = "STORNO";
|
||||
//}
|
||||
//var _postData = new
|
||||
//{
|
||||
// documentnumber = _InvoiceHeader.DocumentNumber,
|
||||
// customersfrom = _InvoiceHeader.CustomersFrom.Oid.ToString(),
|
||||
// operation = _operation,
|
||||
// technicalAnnulment = false,
|
||||
// softwareId = "123456789123456789",
|
||||
// softwareName = "3C ERP System",
|
||||
// softwareOperation = "ONLINE_SERVICE",
|
||||
// softwareMainVersion = "17.2.3",
|
||||
// softwareDevName = "3C Távközlési Kft.",
|
||||
// softwareDevContact = "http:\\3ctelecom.hu",
|
||||
// softwareDevCountryCode = "HU",
|
||||
// softwareDevTaxNumber = "10644209-2-43"
|
||||
|
||||
Tracing.Tracer.LogText(_StatusCode.ToString());
|
||||
Tracing.Tracer.LogText(_StatusDescription.ToString());
|
||||
//};
|
||||
|
||||
if (_StatusCode == 200)
|
||||
{
|
||||
dynamic _ResultJSON = JsonConvert.DeserializeObject(_StatusDescription);
|
||||
//RestAPI.ExecuteRootePOST("onlineinvoice/manageinvoice", true, JsonConvert.SerializeObject(_postData));
|
||||
//var _StatusCode = RestAPI.StatusCode;
|
||||
//var _StatusDescription = RestAPI.StatusMessage;
|
||||
|
||||
if (_ResultJSON.status.ToString() == "OK")
|
||||
{
|
||||
_ocur.Session.ExecuteNonQuery(string.Format("UPDATE InvoiceHeader set NAV_transactionID='{0}' WHERE Oid = '{1}'", _ResultJSON.transactionId["0"].ToString(), _InvoiceHeader.Oid.ToString()));
|
||||
//Tracing.Tracer.LogText(_StatusCode.ToString());
|
||||
//Tracing.Tracer.LogText(_StatusDescription.ToString());
|
||||
|
||||
Application.ShowViewStrategy.ShowMessage("A számla beküldése megtörtént !", InformationType.Success, 2000, InformationPosition.Bottom);
|
||||
}
|
||||
if (_ResultJSON.status.ToString() == "ERROR")
|
||||
{
|
||||
string _ERROR = "A számla beküldése nem történt meg !";
|
||||
_ERROR += " [" + _ResultJSON.ToString() + "]";
|
||||
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string _ERROR = "A számla beküldése nem történt meg !";
|
||||
_ERROR += " [" + _StatusDescription + "]";
|
||||
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
|
||||
}
|
||||
//if (_StatusCode == 200)
|
||||
//{
|
||||
// dynamic _ResultJSON = JsonConvert.DeserializeObject(_StatusDescription);
|
||||
|
||||
(View as ListView).CollectionSource.Reload();
|
||||
// if (_ResultJSON.status.ToString() == "OK")
|
||||
// {
|
||||
// _ocur.Session.ExecuteNonQuery(string.Format("UPDATE InvoiceHeader set NAV_transactionID='{0}' WHERE Oid = '{1}'", _ResultJSON.transactionId["0"].ToString(), _InvoiceHeader.Oid.ToString()));
|
||||
|
||||
// Application.ShowViewStrategy.ShowMessage("A számla beküldése megtörtént !", InformationType.Success, 2000, InformationPosition.Bottom);
|
||||
// }
|
||||
// if (_ResultJSON.status.ToString() == "ERROR")
|
||||
// {
|
||||
// string _ERROR = "A számla beküldése nem történt meg !";
|
||||
// _ERROR += " [" + _ResultJSON.ToString() + "]";
|
||||
// Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// string _ERROR = "A számla beküldése nem történt meg !";
|
||||
// _ERROR += " [" + _StatusDescription + "]";
|
||||
// Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
|
||||
//}
|
||||
|
||||
//(View as ListView).CollectionSource.Reload();
|
||||
}
|
||||
|
||||
private void aNAV_queryInvoiceStatus_Execute(object sender, SimpleActionExecuteEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user