First create solution
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{1FC602BC-73FF-4EC9-99A9-4D43FC7DC90C}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Nuvolar.Scanner.Module.CSharp</RootNamespace>
|
||||
<AssemblyName>Nuvolar.Scanner.Module.CSharp</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DevExpress.Data.v16.2, Version=16.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Persistent.Base.v16.2, Version=16.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Persistent.BaseImpl.v16.2, Version=16.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpo.v16.2, Version=16.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ScannerModule.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SimpleAnswer.cs" />
|
||||
<Compile Include="SimpleQuery.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="StoredProcedures.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Nuvolar.Module\Nuvolar.Module.vbproj">
|
||||
<Project>{60bf693f-7dea-4cf6-85bd-ea96829d79dd}</Project>
|
||||
<Name>Nuvolar.Module</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Nuvolar.Scanner.Module.CSharp")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Nuvolar.Scanner.Module.CSharp")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("1fc602bc-73ff-4ec9-99a9-4d43fc7dc90c")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,435 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System.Configuration;
|
||||
using Nuvolar.Module;
|
||||
using DevExpress.Xpo;
|
||||
using DevExpress.Data.Filtering;
|
||||
using DevExpress.Persistent.Base;
|
||||
using DevExpress.Xpo.DB;
|
||||
using DevExpress.Persistent.BaseImpl;
|
||||
using System.IO;
|
||||
|
||||
namespace Nuvolar.Scanner.Module.CSharp
|
||||
{
|
||||
public class ScannerModule
|
||||
{
|
||||
private DevExpress.Xpo.Session _session;
|
||||
public ScannerModule()
|
||||
{
|
||||
_session = new DevExpress.Xpo.Session();
|
||||
_session.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
|
||||
_session.AutoCreateOption = DevExpress.Xpo.DB.AutoCreateOption.SchemaAlreadyExists;
|
||||
}
|
||||
public String GetInfo(String I)
|
||||
{
|
||||
SimpleAnswer _SimpleAnswer = new SimpleAnswer();
|
||||
SimpleQuery _SimpleQuery = JsonConvert.DeserializeObject<SimpleQuery>(I);
|
||||
|
||||
if (_SimpleQuery.Query == "DX_Login")
|
||||
{
|
||||
if (this.DX_Login(_SimpleQuery.UserName, _SimpleQuery.Password, _SimpleQuery.Database))
|
||||
{
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = "OK";
|
||||
}
|
||||
}
|
||||
if (_SimpleQuery.Query == "DX_GetStoragePDACollectionHeader_dxList")
|
||||
{
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = this.DX_GetStoragePDACollectionHeader_dxList(_SimpleQuery.Database);
|
||||
}
|
||||
if (_SimpleQuery.Query == "DX_GetStorageLocationFoldSelect_dxList")
|
||||
{
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = this.DX_GetStorageLocationFoldSelect_dxList(_SimpleQuery.Database);
|
||||
}
|
||||
|
||||
if (_SimpleQuery.Query == "DX_GetStorageOutHeader_dxList")
|
||||
{
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = this.DX_GetStorageOutHeader_dxList(_SimpleQuery.Database);
|
||||
}
|
||||
if (_SimpleQuery.Query.Contains("DX_GetStoragePDACollectionRows_dxDataGrid"))
|
||||
{
|
||||
string[] _sArray = _SimpleQuery.Query.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = this.DX_GetStoragePDACollectionRows_dxDataGrid(Guid.Parse(_sArray[1]), _SimpleQuery.Database);
|
||||
}
|
||||
if (_SimpleQuery.Query.Contains("DX_GetProductsInfo_Picture"))
|
||||
{
|
||||
string[] _sArray = _SimpleQuery.Query.Split(new string[]{";"},StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = this.DX_GetProductsInfo_Picture(_sArray[1], _SimpleQuery.Database);
|
||||
}
|
||||
if (_SimpleQuery.Query.Contains("DX_GetProductsInfo_dxDatagrid"))
|
||||
{
|
||||
string[] _sArray = _SimpleQuery.Query.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = this.DX_GetProductsInfo_dxDatagrid(_sArray[1], _SimpleQuery.Database);
|
||||
}
|
||||
if (_SimpleQuery.Query.Contains("DX_GetDiscountInfo_dxDatagrid"))
|
||||
{
|
||||
string[] _sArray = _SimpleQuery.Query.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = this.DX_GetDiscountInfo_dxDatagrid(_sArray[1], _SimpleQuery.Database);
|
||||
}
|
||||
if (_SimpleQuery.Query.Contains("DX_InsertStoragePDACollectionRows_dxDataGrid"))
|
||||
{
|
||||
string[] _sArray = _SimpleQuery.Query.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = this.DX_InsertStoragePDACollectionRows_dxDataGrid(_sArray[1], Guid.Parse(_sArray[2]), int.Parse(_sArray[3]), _SimpleQuery.Database);
|
||||
}
|
||||
if (_SimpleQuery.Query.Contains("DX_InsertStorageLocationFold_dxDataGrid"))
|
||||
{
|
||||
string[] _sArray = _SimpleQuery.Query.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = this.DX_InsertStorageLocationFold_dxDataGrid(_sArray[1], Guid.Parse(_sArray[2]),int.Parse(_sArray[3]),_sArray[4], _SimpleQuery.Database);
|
||||
}
|
||||
|
||||
if (_SimpleQuery.Query.Contains("DX_DeleteStoragePDACollectionRows_dxDataGrid"))
|
||||
{
|
||||
string[] _sArray = _SimpleQuery.Query.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = this.DX_DeleteStoragePDACollectionRows_dxDataGrid(Guid.Parse(_sArray[1]), _SimpleQuery.Database);
|
||||
}
|
||||
if (_SimpleQuery.Query.Contains("DX_InsertDiscount_dxDataGrid"))
|
||||
{
|
||||
string[] _sArray = _SimpleQuery.Query.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = this.DX_InsertDiscount_dxDataGrid(_sArray[1], int.Parse(_sArray[2]), _sArray[3], _sArray[4], _SimpleQuery.Database);
|
||||
}
|
||||
|
||||
if (_SimpleQuery.Query.Contains("DX_InsertStorageOutRows_dxDataGrid"))
|
||||
{
|
||||
string[] _sArray = _SimpleQuery.Query.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = this.DX_InsertStorageOutRows_dxDataGrid(_sArray[1], Guid.Parse(_sArray[2]), int.Parse(_sArray[3]), _SimpleQuery.Database);
|
||||
}
|
||||
if (_SimpleQuery.Query.Contains("DX_GetStorageOutRows_dxDataGrid"))
|
||||
{
|
||||
string[] _sArray = _SimpleQuery.Query.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = this.DX_GetStorageOutRows_dxDataGrid(Guid.Parse(_sArray[1]), _SimpleQuery.Database);
|
||||
}
|
||||
if (_SimpleQuery.Query.Contains("DX_DeleteStorageOutRows_dxDataGrid"))
|
||||
{
|
||||
string[] _sArray = _SimpleQuery.Query.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
_SimpleAnswer.ResultStatus = 1;
|
||||
_SimpleAnswer.Result = "OK";
|
||||
this.DX_DeleteStorageOutRows_dxDataGrid(Guid.Parse(_sArray[1]), _SimpleQuery.Database);
|
||||
|
||||
}
|
||||
return JsonConvert.SerializeObject(_SimpleAnswer);
|
||||
}
|
||||
|
||||
private string DX_InsertStorageLocationFold_dxDataGrid(string BarcodeProducts, Guid _StoragePDACollectionHeaderGUID, double _QTT, string BarcodeLocations,string _SQLDatabase)
|
||||
{
|
||||
BarcodeProducts = BarcodeProducts.ToString().Replace("ö", "0");
|
||||
if (_session.IsConnected == true) { _session.Disconnect(); }
|
||||
_session.Connect();
|
||||
if (_session.IsConnected == true)
|
||||
{
|
||||
ProductsBarcodes _ProductsBarcodes = _session.FindObject<ProductsBarcodes>(CriteriaOperator.Parse("Barcode=?", BarcodeProducts));
|
||||
if (_ProductsBarcodes != null)
|
||||
{
|
||||
StorageLocation _StorageLocation = _session.FindObject<StorageLocation>(CriteriaOperator.Parse("Barcode=?", BarcodeLocations));
|
||||
if (_StorageLocation!=null)
|
||||
{
|
||||
StoragePDACollectionHeader _StoragePDACollectionHeader = _session.GetObjectByKey<StoragePDACollectionHeader>(_StoragePDACollectionHeaderGUID);
|
||||
if (_StoragePDACollectionHeader!=null)
|
||||
{
|
||||
//Először azokat a sorokat kell megkeresni, ahol nincs lokáció és ez az aktuális vonalkód
|
||||
|
||||
foreach (StoragePDACollectionRows _StoragePDACollectionRows in _StoragePDACollectionHeader.StoragePDACollectionRows)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return this.DX_GetStoragePDACollectionRows_dxDataGrid(_StoragePDACollectionHeaderGUID, _SQLDatabase);
|
||||
}
|
||||
private string DX_GetStorageLocationFoldSelect_dxList(string database)
|
||||
{
|
||||
String _Result = null;
|
||||
if (_session.IsConnected == true) { _session.Disconnect(); }
|
||||
_session.Connect();
|
||||
if (_session.IsConnected == true)
|
||||
{
|
||||
XPCollection<StoragePDACollectionHeader> _StoragePDACollectionHeader_Collection = new XPCollection<StoragePDACollectionHeader>(_session,
|
||||
CriteriaOperator.Parse("StoragePDACollectionHeaderStatus=0 and StorageCollectionType=1"));
|
||||
if (_StoragePDACollectionHeader_Collection.Count > 0)
|
||||
{
|
||||
_Result = "[";
|
||||
foreach (StoragePDACollectionHeader _StoragePDACollectionHeader in _StoragePDACollectionHeader_Collection)
|
||||
{
|
||||
if (_Result == "[")
|
||||
{
|
||||
_Result += string.Format("{{ 'key': '{0}', 'title': '{1}'}}", _StoragePDACollectionHeader.Oid.ToString(), _StoragePDACollectionHeader.DocumentNumber);
|
||||
}
|
||||
else
|
||||
{
|
||||
_Result += string.Format(",{{ 'key': '{0}', 'title': '{1}'}}", _StoragePDACollectionHeader.Oid.ToString(), _StoragePDACollectionHeader.DocumentNumber);
|
||||
}
|
||||
}
|
||||
_Result += "]";
|
||||
}
|
||||
}
|
||||
if (_Result != null)
|
||||
{
|
||||
_Result = _Result.Replace("'", ((char)34).ToString());
|
||||
}
|
||||
return _Result;
|
||||
}
|
||||
|
||||
private void DX_DeleteStorageOutRows_dxDataGrid(Guid guid, string database)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
private string DX_GetStorageOutRows_dxDataGrid(Guid guid, string database)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
private string DX_InsertStorageOutRows_dxDataGrid(string v, Guid guid, object p, string database)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
private string DX_InsertDiscount_dxDataGrid(string v1, object p, string v2, string v3, string database)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#region StoragePDACollection
|
||||
private string DX_GetStoragePDACollectionHeader_dxList(string database)
|
||||
{
|
||||
String _Result = null;
|
||||
if (_session.IsConnected == true) { _session.Disconnect(); }
|
||||
_session.Connect();
|
||||
if (_session.IsConnected == true)
|
||||
{
|
||||
XPCollection<StoragePDACollectionHeader> _StoragePDACollectionHeader_Collection = new XPCollection<StoragePDACollectionHeader>(_session, CriteriaOperator.Parse("StoragePDACollectionHeaderStatus=0"));
|
||||
if (_StoragePDACollectionHeader_Collection.Count > 0)
|
||||
{
|
||||
_Result = "[";
|
||||
foreach (StoragePDACollectionHeader _StoragePDACollectionHeader in _StoragePDACollectionHeader_Collection)
|
||||
{
|
||||
if (_Result == "[")
|
||||
{
|
||||
_Result += string.Format("{{ 'key': '{0}', 'title': '{1}'}}", _StoragePDACollectionHeader.Oid.ToString(), _StoragePDACollectionHeader.DocumentNumber);
|
||||
}
|
||||
else
|
||||
{
|
||||
_Result += string.Format(",{{ 'key': '{0}', 'title': '{1}'}}", _StoragePDACollectionHeader.Oid.ToString(), _StoragePDACollectionHeader.DocumentNumber);
|
||||
}
|
||||
}
|
||||
_Result += "]";
|
||||
}
|
||||
}
|
||||
if (_Result != null)
|
||||
{
|
||||
_Result = _Result.Replace("'", ((char)34).ToString());
|
||||
}
|
||||
return _Result;
|
||||
}
|
||||
private string DX_InsertStoragePDACollectionRows_dxDataGrid(string _Barcode, Guid _StoragePDACollectionHeader, double _QTT, string _SQLDatabase)
|
||||
{
|
||||
_Barcode = _Barcode.ToString().Replace("ö", "0");
|
||||
if (_session.IsConnected == true) { _session.Disconnect(); }
|
||||
_session.Connect();
|
||||
if (_session.IsConnected == true)
|
||||
{
|
||||
ProductsBarcodes _ProductsBarcodes = _session.FindObject<ProductsBarcodes>(CriteriaOperator.Parse("Barcode=?", _Barcode));
|
||||
if (_ProductsBarcodes != null)
|
||||
{
|
||||
StoragePDACollectionRows _StoragePDACollectionRows = new StoragePDACollectionRows(_session);
|
||||
_StoragePDACollectionRows.StoragePDACollectionHeader = _session.GetObjectByKey<StoragePDACollectionHeader>(_StoragePDACollectionHeader);
|
||||
_StoragePDACollectionRows.Barcode = _Barcode;
|
||||
_StoragePDACollectionRows.Products = _ProductsBarcodes.Products;
|
||||
_StoragePDACollectionRows.QTT = _QTT;
|
||||
_StoragePDACollectionRows.Save();
|
||||
}
|
||||
}
|
||||
return this.DX_GetStoragePDACollectionRows_dxDataGrid(_StoragePDACollectionHeader, _SQLDatabase);
|
||||
}
|
||||
private string DX_DeleteStoragePDACollectionRows_dxDataGrid(Guid _StoragePDACollectionRows, string _SQLDatabase)
|
||||
{
|
||||
StoragePDACollectionHeader _StoragePDACollectionHeader = null;
|
||||
if (_session.IsConnected == true) { _session.Disconnect(); }
|
||||
_session.Connect();
|
||||
if (_session.IsConnected == true)
|
||||
{
|
||||
StoragePDACollectionRows _StoragePDACollectionRowsC = _session.FindObject<StoragePDACollectionRows>(CriteriaOperator.Parse("Oid=?", _StoragePDACollectionRows));
|
||||
if (_StoragePDACollectionRowsC!=null)
|
||||
{
|
||||
_StoragePDACollectionHeader = _StoragePDACollectionRowsC.StoragePDACollectionHeader;
|
||||
}
|
||||
_session.Delete(_session.FindObject<StoragePDACollectionRows>(CriteriaOperator.Parse("Oid=?", _StoragePDACollectionRows)));
|
||||
}
|
||||
if (_StoragePDACollectionHeader == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.DX_GetStoragePDACollectionRows_dxDataGrid(_StoragePDACollectionHeader.Oid, _SQLDatabase);
|
||||
}
|
||||
|
||||
}
|
||||
private string DX_GetStoragePDACollectionRows_dxDataGrid(Guid guid, string database)
|
||||
{
|
||||
String _Result = null;
|
||||
if (_session.IsConnected == true) { _session.Disconnect(); }
|
||||
_session.Connect();
|
||||
if (_session.IsConnected == true)
|
||||
{
|
||||
XPCollection<StoragePDACollectionRows> _StoragePDACollectionRows_Collection = new XPCollection<StoragePDACollectionRows>(_session,
|
||||
CriteriaOperator.Parse("StoragePDACollectionHeader.Oid=?", guid));
|
||||
if (_StoragePDACollectionRows_Collection.Count > 0)
|
||||
{
|
||||
_Result = "[";
|
||||
foreach (StoragePDACollectionRows _StoragePDACollectionRows in _StoragePDACollectionRows_Collection)
|
||||
{
|
||||
if (_Result == "[")
|
||||
{
|
||||
_Result += string.Format("{{ 'Oid': '{0}', 'Barcode': '{1}','ShortName': '{2}','QTT': '{3}','RowIndex': '{4}' }}",
|
||||
_StoragePDACollectionRows.Oid.ToString(), _StoragePDACollectionRows.Barcode, _StoragePDACollectionRows.Products.ShortName, _StoragePDACollectionRows.QTT, _StoragePDACollectionRows.RowIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
_Result += string.Format(",{{ 'Oid': '{0}', 'Barcode': '{1}','ShortName': '{2}','QTT': '{3}','RowIndex': '{4}' }}",
|
||||
_StoragePDACollectionRows.Oid.ToString(), _StoragePDACollectionRows.Barcode, _StoragePDACollectionRows.Products.ShortName, _StoragePDACollectionRows.QTT, _StoragePDACollectionRows.RowIndex);
|
||||
}
|
||||
}
|
||||
_Result += "]";
|
||||
}
|
||||
}
|
||||
if (_Result != null)
|
||||
{
|
||||
_Result = _Result.Replace("'", ((char)34).ToString());
|
||||
}
|
||||
return _Result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
private string DX_GetDiscountInfo_dxDatagrid(string v, string database)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private string DX_GetProductsInfo_Picture(string _Barcode, string _Database)
|
||||
{
|
||||
string _ProductPicture = "";
|
||||
ProductsBarcodes _ProductsBarcode = _session.FindObject<ProductsBarcodes>(CriteriaOperator.Parse("Barcode=?", _Barcode));
|
||||
if (_ProductsBarcode!=null)
|
||||
{
|
||||
if (_ProductsBarcode.Products.Picture_FullSize!=null)
|
||||
{
|
||||
MemoryStream _MemoryStream = new MemoryStream();
|
||||
_ProductsBarcode.Products.Picture_FullSize.Save(_MemoryStream, System.Drawing.Imaging.ImageFormat.Png);
|
||||
_ProductPicture= System.Convert.ToBase64String(_MemoryStream.ToArray());
|
||||
}
|
||||
}
|
||||
return _ProductPicture;
|
||||
}
|
||||
private string DX_GetProductsInfo_dxDatagrid(object p, string database)
|
||||
{
|
||||
p = p.ToString().Replace("ö", "0");
|
||||
String _Result = string.Format("[{{ 'Oid': '{0}', 'ShortName': '<NINCS>', 'Value': '<NINCS>'}}]", Guid.NewGuid().ToString());
|
||||
if (_session.IsConnected == true) { _session.Disconnect(); }
|
||||
_session.Connect();
|
||||
if (_session.IsConnected == true)
|
||||
{
|
||||
Products _Products=_session.FindObject<Products>(CriteriaOperator.Parse("Barcode=?", p));
|
||||
if (_Products == null)
|
||||
{
|
||||
ProductsBarcodes _ProductsBarcodes= _session.FindObject<ProductsBarcodes>(CriteriaOperator.Parse("Barcode=?", p));
|
||||
if (_ProductsBarcodes == null)
|
||||
{
|
||||
_Products = _session.FindObject<Products>(CriteriaOperator.Parse("ProductNumber = ?", p));
|
||||
if (_Products == null)
|
||||
{
|
||||
//_Products = _session.FindObject<Products>(CriteriaOperator.Parse(string.Format("ShortName LIKE '%{0}%'", p)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_Products = _ProductsBarcodes.Products;
|
||||
}
|
||||
}
|
||||
if (_Products!=null)
|
||||
{
|
||||
_Result = "[";
|
||||
_Result += string.Format("{{ 'Oid': '{0}', 'ShortName': 'Cikkszám', 'Value': '{1}' }},", Guid.NewGuid().ToString(),_Products.ProductNumber);
|
||||
_Result += string.Format("{{ 'Oid': '{0}', 'ShortName': 'Megnevezés', 'Value': '{1}' }},", Guid.NewGuid().ToString(),_Products.ShortName);
|
||||
_Result += string.Format("{{ 'Oid': '{0}', 'ShortName': 'Ár', 'Value': '{1}' }}", Guid.NewGuid().ToString(), _Products.ListPriceOutHUF.ToString());
|
||||
/*_Result += string.Format("{ 'Oid': '{0}', 'ShortName': 'Ár', 'Value': '' + @PriceBruttoHUF + '' },", Guid.NewGuid().ToString());
|
||||
_Result += string.Format("{ 'Oid': '{0}', 'ShortName': 'Érvényes (tól)', 'Value': '' + @ActualDate + '' },", Guid.NewGuid().ToString());
|
||||
_Result += string.Format("{ 'Oid': '{0}', 'ShortName': 'Érvényes (ig)', 'Value': '' + @ExpirationDate + '' },", Guid.NewGuid().ToString());
|
||||
_Result += string.Format("{ 'Oid': '{0}', 'ShortName': 'Akciós?', 'Value': '' + @IsAction + '' },", Guid.NewGuid().ToString());
|
||||
_Result += string.Format("{ 'Oid': '{0}', 'ShortName': 'Árutasítás', 'Value': '' + @PricingCodeDescription + '' },", Guid.NewGuid().ToString());*/
|
||||
_Result += "]";
|
||||
}
|
||||
}
|
||||
_Result= _Result.Replace("'", ((char)34).ToString());
|
||||
return _Result;
|
||||
}
|
||||
private string DX_GetStorageOutHeader_dxList(string database)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
private bool DX_Login(string _UserName, string _Password, string database)
|
||||
{
|
||||
bool _Result=false;
|
||||
if (_session.IsConnected == true) { _session.Disconnect(); }
|
||||
_session.Connect();
|
||||
if (_session.IsConnected == true)
|
||||
{
|
||||
User _User = _session.FindObject<User>(CriteriaOperator.Parse("UserName=?", _UserName));
|
||||
if (_User != null)
|
||||
{
|
||||
if (_User.ComparePassword(_Password) == true)
|
||||
{
|
||||
_Result = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return _Result;
|
||||
}
|
||||
private string DX_GetCustomersFrom_dxSelectBox()
|
||||
{
|
||||
String _Result = "";
|
||||
if (_session.IsConnected == true) { _session.Disconnect(); }
|
||||
_session.Connect();
|
||||
if (_session.IsConnected == true)
|
||||
{
|
||||
XPCollection<CustomersFrom> _XPCollection_CustomersFrom=new XPCollection<CustomersFrom>(CriteriaOperator.Parse("1=1"));
|
||||
_XPCollection_CustomersFrom.Sorting.Add(new SortProperty("FullName",DevExpress.Xpo.DB.SortingDirection.Ascending));
|
||||
if (_XPCollection_CustomersFrom.Count>0)
|
||||
{
|
||||
_Result = "[";
|
||||
foreach (CustomersFrom _CustomersFrom in _XPCollection_CustomersFrom)
|
||||
{
|
||||
if (_Result == "[")
|
||||
{
|
||||
_Result += string.Format("'{0}'", _CustomersFrom.FullName);
|
||||
}
|
||||
else
|
||||
{
|
||||
_Result += string.Format(",'{0}'", _CustomersFrom.FullName);
|
||||
}
|
||||
}
|
||||
_Result += "]";
|
||||
}
|
||||
else
|
||||
{
|
||||
_Result = "['<NINCS>']";
|
||||
}
|
||||
}
|
||||
return _Result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Nuvolar.Scanner.Module.CSharp
|
||||
{
|
||||
public class SimpleAnswer
|
||||
{
|
||||
public long ResultStatus { get; set; }
|
||||
//0: HIBA, 1: LEFUTOTT AZ SP
|
||||
public string Result { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Nuvolar.Scanner.Module.CSharp
|
||||
{
|
||||
public class SimpleQuery
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public string Password { get; set; }
|
||||
public string Database { get; set; }
|
||||
public string Query { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,678 @@
|
||||
CREATE procedure [dbo].[DX_DeleteStorageOutRows_dxDataGrid]
|
||||
@StorageOutRows uniqueidentifier
|
||||
as
|
||||
begin
|
||||
set nocount on
|
||||
set xact_abort on
|
||||
|
||||
declare @Ok int
|
||||
declare @ErrorNumber int
|
||||
|
||||
exec [dbo].[sp_AddToTableD_StorageOut] @StorageOutRows=@StorageOutRows, @User=null, @Ok=@Ok output, @ErrorNumber=@ErrorNumber
|
||||
end
|
||||
|
||||
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[DX_DeleteStoragePDACollectionRows_dxDataGrid] Script Date: 2015.11.18. 20:24:07 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
-- =============================================
|
||||
-- Author : Ivan.Szabo
|
||||
-- Create date: 2015-09-10
|
||||
-- Modified on: 2015-09-10
|
||||
-- Version : 1.0.1001
|
||||
-- Description: PDA kollekció sort töröl
|
||||
-- =============================================
|
||||
CREATE procedure [dbo].[DX_DeleteStoragePDACollectionRows_dxDataGrid]
|
||||
@StoragePDACollectionRows uniqueidentifier
|
||||
as
|
||||
begin
|
||||
set nocount on
|
||||
set xact_abort on
|
||||
|
||||
delete from [dbo].[StoragePDACollectionRows] where Oid=@StoragePDACollectionRows
|
||||
|
||||
end
|
||||
|
||||
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[DX_GetDiscountInfo_dxDatagrid] Script Date: 2015.11.18. 20:24:07 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
-- =============================================
|
||||
-- Author: Ivan.Szabo
|
||||
-- Create date: 2015-09-10
|
||||
-- Modified on: 2015-09-23
|
||||
-- Description: Visszatér az érvényes leértékelési sorokkal
|
||||
-- =============================================
|
||||
CREATE procedure [dbo].[DX_GetDiscountInfo_dxDatagrid]
|
||||
@Barcode nvarchar(50),
|
||||
@Result nvarchar(max) output
|
||||
as
|
||||
begin
|
||||
declare @ResultLocal nvarchar(max)
|
||||
declare @Products uniqueidentifier
|
||||
|
||||
declare @Oid nvarchar(50)
|
||||
declare @PriceBruttoHUF nvarchar(50)
|
||||
declare @ExpirationDate nvarchar(50)
|
||||
|
||||
select @Products=Products from pcs_whs.dbo.ProductsBarcodes where Barcode=@Barcode
|
||||
|
||||
if @Products is not null
|
||||
begin
|
||||
set @ResultLocal='['
|
||||
|
||||
declare CCF cursor local fast_forward for
|
||||
select convert(nvarchar(50),Oid),
|
||||
Barcode,
|
||||
convert(nvarchar(50),round(PriceBruttoHUF,0)),
|
||||
convert(nvarchar(50),ExpirationDate,111)
|
||||
from PricingProductsBarcodeCustomers t1
|
||||
where t1.Products=@Products and t1.Barcode like '99%' and t1.ExpirationDate>getdate()
|
||||
order by t1.ActualDate desc
|
||||
|
||||
|
||||
|
||||
open CCF
|
||||
fetch next from CCF into @Oid,@Barcode,@PriceBruttoHUF,@ExpirationDate
|
||||
while @@FETCH_STATUS=0
|
||||
begin
|
||||
if @ResultLocal='['
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+'{ "Oid": "'+@Oid+'", "Barcode": "'+@Barcode+'", "PriceBruttoHUF": "'+@PriceBruttoHUF+'", "ExpirationDate": "'+@ExpirationDate+'" }'
|
||||
end
|
||||
else
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+',{ "Oid": "'+@Oid+'", "Barcode": "'+@Barcode+'", "PriceBruttoHUF": "'+@PriceBruttoHUF+'", "ExpirationDate": "'+@ExpirationDate+'" }'
|
||||
end
|
||||
fetch next from CCF into @Oid,@Barcode,@PriceBruttoHUF,@ExpirationDate
|
||||
end
|
||||
close CCF
|
||||
deallocate CCF
|
||||
set @ResultLocal = @ResultLocal+']'
|
||||
|
||||
end
|
||||
set @Result=@ResultLocal
|
||||
end
|
||||
|
||||
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[DX_GetProductsInfo_dxDatagrid] Script Date: 2015.11.18. 20:24:07 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
-- =============================================
|
||||
-- Author : Ivan.Szabo
|
||||
-- Create date: 2015-09-10
|
||||
-- Modified on: 2015-09-10
|
||||
-- Version : 1.0.1001
|
||||
-- Description: Termék információ
|
||||
-- =============================================
|
||||
CREATE procedure [dbo].[DX_GetProductsInfo_dxDatagrid]
|
||||
@Barcode nvarchar(50),
|
||||
@Result nvarchar(max) output
|
||||
as
|
||||
begin
|
||||
set nocount on
|
||||
|
||||
declare @ResultLocal nvarchar(max)
|
||||
|
||||
declare @ProductNumber nvarchar(50)
|
||||
declare @ShortName nvarchar(255)
|
||||
declare @PriceBruttoHUF nvarchar(50)
|
||||
declare @UnitName nvarchar(50)
|
||||
declare @ActualDate nvarchar(50)
|
||||
declare @ExpirationDate nvarchar(50)
|
||||
declare @IsAction nvarchar(50)
|
||||
declare @PricingCodeDescription nvarchar(255)
|
||||
declare @QTTFree nvarchar(50)
|
||||
declare @Products uniqueidentifier
|
||||
|
||||
set @ResultLocal='['
|
||||
|
||||
select top 1 @ProductNumber=t2.ProductNumber,
|
||||
@Products=t2.Oid,
|
||||
@ShortName=t2.ShortName,
|
||||
@PriceBruttoHUF=convert(nvarchar(50),round(t1.[PriceBruttoHUF],0)),
|
||||
@UnitName=t3.ShortName,
|
||||
@ActualDate=replace(convert(nvarchar(10),t1.ActualDate,111),'/','-'),
|
||||
@ExpirationDate=replace(convert(nvarchar(10),t1.ExpirationDate,111),'/','-'),
|
||||
@IsAction=case when t1.IsAction=1 then 'Igen' else 'Nem' end,
|
||||
@PricingCodeDescription=t1.PricingCodeDescription
|
||||
from [dbo].[PricingProductsBarcodeCustomers] t1 join pcs_whs.dbo.Products t2 on
|
||||
t1.Products=t2.Oid left join pcs_whs.dbo.Units t3 on
|
||||
t2.Units=t3.Oid
|
||||
where t1.Barcode=@Barcode and t1.ExpirationDate>getdate() and t1.ActualDate<getdate()
|
||||
|
||||
order by t1.IsAction desc,t1.ActualDate desc
|
||||
|
||||
if @ProductNumber is not null
|
||||
begin
|
||||
|
||||
set @ResultLocal = @ResultLocal+'{ "Oid": "'+convert(nvarchar(50),NEWID())+'", "ShortName": "Cikkszám", "Value": "'+@ProductNumber+'" },'
|
||||
set @ResultLocal = @ResultLocal+'{ "Oid": "'+convert(nvarchar(50),NEWID())+'", "ShortName": "Megnevezés", "Value": "'+@ShortName+'" },'
|
||||
set @ResultLocal = @ResultLocal+'{ "Oid": "'+convert(nvarchar(50),NEWID())+'", "ShortName": "Ár", "Value": "'+@PriceBruttoHUF+'" },'
|
||||
set @ResultLocal = @ResultLocal+'{ "Oid": "'+convert(nvarchar(50),NEWID())+'", "ShortName": "Érvényes (tól)", "Value": "'+@ActualDate+'" },'
|
||||
set @ResultLocal = @ResultLocal+'{ "Oid": "'+convert(nvarchar(50),NEWID())+'", "ShortName": "Érvényes (ig)", "Value": "'+@ExpirationDate+'" },'
|
||||
set @ResultLocal = @ResultLocal+'{ "Oid": "'+convert(nvarchar(50),NEWID())+'", "ShortName": "Akciós?", "Value": "'+@IsAction+'" },'
|
||||
set @ResultLocal = @ResultLocal+'{ "Oid": "'+convert(nvarchar(50),NEWID())+'", "ShortName": "Árutasítás", "Value": "'+@PricingCodeDescription+'" },'
|
||||
|
||||
set @QTTFree='0.00'
|
||||
select @QTTFree=convert(nvarchar(50),round(QTTFree,2))
|
||||
from StorageComputed
|
||||
where Products=@Products
|
||||
|
||||
set @ResultLocal = @ResultLocal+'{ "Oid": "'+convert(nvarchar(50),NEWID())+'", "ShortName": "Készlet", "Value": "'+@QTTFree+' / '+@UnitName+'" }'
|
||||
|
||||
end
|
||||
else
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+'{ "Oid": "'+convert(nvarchar(50),NEWID())+'", "ShortName": "<NINCS>", "Value": "<NINCS>" }'
|
||||
end
|
||||
set @ResultLocal = @ResultLocal+']'
|
||||
set @Result=@ResultLocal
|
||||
end
|
||||
|
||||
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[DX_GetStorageInHeader_dxList] Script Date: 2015.11.18. 20:24:07 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- =============================================
|
||||
-- Author: Ivan.Szabo
|
||||
-- Create date: 2015-09-10
|
||||
-- Modified on: 2015-09-10
|
||||
-- Description: Adott adatbázisban a nyitott betárolásokat hozza fel
|
||||
-- =============================================
|
||||
create procedure [dbo].[DX_GetStorageInHeader_dxList]
|
||||
@Result nvarchar(max) output
|
||||
AS
|
||||
Begin
|
||||
set nocount on
|
||||
declare @ResultLocal nvarchar(max)
|
||||
declare @DocumentNumber nvarchar(50)
|
||||
declare @Oid nvarchar(50)
|
||||
set @ResultLocal='['
|
||||
|
||||
declare CCF cursor local fast_forward for
|
||||
select convert(nvarchar(50),t1.Oid),t1.DocumentNumber
|
||||
from StorageInHeader t1
|
||||
where t1.IsEditable=1 and t1.GCRecord is null and ltrim(rtrim(isnull(t1.DocumentNumber,'')))<>''
|
||||
|
||||
order by t1.DocumentNumber
|
||||
open CCF
|
||||
fetch next from CCF into @Oid,@DocumentNumber
|
||||
while @@FETCH_STATUS=0
|
||||
begin
|
||||
if @ResultLocal='['
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+'{"key":"'+@Oid+'", "title" : "'+@DocumentNumber+'"}'
|
||||
end
|
||||
else
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+',{"key":"'+@Oid+'", "title" : "'+@DocumentNumber+'"}'
|
||||
end
|
||||
fetch next from CCF into @Oid,@DocumentNumber
|
||||
end
|
||||
close CCF
|
||||
deallocate CCF
|
||||
set @ResultLocal = @ResultLocal+']'
|
||||
|
||||
set @Result=@ResultLocal
|
||||
end
|
||||
|
||||
|
||||
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[DX_GetStorageOutHeader_dxList] Script Date: 2015.11.18. 20:24:07 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- =============================================
|
||||
-- Author : Ivan.Szabo
|
||||
-- Create date: 2015-09-10
|
||||
-- Modified on: 2015-09-23
|
||||
-- Description: Adott adatbázisban a nyitott kitárolásokat hozza fel
|
||||
-- Version : 1.0.1002
|
||||
-- =============================================
|
||||
CREATE procedure [dbo].[DX_GetStorageOutHeader_dxList]
|
||||
@Result nvarchar(max) output
|
||||
AS
|
||||
Begin
|
||||
set nocount on
|
||||
declare @ResultLocal nvarchar(max)
|
||||
declare @DocumentNumber nvarchar(50)
|
||||
declare @GroupName nvarchar(50)
|
||||
declare @Oid nvarchar(50)
|
||||
declare @CustomerName nvarchar(50)
|
||||
set @ResultLocal='['
|
||||
|
||||
declare CCF cursor local fast_forward for
|
||||
select convert(nvarchar(50),t1.Oid),t1.DocumentNumber,
|
||||
case when t2.MoveType=0 then 'É'
|
||||
when t2.MoveType=3 then 'L'
|
||||
when t2.MoveType=4 then 'S'
|
||||
when t2.MoveType=10 then 'B'
|
||||
when t2.MoveType=9 then 'V'
|
||||
end,
|
||||
isnull(t3.FullName,'')
|
||||
from StorageOutHeader t1 join [dbo].[StorageMoveType] t2 on
|
||||
t1.StorageMoveType=t2.Oid left join Organization t3 on
|
||||
t1.Customers=t3.Oid
|
||||
where t1.IsEditable=1 and t1.GCRecord is null and ltrim(rtrim(isnull(t1.DocumentNumber,'')))<>'' and t2.MoveType in (0,3,4,10,9)
|
||||
|
||||
order by t1.DocumentNumber
|
||||
open CCF
|
||||
fetch next from CCF into @Oid,@DocumentNumber,@GroupName,@CustomerName
|
||||
while @@FETCH_STATUS=0
|
||||
begin
|
||||
if @ResultLocal='['
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+'{"key":"'+@Oid+'", "title" : "'+@DocumentNumber+'","group" : "'+@GroupName+'","customername" : "'+@CustomerName+'"}'
|
||||
end
|
||||
else
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+',{"key":"'+@Oid+'", "title" : "'+@DocumentNumber+'","group" : "'+@GroupName+'","customername" : "'+@CustomerName+'"}'
|
||||
end
|
||||
fetch next from CCF into @Oid,@DocumentNumber,@GroupName,@CustomerName
|
||||
end
|
||||
close CCF
|
||||
deallocate CCF
|
||||
set @ResultLocal = @ResultLocal+']'
|
||||
|
||||
set @Result=@ResultLocal
|
||||
end
|
||||
|
||||
|
||||
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[DX_GetStorageOutRows_dxDataGrid] Script Date: 2015.11.18. 20:24:07 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
CREATE procedure [dbo].[DX_GetStorageOutRows_dxDataGrid]
|
||||
@StorageOutHeader uniqueidentifier,
|
||||
@Result nvarchar(max) output
|
||||
as
|
||||
begin
|
||||
set nocount on
|
||||
declare @ResultLocal nvarchar(max)
|
||||
declare @ShortName nvarchar(50)
|
||||
declare @Oid nvarchar(50)
|
||||
declare @ProductNumber nvarchar(50)
|
||||
declare @QTT nvarchar(50)
|
||||
declare @RowIndex nvarchar(50)
|
||||
|
||||
set @ResultLocal='['
|
||||
|
||||
declare CCF cursor local fast_forward for
|
||||
select convert(nvarchar(50),t2.Oid),t3.ProductNumber,replace(t3.ShortName,'"',''''),convert(nvarchar(50),round(t2.QTT_Will,4)),convert(nvarchar(20),isnull(t2.RowIndex,-1))
|
||||
from StorageOutHeader t1 right join StorageOutRows t2 on
|
||||
t1.Oid=t2.StorageOutHeader left join pcs_whs.dbo.Products t3 on
|
||||
t2.Products=t3.Oid
|
||||
where t1.Oid=@StorageOutHeader and t2.GCRecord is null and t1.GCRecord is null
|
||||
order by t2.RowIndex desc
|
||||
|
||||
|
||||
open CCF
|
||||
fetch next from CCF into @Oid,@ProductNumber,@ShortName,@QTT,@RowIndex
|
||||
while @@FETCH_STATUS=0
|
||||
begin
|
||||
if @ResultLocal='['
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+'{ "Oid": "'+@Oid+'", "ProductNumber": "'+@ProductNumber+'", "ShortName": "'+@ShortName+'", "QTT": '+@QTT+',"RowIndex":'+@RowIndex+' }'
|
||||
end
|
||||
else
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+','+'{ "Oid": "'+@Oid+'", "ProductNumber": "'+@ProductNumber+'", "ShortName": "'+@ShortName+'", "QTT": '+@QTT+',"RowIndex":'+@RowIndex+' }'
|
||||
end
|
||||
fetch next from CCF into @Oid,@ProductNumber,@ShortName,@QTT,@RowIndex
|
||||
end
|
||||
close CCF
|
||||
deallocate CCF
|
||||
set @ResultLocal = @ResultLocal+']'
|
||||
|
||||
set @Result=@ResultLocal
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[DX_GetStoragePDACollectionHeader_dxList] Script Date: 2015.11.18. 20:24:07 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- =============================================
|
||||
-- Author : Ivan.Szabo
|
||||
-- Create date: 2015-09-10
|
||||
-- Modified on: 2015-09-24
|
||||
-- Version : 1.0.1002
|
||||
-- Description: Adott adatbázisban a nyitott PDA kollekciókat hozza fel
|
||||
-- =============================================
|
||||
CREATE procedure [dbo].[DX_GetStoragePDACollectionHeader_dxList]
|
||||
@Result nvarchar(max) output
|
||||
AS
|
||||
Begin
|
||||
set nocount on
|
||||
declare @ResultLocal nvarchar(max)
|
||||
declare @DocumentNumber nvarchar(50)
|
||||
declare @Oid nvarchar(50)
|
||||
set @ResultLocal='['
|
||||
|
||||
declare CCF cursor local fast_forward for
|
||||
select convert(nvarchar(50),t1.Oid),isnull(t1.DocumentNumber,'')
|
||||
from StoragePDACollectionHeader t1
|
||||
where ltrim(rtrim(isnull(t1.DocumentNumber,'')))<>'' and isnull(t1.StoragePDACollectionHeaderStatus,0)=0
|
||||
|
||||
order by t1.DocumentNumber
|
||||
open CCF
|
||||
fetch next from CCF into @Oid,@DocumentNumber
|
||||
while @@FETCH_STATUS=0
|
||||
begin
|
||||
if @ResultLocal='['
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+'{"key":"'+@Oid+'", "title" : "'+@DocumentNumber+'"}'
|
||||
end
|
||||
else
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+',{"key":"'+@Oid+'", "title" : "'+@DocumentNumber+'"}'
|
||||
end
|
||||
fetch next from CCF into @Oid,@DocumentNumber
|
||||
end
|
||||
close CCF
|
||||
deallocate CCF
|
||||
set @ResultLocal = @ResultLocal+']'
|
||||
|
||||
set @Result=@ResultLocal
|
||||
end
|
||||
|
||||
|
||||
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[DX_GetStoragePDACollectionRows_dxDataGrid] Script Date: 2015.11.18. 20:24:07 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
-- =============================================
|
||||
-- Author : Ivan.Szabo
|
||||
-- Create date: 2015-09-10
|
||||
-- Modified on: 2015-09-24
|
||||
-- Version : 1.0.1002
|
||||
-- Description: Adott adatbázisban a nyitott PDA kollekciók sorait hozza fel
|
||||
-- =============================================
|
||||
CREATE procedure [dbo].[DX_GetStoragePDACollectionRows_dxDataGrid]
|
||||
@StoragePDACollectionHeader uniqueidentifier,
|
||||
@Result nvarchar(max) output
|
||||
as
|
||||
begin
|
||||
set nocount on
|
||||
declare @ResultLocal nvarchar(max)
|
||||
declare @ShortName nvarchar(50)
|
||||
declare @Oid nvarchar(50)
|
||||
declare @Barcode nvarchar(50)
|
||||
declare @QTT nvarchar(50)
|
||||
declare @RowIndex nvarchar(50)
|
||||
|
||||
set @ResultLocal='['
|
||||
|
||||
declare CCF cursor local fast_forward for
|
||||
select convert(nvarchar(50),t2.Oid),isnull(t2.Barcode,''),
|
||||
replace(t3.ShortName,'"',''''),
|
||||
convert(nvarchar(50),round(t2.QTT,4)),
|
||||
convert(nvarchar(20),isnull(t2.RowIndex,-1))
|
||||
from StoragePDACollectionHeader t1 right join [StoragePDACollectionRows] t2 on
|
||||
t1.Oid=t2.StoragePDACollectionHeader left join pcs_whs.dbo.Products t3 on
|
||||
t2.Products=t3.Oid
|
||||
where t1.Oid=@StoragePDACollectionHeader
|
||||
order by t2.RowIndex desc
|
||||
|
||||
|
||||
open CCF
|
||||
fetch next from CCF into @Oid,@Barcode,@ShortName,@QTT,@RowIndex
|
||||
while @@FETCH_STATUS=0
|
||||
begin
|
||||
if @ResultLocal='['
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+'{ "Oid": "'+@Oid+'", "Barcode": "'+@Barcode+'", "ShortName": "'+@ShortName+'", "QTT": '+@QTT+',"RowIndex":'+@RowIndex+' }'
|
||||
end
|
||||
else
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+','+char(13)+char(10)+'{ "Oid": "'+@Oid+'", "Barcode": "'+@Barcode+'", "ShortName": "'+@ShortName+'", "QTT": '+@QTT+',"RowIndex":'+@RowIndex+' }'
|
||||
end
|
||||
fetch next from CCF into @Oid,@Barcode,@ShortName,@QTT,@RowIndex
|
||||
end
|
||||
close CCF
|
||||
deallocate CCF
|
||||
set @ResultLocal = @ResultLocal+']'
|
||||
|
||||
set @Result=@ResultLocal
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[DX_InsertDiscount_dxDataGrid] Script Date: 2015.11.18. 20:24:07 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
CREATE procedure [dbo].[DX_InsertDiscount_dxDataGrid]
|
||||
@Barcode nvarchar(50),
|
||||
@PriceBruttoHUF float,
|
||||
@ActualDate date,
|
||||
@Expirationdate date
|
||||
as
|
||||
begin
|
||||
set nocount on
|
||||
declare @Products uniqueidentifier
|
||||
declare @DiscountedBarcode nvarchar(50)
|
||||
declare @NumberGenerator uniqueidentifier
|
||||
declare @CustomersFrom uniqueidentifier
|
||||
declare @CustomerNumber nvarchar(50)
|
||||
|
||||
select @Products=Products
|
||||
from PricingProductsBarcodeCustomers
|
||||
where Barcode=@Barcode
|
||||
|
||||
if @Products is not null
|
||||
begin
|
||||
begin tran
|
||||
|
||||
select top 1 @CustomerNumber=t2.CustomerNumber,@CustomersFrom=t1.Oid
|
||||
from CustomersFrom t1 join Customers t2 on
|
||||
t1.Oid=t2.Oid
|
||||
|
||||
select @NumberGenerator=Oid
|
||||
from NumberGenerator
|
||||
where ShortName='DISCOUNT'
|
||||
|
||||
exec sp_GetNewNumber @NumberGenerator=@NumberGenerator,
|
||||
@YearString= null,
|
||||
@MonthString= null,
|
||||
@NewNumber=@DiscountedBarcode output
|
||||
set @DiscountedBarcode='99'+convert(nvarchar(10),@CustomerNumber)+ Replace(@DiscountedBarcode, 'Y', '')
|
||||
|
||||
select @DiscountedBarcode=pcs_whs.dbo.EAN13CodeGenerator(@DiscountedBarcode)
|
||||
|
||||
|
||||
insert PricingProductsBarcodeCustomers (Oid, Products, Barcode, Customers, PriceBruttoHUF, ExpirationDate, ActualDate, PricingCode, PricingCodeDescription,
|
||||
IsAction, BarcodeType)
|
||||
select NEWID(),@Products,@DiscountedBarcode,@CustomersFrom,@PriceBruttoHUF,@ExpirationDate,@ActualDate,'','DISCOUNT',
|
||||
0,'AIR'
|
||||
commit
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[DX_InsertStorageOutRows_dxDataGrid] Script Date: 2015.11.18. 20:24:07 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
-- =============================================
|
||||
-- Author: Ivan.Szabo
|
||||
-- Create date: 2015-09-10
|
||||
-- Modified on: 2015-09-21
|
||||
-- Description: Kitárol egy ételt PDA-n keresztül
|
||||
-- =============================================
|
||||
CREATE procedure [dbo].[DX_InsertStorageOutRows_dxDataGrid]
|
||||
@StorageOutHeader uniqueidentifier,
|
||||
@Barcode nvarchar(50),
|
||||
@QTT float,
|
||||
@Result nvarchar(max) output
|
||||
as
|
||||
begin
|
||||
set nocount on
|
||||
set xact_abort on
|
||||
|
||||
declare @RowIndex int
|
||||
declare @Products uniqueidentifier
|
||||
declare @Storage uniqueidentifier
|
||||
declare @Ok int
|
||||
declare @ErrorNumber int
|
||||
|
||||
select @Storage=Storage from StorageOutHeader where Oid=@StorageOutHeader
|
||||
|
||||
select @Products=Products from pcs_whs.dbo.ProductsBarcodes where Barcode=@Barcode
|
||||
|
||||
if @Products is not null
|
||||
begin
|
||||
begin tran
|
||||
exec [dbo].[sp_AddToTable_StorageOut] @StorageOutHeader=@StorageOutHeader,
|
||||
@Storage=@Storage,
|
||||
@Barcode=@Barcode,
|
||||
@Products=@Products,
|
||||
@QTT=@QTT, @User=null,
|
||||
@Ok=@Ok output,
|
||||
@ErrorNumber=@ErrorNumber output
|
||||
|
||||
commit
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[DX_InsertStoragePDACollectionRows_dxDataGrid] Script Date: 2015.11.18. 20:24:07 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
-- =============================================
|
||||
-- Author: Ivan.Szabo
|
||||
-- Create date: 2015-09-10
|
||||
-- Modified on: 2015-09-21
|
||||
-- Description: PDA kollekció sorba beszúr
|
||||
-- =============================================
|
||||
CREATE procedure [dbo].[DX_InsertStoragePDACollectionRows_dxDataGrid]
|
||||
@StoragePDACollectionHeader uniqueidentifier,
|
||||
@Barcode nvarchar(50),
|
||||
@QTT float,
|
||||
@Result nvarchar(max) output
|
||||
as
|
||||
begin
|
||||
set nocount on
|
||||
set xact_abort on
|
||||
|
||||
declare @RowIndex int
|
||||
|
||||
|
||||
if exists(select Oid from pcs_whs.[dbo].[ProductsBarcodes] where [Barcode]=@Barcode)
|
||||
begin
|
||||
begin tran
|
||||
select @RowIndex=max(RowIndex)+1 from [StoragePDACollectionRows] where StoragePDACollectionHeader=@StoragePDACollectionHeader
|
||||
if @RowIndex is null set @RowIndex=1
|
||||
|
||||
insert [dbo].[StoragePDACollectionRows](Oid, StoragePDACollectionHeader, Products, QTT, QTT_Processed, RowIndex, Barcode )
|
||||
select NEWID(),@StoragePDACollectionHeader,t1.Products,@QTT,0,@RowIndex,@Barcode
|
||||
from pcs_whs.dbo.[ProductsBarcodes] t1
|
||||
where t1.Barcode=@Barcode
|
||||
commit
|
||||
end
|
||||
|
||||
end
|
||||
/****** Object: StoredProcedure [dbo].[DX_GetCustomersFrom_dxSelectBox] Script Date: 2015.11.17. 23:29:22 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
-- =============================================
|
||||
-- Author : Ivan.Szabo
|
||||
-- Create date : 2015-09-10
|
||||
-- Modified on : 2015-09-10
|
||||
-- Description : pcs ... adatbázisok listája
|
||||
-- =============================================
|
||||
CREATE PROCEDURE [dbo].[DX_GetCustomersFrom_dxSelectBox]
|
||||
@Result nvarchar(max) output
|
||||
AS
|
||||
begin
|
||||
set nocount on
|
||||
declare @SQLDatabase nvarchar(10)
|
||||
declare @ResultLocal nvarchar(max)
|
||||
set @ResultLocal='['
|
||||
|
||||
declare CCF cursor local fast_forward for
|
||||
select t1.SQLDatabase
|
||||
from pcs_whs.dbo.CustomersFrom t1
|
||||
where t1.Active=1 and t1.IsMobile=1
|
||||
order by t1.SQLDatabase
|
||||
open CCF
|
||||
fetch next from CCF into @SQLDatabase
|
||||
while @@FETCH_STATUS=0
|
||||
begin
|
||||
if @ResultLocal='['
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+'"'+@SQLDatabase+'"'
|
||||
end
|
||||
else
|
||||
begin
|
||||
set @ResultLocal = @ResultLocal+',"'+@SQLDatabase+'"'
|
||||
end
|
||||
fetch next from CCF into @SQLDatabase
|
||||
end
|
||||
close CCF
|
||||
deallocate CCF
|
||||
set @ResultLocal = @ResultLocal+']'
|
||||
|
||||
set @Result=@ResultLocal
|
||||
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user