NAV OnlineInvoices
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
namespace Nuvolar.Module.Controllers
|
||||
{
|
||||
partial class NAV_Online_VC
|
||||
{
|
||||
/// <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();
|
||||
this.aNAV_queryInvoiceStatus = new DevExpress.ExpressApp.Actions.SimpleAction(this.components);
|
||||
this.aNAV_manageInvoice = new DevExpress.ExpressApp.Actions.SimpleAction(this.components);
|
||||
this.aNAV_queryTaxpayer = new DevExpress.ExpressApp.Actions.SimpleAction(this.components);
|
||||
this.aNAV_queryInvoiceData = new DevExpress.ExpressApp.Actions.SimpleAction(this.components);
|
||||
//
|
||||
// aNAV_queryInvoiceStatus
|
||||
//
|
||||
this.aNAV_queryInvoiceStatus.Caption = "aNAV_queryInvoiceStatus";
|
||||
this.aNAV_queryInvoiceStatus.ConfirmationMessage = null;
|
||||
this.aNAV_queryInvoiceStatus.Id = "aNAV_queryInvoiceStatus";
|
||||
this.aNAV_queryInvoiceStatus.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject;
|
||||
this.aNAV_queryInvoiceStatus.TargetObjectType = typeof(Nuvolar.Module.InvoiceHeader);
|
||||
this.aNAV_queryInvoiceStatus.ToolTip = null;
|
||||
this.aNAV_queryInvoiceStatus.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aNAV_queryInvoiceStatus_Execute);
|
||||
//
|
||||
// aNAV_manageInvoice
|
||||
//
|
||||
this.aNAV_manageInvoice.Caption = "aNAV_manageInvoice";
|
||||
this.aNAV_manageInvoice.ConfirmationMessage = null;
|
||||
this.aNAV_manageInvoice.Id = "aNAV_manageInvoice";
|
||||
this.aNAV_manageInvoice.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject;
|
||||
this.aNAV_manageInvoice.TargetObjectType = typeof(Nuvolar.Module.InvoiceHeader);
|
||||
this.aNAV_manageInvoice.ToolTip = null;
|
||||
this.aNAV_manageInvoice.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aNAV_manageInvoice_Execute);
|
||||
//
|
||||
// aNAV_queryTaxpayer
|
||||
//
|
||||
this.aNAV_queryTaxpayer.Caption = "aNAV_queryTaxpayer";
|
||||
this.aNAV_queryTaxpayer.ConfirmationMessage = null;
|
||||
this.aNAV_queryTaxpayer.Id = "aNAV_queryTaxpayer";
|
||||
this.aNAV_queryTaxpayer.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject;
|
||||
this.aNAV_queryTaxpayer.TargetObjectType = typeof(Nuvolar.Module.Customers);
|
||||
this.aNAV_queryTaxpayer.ToolTip = null;
|
||||
this.aNAV_queryTaxpayer.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aNAV_queryTaxpayer_Execute);
|
||||
//
|
||||
// aNAV_queryInvoiceData
|
||||
//
|
||||
this.aNAV_queryInvoiceData.Caption = "aNAV_queryInvoiceData";
|
||||
this.aNAV_queryInvoiceData.ConfirmationMessage = null;
|
||||
this.aNAV_queryInvoiceData.Id = "aNAV_queryInvoiceData";
|
||||
this.aNAV_queryInvoiceData.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject;
|
||||
this.aNAV_queryInvoiceData.TargetObjectType = typeof(Nuvolar.Module.InvoiceHeader);
|
||||
this.aNAV_queryInvoiceData.ToolTip = null;
|
||||
this.aNAV_queryInvoiceData.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aNAV_queryInvoiceData_Execute);
|
||||
//
|
||||
// NAV_Online_VC
|
||||
//
|
||||
this.Actions.Add(this.aNAV_queryInvoiceStatus);
|
||||
this.Actions.Add(this.aNAV_manageInvoice);
|
||||
this.Actions.Add(this.aNAV_queryTaxpayer);
|
||||
this.Actions.Add(this.aNAV_queryInvoiceData);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.ExpressApp.Actions.SimpleAction aNAV_queryInvoiceStatus;
|
||||
private DevExpress.ExpressApp.Actions.SimpleAction aNAV_manageInvoice;
|
||||
private DevExpress.ExpressApp.Actions.SimpleAction aNAV_queryTaxpayer;
|
||||
private DevExpress.ExpressApp.Actions.SimpleAction aNAV_queryInvoiceData;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,259 @@
|
||||
using DevExpress.Data.Filtering;
|
||||
using DevExpress.ExpressApp;
|
||||
using DevExpress.ExpressApp.Actions;
|
||||
using DevExpress.ExpressApp.Xpo;
|
||||
using Newtonsoft.Json;
|
||||
using Nuvolar.Module.StaticClass;
|
||||
|
||||
namespace Nuvolar.Module.Controllers
|
||||
{
|
||||
public partial class NAV_Online_VC : ViewController
|
||||
{
|
||||
public NAV_Online_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();
|
||||
}
|
||||
/// <summary>
|
||||
/// Adószám ellenőrzése a kiválasztott ügyfelek alapján
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void aNAV_queryTaxpayer_Execute(object sender, SimpleActionExecuteEventArgs e)
|
||||
{
|
||||
XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
|
||||
Customers _Customers = View.SelectedObjects[0] as Customers;
|
||||
CustomersFrom _CustomersFrom = _ocur.FindObject<CustomersFrom>(CriteriaOperator.Parse("IsDefault=True"));
|
||||
var _postData = new
|
||||
{
|
||||
customersfrom = _CustomersFrom.Oid.ToString(),
|
||||
taxPayer = _Customers.VATNumber.Substring(0, 8),
|
||||
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"
|
||||
};
|
||||
|
||||
RestAPI.ExecuteRootePOST("onlineinvoice/querytaxpayer", true, JsonConvert.SerializeObject(_postData));
|
||||
var _StatusCode = RestAPI.StatusCode;
|
||||
var _StatusDescription = RestAPI.StatusMessage;
|
||||
|
||||
if (_StatusCode == 200)
|
||||
{
|
||||
|
||||
|
||||
dynamic _ResultJSON = JsonConvert.DeserializeObject(_StatusDescription);
|
||||
|
||||
if (_ResultJSON.status.ToString() == "OK")
|
||||
{
|
||||
if (_ResultJSON.taxpayerValidity["0"].ToString() == "false")
|
||||
{
|
||||
_ocur.Session.ExecuteNonQuery(string.Format("UPDATE Customers set NAV_valid = 0,NAV_queryDate=NOW() WHERE Oid = '{0}'",
|
||||
_Customers.Oid.ToString()));
|
||||
}
|
||||
if (_ResultJSON.taxpayerValidity["0"].ToString() == "true")
|
||||
{
|
||||
_ocur.Session.ExecuteNonQuery(string.Format("UPDATE Customers set NAV_valid = 1,NAV_queryDate=NOW() WHERE Oid = '{0}'",
|
||||
_Customers.Oid.ToString()));
|
||||
}
|
||||
Application.ShowViewStrategy.ShowMessage("Adószám ellenőrzés megtörtént !", InformationType.Success, 2000, InformationPosition.Bottom);
|
||||
}
|
||||
if (_ResultJSON.status.ToString() == "ERROR")
|
||||
{
|
||||
string _ERROR = "Adószám ellenőrzés nem történt meg !";
|
||||
_ERROR += " [" + _ResultJSON.xml.result.message.ToString() + "]";
|
||||
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string _ERROR = "Adószám ellenőrzés nem történt meg !";
|
||||
_ERROR += " [" + _StatusDescription.ToString() + "]";
|
||||
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
|
||||
}
|
||||
}
|
||||
|
||||
private void aNAV_manageInvoice_Execute(object sender, SimpleActionExecuteEventArgs e)
|
||||
{
|
||||
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"
|
||||
|
||||
};
|
||||
|
||||
RestAPI.ExecuteRootePOST("onlineinvoice/manageinvoice", true, JsonConvert.SerializeObject(_postData));
|
||||
var _StatusCode = RestAPI.StatusCode;
|
||||
var _StatusDescription = RestAPI.StatusMessage;
|
||||
|
||||
if (_StatusCode == 200)
|
||||
{
|
||||
dynamic _ResultJSON = JsonConvert.DeserializeObject(_StatusDescription);
|
||||
|
||||
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.xml.result.message.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)
|
||||
{
|
||||
XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
|
||||
InvoiceHeader _InvoiceHeader = View.SelectedObjects[0] as InvoiceHeader;
|
||||
|
||||
var _postData = new
|
||||
{
|
||||
documentnumber = _InvoiceHeader.DocumentNumber,
|
||||
customersfrom = _InvoiceHeader.CustomersFrom.Oid.ToString(),
|
||||
transactionId = _InvoiceHeader.NAV_transactionId,
|
||||
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"
|
||||
|
||||
};
|
||||
|
||||
RestAPI.ExecuteRootePOST("onlineinvoice/queryinvoicestatus", true, JsonConvert.SerializeObject(_postData));
|
||||
var _StatusCode = RestAPI.StatusCode;
|
||||
var _StatusDescription = RestAPI.StatusMessage;
|
||||
|
||||
if (_StatusCode == 200)
|
||||
{
|
||||
dynamic _ResultJSON = JsonConvert.DeserializeObject(_StatusDescription);
|
||||
|
||||
if (_ResultJSON.status.ToString() == "OK")
|
||||
{
|
||||
_ocur.Session.ExecuteNonQuery(string.Format("UPDATE InvoiceHeader set NAV_InvoiceStatus='{0}',NAV_queryDate=NOW() WHERE Oid = '{1}'",
|
||||
_ResultJSON.processingResults.processingResult.invoiceStatus.ToString(), _InvoiceHeader.Oid.ToString()));
|
||||
Application.ShowViewStrategy.ShowMessage("A számla státusz lekérdezése megtörtént !", InformationType.Success, 2000, InformationPosition.Bottom);
|
||||
}
|
||||
if (_ResultJSON.status.ToString() == "ERROR")
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string _ERROR = "A számla státusz ellenőrzés nem történt meg !";
|
||||
_ERROR += " [" + _StatusDescription + "]";
|
||||
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
|
||||
}
|
||||
}
|
||||
|
||||
private void aNAV_queryInvoiceData_Execute(object sender, SimpleActionExecuteEventArgs e)
|
||||
{
|
||||
InvoiceHeader _InvoiceHeader = View.SelectedObjects[0] as InvoiceHeader;
|
||||
|
||||
var _postData = new
|
||||
{
|
||||
invoiceNumber = _InvoiceHeader.DocumentNumber,
|
||||
customersfrom = _InvoiceHeader.CustomersFrom.Oid.ToString(),
|
||||
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"
|
||||
|
||||
};
|
||||
|
||||
RestAPI.ExecuteRootePOST("onlineinvoice/queryinvoicedata", true, JsonConvert.SerializeObject(_postData));
|
||||
var _StatusCode = RestAPI.StatusCode;
|
||||
var _StatusDescription = RestAPI.StatusMessage;
|
||||
if (_StatusCode == 200)
|
||||
{
|
||||
dynamic _ResultJSON = JsonConvert.DeserializeObject(_StatusDescription);
|
||||
|
||||
if (_ResultJSON.status.ToString() == "OK")
|
||||
{
|
||||
if (_ResultJSON.queryResults.availablePage.ToString() == "0")
|
||||
{
|
||||
string _ERROR = "A számla adat ellenőrzés megtörtént ! Nincs elérhető adat!";
|
||||
|
||||
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Warning, 5000, InformationPosition.Bottom);
|
||||
}
|
||||
if (_ResultJSON.queryResults.availablePage.ToString() != "0")
|
||||
{
|
||||
string _ERROR = "A számla adat ellenőrzés megtörtént !";
|
||||
|
||||
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Success, 5000, InformationPosition.Bottom);
|
||||
}
|
||||
}
|
||||
if (_ResultJSON.status.ToString() == "ERROR")
|
||||
{
|
||||
string _ERROR = "A számla adat ellenőrzés nem történt meg !";
|
||||
_ERROR += " [" + _ResultJSON.technicalValidationMessages.message.ToString() + "]";
|
||||
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string _ERROR = "A számla státusz ellenőrzés nem történt meg !";
|
||||
_ERROR += " [" + _StatusDescription + "]";
|
||||
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using DevExpress.Persistent.Base;
|
||||
using DevExpress.Persistent.BaseImpl.PermissionPolicy;
|
||||
using DevExpress.Xpo;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Nuvolar.Module.Laravel
|
||||
{
|
||||
[DefaultClassOptions, Persistent("Users")]
|
||||
public class Users : XPLiteObject
|
||||
{
|
||||
public Users(Session session)
|
||||
: base(session)
|
||||
{
|
||||
}
|
||||
public override void AfterConstruction()
|
||||
{
|
||||
base.AfterConstruction();
|
||||
}
|
||||
[Key(true), Persistent("id")] public int id;
|
||||
[Persistent("name")] public string name;
|
||||
[Persistent("email")] public string email;
|
||||
[Persistent("api_token")] public string api_token;
|
||||
[Persistent("permissionpolicyuser"), NoForeignKey] public PermissionPolicyUser PermissionPolicyUser;
|
||||
[NonPersistent, VisibleInListView(false), VisibleInLookupListView(false)] public string row_password;
|
||||
}
|
||||
}
|
||||
@@ -67,6 +67,15 @@
|
||||
<Items>
|
||||
<Item Id="FinancialTransactions">
|
||||
<Items>
|
||||
<Item Id="@ID_AccountTransactions">
|
||||
<Items>
|
||||
<Item Id="@Invoices">
|
||||
<Items>
|
||||
<Item Id="@InvoiceHeader_ListView_NAV" Caption="NAV jelentés köteles számlák" />
|
||||
</Items>
|
||||
</Item>
|
||||
</Items>
|
||||
</Item>
|
||||
<Item Id="PartnerAccountHandling">
|
||||
<Items>
|
||||
<Item Id="PCIGroupAdvance_ListView" Caption="Partner pontozási infó (előleg)" />
|
||||
@@ -83,6 +92,18 @@
|
||||
</Items>
|
||||
</NavigationItems>
|
||||
<Views>
|
||||
<DetailView Id="CustomersFrom_DetailView">
|
||||
<Layout>
|
||||
<LayoutGroup Id="Main">
|
||||
<LayoutGroup Id="SimpleEditors">
|
||||
<LayoutGroup Id="Autod257e2eb-d1ce-4fce-9922-dea39f6d87ed" Caption="Autod257e2eb-d1ce-4fce-9922-dea39f6d87ed(3)" />
|
||||
</LayoutGroup>
|
||||
<TabbedGroup Id="Tabs">
|
||||
<LayoutGroup Id="Item2" Caption="NAV adatok" />
|
||||
</TabbedGroup>
|
||||
</LayoutGroup>
|
||||
</Layout>
|
||||
</DetailView>
|
||||
<DetailView Id="CustomersOrder_DetailView">
|
||||
<Layout>
|
||||
<LayoutGroup Id="Main">
|
||||
@@ -95,6 +116,7 @@
|
||||
</LayoutGroup>
|
||||
</Layout>
|
||||
</DetailView>
|
||||
<ListView Id="InvoiceHeader_ListView_NAV" Caption="NAV jel. szlák" />
|
||||
<DetailView Id="NAVInvoiceReport_DetailView">
|
||||
<Items>
|
||||
<ActionContainerViewItem Id="@NAVReport" Caption="@NAVReport(13)" />
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<Action Id="aDeliveryNoteOutPrint_Divided" ImageName="MenuBar_Print" TargetObjectsCriteria="[DividedOriginal] In (2L, 1L)" />
|
||||
<Action Id="aMoveOrderIn" ImageName="replace2" />
|
||||
<Action Id="aMoveOrderInBack" ImageName="selection_replace" TargetObjectsCriteria="[OrderInHeader.IsEditable] = True And [QTT_Invoiced] = 0.0 And [QTT_DeliveryNoted] > 0.0 And [QTT_DeliveryNoted] = [QTT_Storaged] And [DividedOriginal] = 1L" />
|
||||
<Action Id="aNAV_queryTaxpayer" Caption="NAV adószám ellenőrzés" TargetObjectsCriteria="Not IsNullOrEmpty([VATNumber])" />
|
||||
<Action Id="aOpenWindowsExplorer" ImageName="console" />
|
||||
<Action Id="aOrderInStorageOut" ImageName="document_out" />
|
||||
<Action Id="aPrint_DeliveryNoteOutHeader" ImageName="Action_Printing_Print" TargetObjectsCriteria="[DeliveryNoteOutHeader] Is Not Null" />
|
||||
@@ -59,6 +60,17 @@
|
||||
<Items>
|
||||
<Item Id="FinancialTransactions">
|
||||
<Items>
|
||||
<Item Id="@ID_AccountTransactions">
|
||||
<Items>
|
||||
<Item Id="@Invoices">
|
||||
<Items>
|
||||
<Item Id="@InvoiceHeader_ListView_NAV" ViewId="InvoiceHeader_ListView_NAV" Index="1" IsNewNode="True" />
|
||||
<Item Id="@InvoiceRows_ListView" Index="2" />
|
||||
<Item Id="@Factoring" Index="3" />
|
||||
</Items>
|
||||
</Item>
|
||||
</Items>
|
||||
</Item>
|
||||
<Item Id="PartnerAccountHandling">
|
||||
<Items>
|
||||
<Item Id="PCIGroup_ListView" Index="0" />
|
||||
@@ -106,6 +118,49 @@
|
||||
<ColumnInfo Id="Completed" Index="4" Width="49" />
|
||||
</Columns>
|
||||
</ListView>
|
||||
<DetailView Id="CustomersFrom_DetailView">
|
||||
<Layout>
|
||||
<LayoutGroup Id="Main">
|
||||
<LayoutGroup Id="SimpleEditors" RelativeSize="26.825842696629213">
|
||||
<LayoutGroup Id="Autod257e2eb-d1ce-4fce-9922-dea39f6d87ed" RelativeSize="70.157068062827221">
|
||||
<LayoutGroup Id="Customers_col1" RelativeSize="47.508591065292094">
|
||||
<LayoutItem Id="CustomerNumber" RelativeSize="23.880597014925375" />
|
||||
<LayoutItem Id="Name" RelativeSize="17.910447761194028" />
|
||||
<LayoutItem Id="FullName" RelativeSize="17.910447761194028" />
|
||||
<LayoutItem Id="CustomersNG" RelativeSize="17.910447761194028" />
|
||||
<LayoutItem Id="Email" RelativeSize="22.388059701492537" />
|
||||
</LayoutGroup>
|
||||
<LayoutGroup Id="Customers_col2" RelativeSize="52.491408934707906">
|
||||
<LayoutItem Id="IsDefault" RelativeSize="23.880597014925375" />
|
||||
<LayoutItem Id="VATNumber" RelativeSize="17.910447761194028" />
|
||||
<LayoutItem Id="VATNumberEU" RelativeSize="17.910447761194028" />
|
||||
<LayoutItem Id="WebSite" RelativeSize="17.910447761194028" />
|
||||
<LayoutItem Id="CompanyRegistrationNumber" RelativeSize="22.388059701492537" />
|
||||
</LayoutGroup>
|
||||
</LayoutGroup>
|
||||
<LayoutGroup Id="Party" RelativeSize="29.842931937172775">
|
||||
<LayoutItem Id="Address1" RelativeSize="47.368421052631582" />
|
||||
<LayoutItem Id="Address2" RelativeSize="52.631578947368418" />
|
||||
<LayoutItem Id="Description" Removed="True" />
|
||||
</LayoutGroup>
|
||||
</LayoutGroup>
|
||||
<TabbedGroup Id="Tabs" RelativeSize="73.174157303370791">
|
||||
<LayoutGroup Id="Customers_BusinessDirectory" Index="5" RelativeSize="100">
|
||||
<LayoutItem Id="Customers_BusinessDirectory" RelativeSize="100" />
|
||||
</LayoutGroup>
|
||||
<LayoutGroup Id="OfferOutRows" Index="6" RelativeSize="100">
|
||||
<LayoutItem Id="OfferOutRows" RelativeSize="100" />
|
||||
</LayoutGroup>
|
||||
<LayoutGroup Id="Item2" ShowCaption="True" CaptionLocation="Top" Direction="Vertical" Index="7" RelativeSize="100" IsNewNode="True">
|
||||
<LayoutItem Id="NAV_login" ViewItem="NAV_login" Index="0" RelativeSize="6.6945606694560666" IsNewNode="True" />
|
||||
<LayoutItem Id="NAV_password" ViewItem="NAV_password" Index="1" RelativeSize="5.02092050209205" IsNewNode="True" />
|
||||
<LayoutItem Id="NAV_exchangeKey" ViewItem="NAV_exchangeKey" Index="2" RelativeSize="5.02092050209205" IsNewNode="True" />
|
||||
<LayoutItem Id="NAV_xmlSignkey" ViewItem="NAV_xmlSignkey" Index="3" RelativeSize="83.263598326359826" IsNewNode="True" />
|
||||
</LayoutGroup>
|
||||
</TabbedGroup>
|
||||
</LayoutGroup>
|
||||
</Layout>
|
||||
</DetailView>
|
||||
<DetailView Id="CustomersOrder_DetailView">
|
||||
<Layout>
|
||||
<LayoutGroup Id="Main">
|
||||
@@ -164,6 +219,71 @@
|
||||
<ColumnInfo Id="DocumentPath" PropertyName="DocumentPath" Index="6" InLineEdit="True" InLineEditAutoCommit="True" IsNewNode="True" />
|
||||
</Columns>
|
||||
</ListView>
|
||||
<ListView Id="InvoiceHeader_ListView_NAV" ClassName="Nuvolar.Module.InvoiceHeader" IsGroupPanelVisible="True" AutoExpandAllGroups="True" Criteria="[IsEditable] = False And [IsProforma] = False And ([TotalVATHUF] >= 100000.0 OR [TotalVATHUF] <= -100000.0) And Not IsNullOrEmpty([DocumentNumber])" AllowDelete="False" AllowLink="False" AllowNew="False" IsNewNode="True">
|
||||
<Columns IsNewNode="True">
|
||||
<ColumnInfo Id="AssetsHandling_GLMixed" PropertyName="AssetsHandling_GLMixed" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="AssetsHandling_Note" PropertyName="AssetsHandling_Note" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="AssetsHandlingStatus" PropertyName="AssetsHandlingStatus" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="BankInformation" PropertyName="BankInformation" Index="-1" Width="150" IsNewNode="True" />
|
||||
<ColumnInfo Id="Contact_string" PropertyName="Contact_string" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="CustomersRefNumber_string" PropertyName="CustomersRefNumber_string" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="DateExecutionMonth" PropertyName="DateExecutionMonth" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="DateExecutionQuarter" PropertyName="DateExecutionQuarter" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="DateExecutionWeek" PropertyName="DateExecutionWeek" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="DateExecutionYear" PropertyName="DateExecutionYear" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="DatePaymentMode" PropertyName="DatePaymentMode" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="DescriptionHeader" PropertyName="DescriptionHeader" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="DocumentNumberProforma" PropertyName="DocumentNumberProforma" Index="-1" Width="80" IsNewNode="True" />
|
||||
<ColumnInfo Id="Factoring_PDF_Signed" PropertyName="Factoring_PDF_Signed" Width="124" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="Factoring_Send" PropertyName="Factoring_Send" Width="97" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="Factoring_Send_Date" PropertyName="Factoring_Send_Date" Width="127" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="Factoring_Send_Number" PropertyName="Factoring_Send_Number" Width="136" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="InvoiceFactoringBank" PropertyName="InvoiceFactoringBank" Width="129" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="InvoiceFactoringParameter" PropertyName="InvoiceFactoringParameter" Width="146" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="InvoiceFactoringRows" PropertyName="InvoiceFactoringRows" Width="122" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="InvoicePeriod" PropertyName="InvoicePeriod" Index="-1" Width="100" IsNewNode="True" />
|
||||
<ColumnInfo Id="InvoiceType" PropertyName="InvoiceType" Index="-1" Width="100" IsNewNode="True" />
|
||||
<ColumnInfo Id="IsAssetsHandling" PropertyName="IsAssetsHandling" Width="50" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="IsBookEntry" PropertyName="IsBookEntry" Index="-1" Width="70" IsNewNode="True" />
|
||||
<ColumnInfo Id="IsCorrigendum" PropertyName="IsCorrigendum" Index="-1" Width="50" IsNewNode="True" />
|
||||
<ColumnInfo Id="IsCreditNote" PropertyName="IsCreditNote" Width="50" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="IsFactoring" PropertyName="IsFactoring" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="IsLateCharge" PropertyName="IsLateCharge" Width="50" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="IsStorno" PropertyName="IsStorno" Index="-1" Width="50" IsNewNode="True" />
|
||||
<ColumnInfo Id="IsVATClosed" PropertyName="IsVATClosed" Width="50" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="LateChargesBalanceHUF" PropertyName="LateChargesBalanceHUF" Width="50" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="NotNeedFinancial" PropertyName="NotNeedFinancial" Width="50" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="Oid" PropertyName="Oid" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="PCIGroup" PropertyName="PCIGroup" Width="66" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="PDF_Copy" PropertyName="PDF_Copy" Index="-1" Width="70" IsNewNode="True" />
|
||||
<ColumnInfo Id="PDF_Original" PropertyName="PDF_Original" Index="-1" Width="70" IsNewNode="True" />
|
||||
<ColumnInfo Id="PrintCopy" PropertyName="PrintCopy" Index="-1" Width="70" IsNewNode="True" />
|
||||
<ColumnInfo Id="ReadyforBookEntry" PropertyName="ReadyforBookEntry" Index="-1" Width="80" IsNewNode="True" />
|
||||
<ColumnInfo Id="row_Products" PropertyName="row_Products" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="row_Services" PropertyName="row_Services" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="TotalAdvancedBruttoDEV" PropertyName="TotalAdvancedBruttoDEV" Width="187" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="TotalAdvancedBruttoHUF" PropertyName="TotalAdvancedBruttoHUF" Width="188" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="TotalAdvancedWill" PropertyName="TotalAdvancedWill" Width="151" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="TotalNettoDEV" PropertyName="TotalNettoDEV" Width="115" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="TotalVATDEV" PropertyName="TotalVATDEV" Width="119" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="UserCreated" PropertyName="UserCreated" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="VATAvowalType" PropertyName="VATAvowalType" Width="70" Index="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="Customers" PropertyName="Customers" Index="0" Width="101" GroupIndex="-1" IsNewNode="True" />
|
||||
<ColumnInfo Id="CustomersFrom" PropertyName="CustomersFrom" Index="1" Width="125" GroupIndex="0" SortOrder="Ascending" IsNewNode="True" />
|
||||
<ColumnInfo Id="DocumentNumber" PropertyName="DocumentNumber" Index="2" Width="101" IsNewNode="True" />
|
||||
<ColumnInfo Id="CurrencyName" PropertyName="CurrencyName" Index="3" Width="87" SortOrder="Ascending" GroupIndex="1" IsNewNode="True" />
|
||||
<ColumnInfo Id="DateCreated" PropertyName="DateCreated" Index="4" Width="94" IsNewNode="True" />
|
||||
<ColumnInfo Id="DateExecution" PropertyName="DateExecution" Index="5" Width="104" IsNewNode="True" />
|
||||
<ColumnInfo Id="DatePayment" PropertyName="DatePayment" Index="6" Width="99" IsNewNode="True" />
|
||||
<ColumnInfo Id="TotalNettoHUF" PropertyName="TotalNettoHUF" Width="116" Index="7" IsNewNode="True" />
|
||||
<ColumnInfo Id="TotalVATHUF" PropertyName="TotalVATHUF" Width="124" Index="8" IsNewNode="True" />
|
||||
<ColumnInfo Id="TotalBruttoHUF" PropertyName="TotalBruttoHUF" Index="9" Width="114" IsNewNode="True" />
|
||||
<ColumnInfo Id="TotalBruttoDEV" PropertyName="TotalBruttoDEV" Index="10" Width="113" IsNewNode="True" />
|
||||
<ColumnInfo Id="NAV_transactionId" PropertyName="NAV_transactionId" Width="110" Index="11" IsNewNode="True" />
|
||||
<ColumnInfo Id="NAV_InvoiceStatus" PropertyName="NAV_InvoiceStatus" Width="112" Index="12" IsNewNode="True" />
|
||||
<ColumnInfo Id="NAV_queryDate" PropertyName="NAV_queryDate" Width="97" Index="13" IsNewNode="True" />
|
||||
</Columns>
|
||||
</ListView>
|
||||
<DetailView Id="NAVInvoiceReport_DetailView">
|
||||
<Items>
|
||||
<ActionContainerViewItem Id="@NAVReport" ActionContainer="@NAVReport" IsNewNode="True" />
|
||||
|
||||
@@ -190,15 +190,20 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraReports.v17.2.Extensions, Version=17.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.VisualBasic" />
|
||||
<Reference Include="MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MySql.Data.6.9.9\lib\net40\MySql.Data.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System">
|
||||
<Name>System</Name>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.configuration" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
<Private>False</Private>
|
||||
@@ -270,6 +275,12 @@
|
||||
<Compile Include="Controllers\NavInvoiceReportVC.Designer.cs">
|
||||
<DependentUpon>NavInvoiceReportVC.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controllers\NAV_Online_VC.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controllers\NAV_Online_VC.Designer.cs">
|
||||
<DependentUpon>NAV_Online_VC.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controllers\nopCommerce\nopC_VC.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
@@ -313,6 +324,7 @@
|
||||
<Compile Include="Gantt\GanttTaskDependencies.cs" />
|
||||
<Compile Include="Helpers\BusinessDocumentHelper.cs" />
|
||||
<Compile Include="Helpers\Laravel\StorageTransactions.cs" />
|
||||
<Compile Include="Laravel\Users.cs" />
|
||||
<Compile Include="Module.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
@@ -327,6 +339,7 @@
|
||||
<Compile Include="ReportV2\Report_Invoice.Designer.cs">
|
||||
<DependentUpon>Report_Invoice.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="StaticClass\RestAPI.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="BusinessObjects\Business\BusinessTransactions\Orders\OrderIn\OrderIn_VC.resx">
|
||||
|
||||
@@ -0,0 +1,234 @@
|
||||
using DevExpress.Data.Filtering;
|
||||
using DevExpress.ExpressApp.Xpo;
|
||||
using DevExpress.Persistent.Base;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Nuvolar.Module.StaticClass
|
||||
{
|
||||
/// <summary>
|
||||
/// Laravel RestAPI kezelő osztály
|
||||
/// </summary>
|
||||
public static class RestAPI
|
||||
{
|
||||
private static string _UriBase;
|
||||
private static Dictionary<string, string> _LoginInfo;
|
||||
private static int _StatusCode;
|
||||
private static string _StatusMessage;
|
||||
private static string _ResponseMessage;
|
||||
private static string _API_Token;
|
||||
private static string _GeocodeAPIKey;
|
||||
|
||||
public static int StatusCode
|
||||
{
|
||||
get { return _StatusCode; }
|
||||
}
|
||||
public static string StatusMessage
|
||||
{
|
||||
get { return _StatusMessage; }
|
||||
}
|
||||
public static string ResponseMessage
|
||||
{
|
||||
get { return _ResponseMessage; }
|
||||
}
|
||||
public static void Init(XPObjectSpace _onew)
|
||||
{
|
||||
|
||||
_ResponseMessage = "";
|
||||
_UriBase = ConfigurationManager.AppSettings["Uri"];
|
||||
_GeocodeAPIKey = ConfigurationManager.AppSettings["GeocodeAPIKey"];
|
||||
Laravel.Users _Users = _onew.FindObject<Nuvolar.Module.Laravel.Users>(CriteriaOperator.Parse("email='sysadmin@emango.com'"));
|
||||
if (_Users != null)
|
||||
{
|
||||
if (String.IsNullOrEmpty(_Users.api_token))
|
||||
{
|
||||
|
||||
_LoginInfo = new Dictionary<string, string> { { "email", "sysadmin@emango.com" },
|
||||
{ "password", "SysAdmin" }};
|
||||
|
||||
var json = ExecuteRootePOST("login", false, JsonConvert.SerializeObject(_LoginInfo));
|
||||
|
||||
if (_StatusCode == 200)
|
||||
{
|
||||
var dd = JsonConvert.DeserializeObject(json);
|
||||
var dict = JObject.Parse(json).SelectToken("data").ToObject<Dictionary<string, string>>();
|
||||
_API_Token = dict["api_token"];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_API_Token = _Users.api_token;
|
||||
}
|
||||
}
|
||||
}
|
||||
public static string ExecuteRootePOST(string _RooteString, bool _NeedAuthentication, string _postData)
|
||||
{
|
||||
_StatusCode = 500;
|
||||
_StatusMessage = "Not respond";
|
||||
string json = "";
|
||||
|
||||
|
||||
Tracing.Tracer.LogText(_UriBase + _RooteString);
|
||||
|
||||
var _Uri = new Uri(_UriBase + _RooteString, UriKind.Absolute);
|
||||
var _WebRequest = WebRequest.Create(_Uri);
|
||||
HttpWebRequest _HttpWebRequest = (HttpWebRequest)_WebRequest;
|
||||
|
||||
_HttpWebRequest.Method = "POST";
|
||||
byte[] byteArray = Encoding.UTF8.GetBytes(_postData);
|
||||
|
||||
|
||||
if (_NeedAuthentication)
|
||||
{
|
||||
_HttpWebRequest.PreAuthenticate = true;
|
||||
_HttpWebRequest.Headers.Add("Authorization", "Bearer " + _API_Token);
|
||||
_HttpWebRequest.Headers.Add("cdb", GeneralFunction.GLOBAL_SQLDatabase);
|
||||
}
|
||||
|
||||
_HttpWebRequest.ContentType = "application/json";
|
||||
_HttpWebRequest.Accept = "application/json";
|
||||
_HttpWebRequest.ContentLength = byteArray.Length;
|
||||
Stream _dataStream = _HttpWebRequest.GetRequestStream();
|
||||
_dataStream.Write(byteArray, 0, byteArray.Length);
|
||||
_dataStream.Close();
|
||||
|
||||
try
|
||||
{
|
||||
WebResponse _WebResponse = _WebRequest.GetResponse();
|
||||
_StatusCode = (int)((HttpWebResponse)_WebResponse).StatusCode;
|
||||
_StatusMessage = ((HttpWebResponse)_WebResponse).StatusDescription;
|
||||
var _responseStream = _WebResponse.GetResponseStream();
|
||||
if (_responseStream == null) return json;
|
||||
|
||||
var _StreamReader = new StreamReader(_responseStream, Encoding.Default);
|
||||
json = _StreamReader.ReadToEnd();
|
||||
|
||||
try
|
||||
{
|
||||
_StatusMessage = JsonConvert.DeserializeObject(json).ToString();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
_responseStream.Close();
|
||||
_WebResponse.Close();
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
|
||||
if (ex.Status == WebExceptionStatus.ProtocolError)
|
||||
{
|
||||
var _WebResponse = (HttpWebResponse)ex.Response;
|
||||
_StatusCode = (int)_WebResponse.StatusCode;
|
||||
_StatusMessage = ((HttpWebResponse)_WebResponse).StatusDescription;
|
||||
}
|
||||
}
|
||||
|
||||
return json;
|
||||
|
||||
}
|
||||
public static string ExecuteRooteGET(string _RooteString, bool _NeedAuthentication)
|
||||
{
|
||||
string json = "";
|
||||
|
||||
Tracing.Tracer.LogText(_UriBase + _RooteString);
|
||||
|
||||
var _Uri = new Uri(_UriBase + _RooteString, UriKind.Absolute);
|
||||
var _WebRequest = WebRequest.Create(_Uri);
|
||||
_WebRequest.Method = "GET";
|
||||
|
||||
|
||||
HttpWebRequest _HttpWebRequest = (HttpWebRequest)_WebRequest;
|
||||
if (_NeedAuthentication)
|
||||
{
|
||||
_HttpWebRequest.PreAuthenticate = true;
|
||||
_HttpWebRequest.Headers.Add("Authorization", "Bearer " + _API_Token);
|
||||
_HttpWebRequest.Headers.Add("cdb", GeneralFunction.GLOBAL_SQLDatabase);
|
||||
}
|
||||
|
||||
_HttpWebRequest.Accept = "application/json";
|
||||
_HttpWebRequest.ContentType = "application/json";
|
||||
|
||||
try
|
||||
{
|
||||
WebResponse _WebResponse = _WebRequest.GetResponse();
|
||||
_StatusCode = (int)((HttpWebResponse)_WebResponse).StatusCode;
|
||||
Stream _responseStream = _WebResponse.GetResponseStream();
|
||||
if (_responseStream == null) return json;
|
||||
|
||||
StreamReader _StreamReader = new StreamReader(_responseStream, Encoding.Default);
|
||||
json = _StreamReader.ReadToEnd();
|
||||
|
||||
_responseStream.Close();
|
||||
_WebResponse.Close();
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
|
||||
if (ex.Status == WebExceptionStatus.ProtocolError)
|
||||
{
|
||||
var _WebResponse = (HttpWebResponse)ex.Response;
|
||||
_StatusCode = (int)_WebResponse.StatusCode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return json;
|
||||
}
|
||||
public static string ExecuteGOOGLEMAPSGET(string _RouteString)
|
||||
{
|
||||
string json = "";
|
||||
|
||||
Tracing.Tracer.LogText(_UriBase + _RouteString);
|
||||
|
||||
|
||||
var _Uri = new Uri("https://maps.googleapis.com/maps/api/geocode/json?address=" + _RouteString + "&key=" + _GeocodeAPIKey, UriKind.Absolute);
|
||||
var _WebRequest = WebRequest.Create(_Uri);
|
||||
_WebRequest.Method = "GET";
|
||||
|
||||
|
||||
HttpWebRequest _HttpWebRequest = (HttpWebRequest)_WebRequest;
|
||||
|
||||
_HttpWebRequest.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8";
|
||||
_HttpWebRequest.ContentType = "application/json";
|
||||
_HttpWebRequest.Headers.Add("accept-language", "hu-HU,hu;q=0.9,en-US;q=0.8,en;q=0.7,pt;q=0.6");
|
||||
|
||||
try
|
||||
{
|
||||
WebResponse _WebResponse = _WebRequest.GetResponse();
|
||||
_StatusCode = (int)((HttpWebResponse)_WebResponse).StatusCode;
|
||||
Stream _responseStream = _WebResponse.GetResponseStream();
|
||||
if (_responseStream == null) return json;
|
||||
|
||||
StreamReader _StreamReader = new StreamReader(_responseStream, Encoding.Default);
|
||||
json = _StreamReader.ReadToEnd();
|
||||
|
||||
_responseStream.Close();
|
||||
_WebResponse.Close();
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
|
||||
if (ex.Status == WebExceptionStatus.ProtocolError)
|
||||
{
|
||||
var _WebResponse = (HttpWebResponse)ex.Response;
|
||||
_StatusCode = (int)_WebResponse.StatusCode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return json;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MySql.Data" version="6.9.9" targetFramework="net40" />
|
||||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net40" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user