Initial commit

This commit is contained in:
Culak-HP\Culak
2020-10-10 18:25:36 +02:00
commit cc7c23eca4
254 changed files with 67743 additions and 0 deletions

9
Mip/App.config Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source = |SQL/CE|" />
</connectionStrings>
</configuration>

Binary file not shown.

BIN
Mip/Controls/MyTools.dll Normal file

Binary file not shown.

BIN
Mip/Controls/test1.exe Normal file

Binary file not shown.

80
Mip/CustomControls.cs Normal file
View File

@@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Windows.Forms;
namespace Mip
{
class CustomControls
{
public class RotatedLabel : System.Windows.Forms.Label
{
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
string Name = base.Name;
Name = Parent.Name;
var g = e.Graphics;
g.DrawString(Name, new Font("Tahoma", 10), Brushes.Black, 0, 0, new StringFormat(StringFormatFlags.DirectionVertical));
}
}
public class NoScrollPanel : Panel
{
protected override void OnMouseWheel(MouseEventArgs e)
{
HandledMouseEventArgs mouseEvent = (HandledMouseEventArgs)e;
mouseEvent.Handled = true;
}
}
public class AdaptiveSizeTextBox : TextBox
{
protected override void OnTextChanged(EventArgs e)
{
using (Graphics g = CreateGraphics())
{
SizeF size = g.MeasureString(Text, Font);
if (size.Width > 20) Width = (int)Math.Ceiling(size.Width) +5;
else Width = 25;
}
base.OnTextChanged(e);
}
}
public class FloatTrackBar : TrackBar
{
private float precision = 0.01f;
public float Precision
{
get { return precision; }
set
{
precision = value;
// todo: update the 5 properties below
}
}
public new float LargeChange
{ get { return base.LargeChange * precision; } set { base.LargeChange = (int)(value / precision); } }
public new float Maximum
{ get { return base.Maximum * precision; } set { base.Maximum = (int)(value / precision); } }
public new float Minimum
{ get { return base.Minimum * precision; } set { base.Minimum = (int)(value / precision); } }
public new float SmallChange
{ get { return base.SmallChange * precision; } set { base.SmallChange = (int)(value / precision); } }
public new float Value
{ get { return base.Value * precision; } set { base.Value = (int)(value / precision); } }
}
}
}

BIN
Mip/DLL/GMap.NET.Core.dll Normal file

Binary file not shown.

Binary file not shown.

BIN
Mip/DLL/ImDiskNet.dll Normal file

Binary file not shown.

Binary file not shown.

BIN
Mip/DLL/MySql.Data.dll Normal file

Binary file not shown.

BIN
Mip/DLL/MySql.Web.dll Normal file

Binary file not shown.

BIN
Mip/DLL/MyTools.dll Normal file

Binary file not shown.

529
Mip/Mip.csproj Normal file
View File

@@ -0,0 +1,529 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.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>{3532D844-466D-429B-A2C8-206F023FF653}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Mip</RootNamespace>
<AssemblyName>Mip</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
<BootstrapperComponentsUrl>D:\Záloha\Install - Software\.NET FrameWork 4.5</BootstrapperComponentsUrl>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisIgnoreGeneratedCode>true</CodeAnalysisIgnoreGeneratedCode>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<ManifestCertificateThumbprint>554AF64D6062FFD82B8BE79E913456D101F9A511</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>Mip_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<TargetZone>Custom</TargetZone>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Mip.Program</StartupObject>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup />
<PropertyGroup />
<PropertyGroup>
<ApplicationIcon>kompozitum.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup />
<PropertyGroup />
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="GMap.NET.Core">
<HintPath>DLL\GMap.NET.Core.dll</HintPath>
</Reference>
<Reference Include="GMap.NET.WindowsForms">
<HintPath>DLL\GMap.NET.WindowsForms.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>C:\Windows\assembly\GAC\Microsoft.Office.Interop.Excel\12.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Microsoft.VisualBasic.Compatibility" />
<Reference Include="MonthCalendar">
<HintPath>Controls\MonthCalendar.dll</HintPath>
</Reference>
<Reference Include="MySql.Data">
<HintPath>DLL\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="MyTools">
<HintPath>DLL\MyTools.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\..\Json\Bin\Net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Design" />
<Reference Include="System.DirectoryServices" />
<Reference Include="System.Management" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Windows.Forms.DataVisualization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="classDiskOperations.cs" />
<Compile Include="classGlobal.cs" />
<Compile Include="classMapa.cs" />
<Compile Include="classSQL.cs" />
<Compile Include="classUser.cs" />
<Compile Include="CustomControls.cs" />
<Compile Include="frmAddCenovuPonuku.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmAddCenovuPonuku.Designer.cs">
<DependentUpon>frmAddCenovuPonuku.cs</DependentUpon>
</Compile>
<Compile Include="frmAddFirma.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmAddFirma.Designer.cs">
<DependentUpon>frmAddFirma.cs</DependentUpon>
</Compile>
<Compile Include="frmAddMat.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmAddMat.Designer.cs">
<DependentUpon>frmAddMat.cs</DependentUpon>
</Compile>
<Compile Include="frmEditBrusenia.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmEditBrusenia.Designer.cs">
<DependentUpon>frmEditBrusenia.cs</DependentUpon>
</Compile>
<Compile Include="frmEditCenovuPonuku.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmEditCenovuPonuku.Designer.cs">
<DependentUpon>frmEditCenovuPonuku.cs</DependentUpon>
</Compile>
<Compile Include="frmEditExpedicia.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmEditExpedicia.Designer.cs">
<DependentUpon>frmEditExpedicia.cs</DependentUpon>
</Compile>
<Compile Include="frmChat.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmChat.Designer.cs">
<DependentUpon>frmChat.cs</DependentUpon>
</Compile>
<Compile Include="frmEditDopyt.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmEditDopyt.Designer.cs">
<DependentUpon>frmEditDopyt.cs</DependentUpon>
</Compile>
<Compile Include="frmEditPoziadavka.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmEditPoziadavka.Designer.cs">
<DependentUpon>frmEditPoziadavka.cs</DependentUpon>
</Compile>
<Compile Include="frmEditVyrobok.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmEditVyrobok.Designer.cs">
<DependentUpon>frmEditVyrobok.cs</DependentUpon>
</Compile>
<Compile Include="frmInventar.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmInventar.Designer.cs">
<DependentUpon>frmInventar.cs</DependentUpon>
</Compile>
<Compile Include="frmInventarnaVymena.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmInventarnaVymena.Designer.cs">
<DependentUpon>frmInventarnaVymena.cs</DependentUpon>
</Compile>
<Compile Include="frmLogo.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmLogo.Designer.cs">
<DependentUpon>frmLogo.cs</DependentUpon>
</Compile>
<Compile Include="frmNacenovanie.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmNacenovanie.Designer.cs">
<DependentUpon>frmNacenovanie.cs</DependentUpon>
</Compile>
<Compile Include="frmNovaPoziadavka.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmNovaPoziadavka.Designer.cs">
<DependentUpon>frmNovaPoziadavka.cs</DependentUpon>
</Compile>
<Compile Include="frmPridatEditovatNastroj.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmPridatEditovatNastroj.Designer.cs">
<DependentUpon>frmPridatEditovatNastroj.cs</DependentUpon>
</Compile>
<Compile Include="frmPridatNastrojeDoSkladu.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmPridatNastrojeDoSkladu.Designer.cs">
<DependentUpon>frmPridatNastrojeDoSkladu.cs</DependentUpon>
</Compile>
<Compile Include="frmPrijemDoSkladu.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmPrijemDoSkladu.Designer.cs">
<DependentUpon>frmPrijemDoSkladu.cs</DependentUpon>
</Compile>
<Compile Include="frmPriraditZamestnancaStroju.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmPriraditZamestnancaStroju.Designer.cs">
<DependentUpon>frmPriraditZamestnancaStroju.cs</DependentUpon>
</Compile>
<Compile Include="frmShowVykres.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmShowVykres.Designer.cs">
<DependentUpon>frmShowVykres.cs</DependentUpon>
</Compile>
<Compile Include="frmLogin.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmLogin.Designer.cs">
<DependentUpon>frmLogin.cs</DependentUpon>
</Compile>
<Compile Include="frmMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmMain.Designer.cs">
<DependentUpon>frmMain.cs</DependentUpon>
</Compile>
<Compile Include="frmPridatVyrobok.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmPridatVyrobok.Designer.cs">
<DependentUpon>frmPridatVyrobok.cs</DependentUpon>
</Compile>
<Compile Include="frmAddPomUdaje.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmAddPomUdaje.Designer.cs">
<DependentUpon>frmAddPomUdaje.cs</DependentUpon>
</Compile>
<Compile Include="frmNewDopyt.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmNewDopyt.Designer.cs">
<DependentUpon>frmNewDopyt.cs</DependentUpon>
</Compile>
<Compile Include="frmTlacitStatistiku.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmTlacitStatistiku.Designer.cs">
<DependentUpon>frmTlacitStatistiku.cs</DependentUpon>
</Compile>
<Compile Include="frmVydajZoSkladu.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmVydajZoSkladu.Designer.cs">
<DependentUpon>frmVydajZoSkladu.cs</DependentUpon>
</Compile>
<Compile Include="frmZadatZmatkovitost.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmZadatZmatkovitost.Designer.cs">
<DependentUpon>frmZadatZmatkovitost.cs</DependentUpon>
</Compile>
<Compile Include="frmZiadankaDoplnujuceInfo.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmZiadankaDoplnujuceInfo.Designer.cs">
<DependentUpon>frmZiadankaDoplnujuceInfo.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="frmUlozPolotovar.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmUlozPolotovar.Designer.cs">
<DependentUpon>frmUlozPolotovar.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="frmAddCenovuPonuku.resx">
<DependentUpon>frmAddCenovuPonuku.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="frmAddFirma.resx">
<DependentUpon>frmAddFirma.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmAddMat.resx">
<DependentUpon>frmAddMat.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmEditBrusenia.resx">
<DependentUpon>frmEditBrusenia.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmEditCenovuPonuku.resx">
<DependentUpon>frmEditCenovuPonuku.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmEditExpedicia.resx">
<DependentUpon>frmEditExpedicia.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="frmChat.resx">
<DependentUpon>frmChat.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmEditDopyt.resx">
<DependentUpon>frmEditDopyt.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="frmEditPoziadavka.resx">
<DependentUpon>frmEditPoziadavka.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmEditVyrobok.resx">
<DependentUpon>frmEditVyrobok.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="frmInventar.resx">
<DependentUpon>frmInventar.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmInventarnaVymena.resx">
<DependentUpon>frmInventarnaVymena.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmLogo.resx">
<DependentUpon>frmLogo.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmNacenovanie.resx">
<DependentUpon>frmNacenovanie.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmNovaPoziadavka.resx">
<DependentUpon>frmNovaPoziadavka.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmPridatEditovatNastroj.resx">
<DependentUpon>frmPridatEditovatNastroj.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmPridatNastrojeDoSkladu.resx">
<DependentUpon>frmPridatNastrojeDoSkladu.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmPrijemDoSkladu.resx">
<DependentUpon>frmPrijemDoSkladu.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmPriraditZamestnancaStroju.resx">
<DependentUpon>frmPriraditZamestnancaStroju.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmShowVykres.resx">
<DependentUpon>frmShowVykres.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmLogin.resx">
<DependentUpon>frmLogin.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmMain.resx">
<DependentUpon>frmMain.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="frmPridatVyrobok.resx">
<DependentUpon>frmPridatVyrobok.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmAddPomUdaje.resx">
<DependentUpon>frmAddPomUdaje.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="frmNewDopyt.resx">
<DependentUpon>frmNewDopyt.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmTlacitStatistiku.resx">
<DependentUpon>frmTlacitStatistiku.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmVydajZoSkladu.resx">
<DependentUpon>frmVydajZoSkladu.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmZadatZmatkovitost.resx">
<DependentUpon>frmZadatZmatkovitost.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmZiadankaDoplnujuceInfo.resx">
<DependentUpon>frmZiadankaDoplnujuceInfo.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="frmUlozPolotovar.resx">
<DependentUpon>frmUlozPolotovar.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.manifest">
<SubType>Designer</SubType>
</None>
<None Include="Mip_TemporaryKey.pfx" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<COMReference Include="Microsoft.Office.Core">
<Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
<VersionMajor>2</VersionMajor>
<VersionMinor>4</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="kompozitum.ico" />
<None Include="Resources\Superman logo.png" />
<None Include="Resources\Arrow-right.png" />
<None Include="Resources\Arrow-left.png" />
<None Include="Použité obrázky\image-remove-icon.png" />
<None Include="Použité obrázky\image-icon.png" />
<None Include="Použité obrázky\image-add-icon.png" />
<None Include="Použité obrázky\delete2.png" />
<None Include="Použité obrázky\Add-icon.png" />
<None Include="Použité obrázky\add.gif" />
<None Include="Použité obrázky\alphacam.png" />
<None Include="Použité obrázky\autodesk-inventor-icon.png" />
<None Include="Použité obrázky\autocad-autocad-icon.png" />
<None Include="Použité obrázky\pdf.png" />
<None Include="Použité obrázky\Icon-2D-1.0.png" />
<None Include="Použité obrázky\icon_2d.png" />
<None Include="Použité obrázky\3dv2.jpg" />
<None Include="Použité obrázky\3d.png" />
<None Include="Použité obrázky\Rotation.png" />
<None Include="Resources\resize32.ico" />
<None Include="Resources\save.png" />
<None Include="Použité obrázky\Edit.png" />
<None Include="Použité obrázky\info.png" />
<None Include="Použité obrázky\plus.png" />
<None Include="Použité obrázky\up.png" />
<None Include="Použité obrázky\Restart2.png" />
<None Include="Použité obrázky\Restart.png" />
<None Include="Použité obrázky\OK 3D.png" />
<None Include="Použité obrázky\MIP4.gif" />
<None Include="Použité obrázky\kompozitumv2maleanazov.png" />
<None Include="Použité obrázky\kompozitum v2.png" />
<None Include="Použité obrázky\kompozitum v2 male.png" />
<None Include="Použité obrázky\kompozitum male.jpg" />
<None Include="Použité obrázky\Image.png" />
<None Include="Použité obrázky\checked -green.png" />
<None Include="Použité obrázky\Chat.png" />
<None Include="Použité obrázky\error.png" />
<None Include="Použité obrázky\erase 3D.png" />
<None Include="Použité obrázky\down.png" />
<None Include="Použité obrázky\delete.jpg" />
<None Include="Použité obrázky\calendar.png" />
<None Include="Použité obrázky\calculator.png" />
<None Include="Použité obrázky\arrow-up-double-2.png" />
<None Include="Použité obrázky\arrow-down-double-2.png" />
</ItemGroup>
<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>

14
Mip/Mip.csproj.user Normal file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory>D:\Záloha\Install - Software\.NET FrameWork 4.5</BootstrapperUrlHistory>
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>

BIN
Mip/Mip_TemporaryKey.pfx Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 845 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

22
Mip/Program.cs Normal file
View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mip
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain());
}
}
}

View File

@@ -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("Mip")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Mip")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[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("273fb0b9-e7e8-4368-b5d3-d5346bb2004a")]
// 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")]

473
Mip/Properties/Resources.Designer.cs generated Normal file
View File

@@ -0,0 +1,473 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mip.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Mip.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap _3d {
get {
object obj = ResourceManager.GetObject("3d", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap _3dv2 {
get {
object obj = ResourceManager.GetObject("3dv2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap add {
get {
object obj = ResourceManager.GetObject("add", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Add_icon {
get {
object obj = ResourceManager.GetObject("Add-icon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap alphacam {
get {
object obj = ResourceManager.GetObject("alphacam", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Arrow_left {
get {
object obj = ResourceManager.GetObject("Arrow-left", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Arrow_right {
get {
object obj = ResourceManager.GetObject("Arrow-right", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap autocad_autocad_icon {
get {
object obj = ResourceManager.GetObject("autocad-autocad-icon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap autodesk_inventor_icon {
get {
object obj = ResourceManager.GetObject("autodesk-inventor-icon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap calculator {
get {
object obj = ResourceManager.GetObject("calculator", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap calendar {
get {
object obj = ResourceManager.GetObject("calendar", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Chat {
get {
object obj = ResourceManager.GetObject("Chat", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap checked__green {
get {
object obj = ResourceManager.GetObject("checked -green", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap delete {
get {
object obj = ResourceManager.GetObject("delete", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap delete2 {
get {
object obj = ResourceManager.GetObject("delete2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap down {
get {
object obj = ResourceManager.GetObject("down", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Edit {
get {
object obj = ResourceManager.GetObject("Edit", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap erase_3D {
get {
object obj = ResourceManager.GetObject("erase 3D", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap error {
get {
object obj = ResourceManager.GetObject("error", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icon_2d {
get {
object obj = ResourceManager.GetObject("icon_2d", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Icon_2D_1_0 {
get {
object obj = ResourceManager.GetObject("Icon-2D-1.0", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Image {
get {
object obj = ResourceManager.GetObject("Image", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap image_add_icon {
get {
object obj = ResourceManager.GetObject("image-add-icon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap image_icon {
get {
object obj = ResourceManager.GetObject("image-icon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap image_remove_icon {
get {
object obj = ResourceManager.GetObject("image-remove-icon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap info {
get {
object obj = ResourceManager.GetObject("info", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap kompozitum_male {
get {
object obj = ResourceManager.GetObject("kompozitum male", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap kompozitum_v2 {
get {
object obj = ResourceManager.GetObject("kompozitum v2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap kompozitum_v2_male {
get {
object obj = ResourceManager.GetObject("kompozitum v2 male", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap kompozitumv2maleanazov {
get {
object obj = ResourceManager.GetObject("kompozitumv2maleanazov", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap MIP4 {
get {
object obj = ResourceManager.GetObject("MIP4", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap OK_3D {
get {
object obj = ResourceManager.GetObject("OK 3D", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap pdf {
get {
object obj = ResourceManager.GetObject("pdf", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap plus {
get {
object obj = ResourceManager.GetObject("plus", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap resize32 {
get {
object obj = ResourceManager.GetObject("resize32", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Restart {
get {
object obj = ResourceManager.GetObject("Restart", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Restart2 {
get {
object obj = ResourceManager.GetObject("Restart2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Rotation {
get {
object obj = ResourceManager.GetObject("Rotation", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap save {
get {
object obj = ResourceManager.GetObject("save", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Superman_logo {
get {
object obj = ResourceManager.GetObject("Superman logo", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap up {
get {
object obj = ResourceManager.GetObject("up", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@@ -0,0 +1,244 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="image-icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\image-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Restart" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\Restart.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pdf" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\pdf.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Rotation" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\Rotation.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="image-add-icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\image-add-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="3d" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\3d.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Icon-2D-1.0" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\Icon-2D-1.0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Arrow-right" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Arrow-right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Restart2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\Restart2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="calendar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\calendar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="error" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\error.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="autodesk-inventor-icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\autodesk-inventor-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="kompozitum male" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\kompozitum male.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="calculator" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\calculator.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="checked -green" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\checked -green.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Edit" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\Edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="plus" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="erase 3D" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\erase 3D.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="kompozitumv2maleanazov" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\kompozitumv2maleanazov.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Chat" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\Chat.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="info" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\info.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="delete2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\delete2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="OK 3D" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\OK 3D.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\delete.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icon_2d" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\icon_2d.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="resize32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\resize32.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Add-icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\Add-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="alphacam" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\alphacam.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="save" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\save.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="add" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\add.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\Image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="3dv2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\3dv2.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="kompozitum v2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\kompozitum v2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="image-remove-icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\image-remove-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="MIP4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\MIP4.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Arrow-left" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Arrow-left.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="kompozitum v2 male" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\kompozitum v2 male.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="autocad-autocad-icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Použité obrázky\autocad-autocad-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Superman logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Superman logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

30
Mip/Properties/Settings.Designer.cs generated Normal file
View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18052
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mip.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
Mip/Resources/resize32.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
Mip/Resources/save.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

695
Mip/_classSQL.cs Normal file
View File

@@ -0,0 +1,695 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Odbc;
using System.Data;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using System.IO;
using System.Net.Sockets;
using System.Net;
namespace Mip
{
class classSQL
{
private static OdbcConnection Connection; //kanál pre connectovanie databazy
private static OdbcCommand Command; //vygenerovaný príkaz pre SQL, ktorý bude odoslaný - toto nie je text.
private static OdbcDataAdapter Adapter;// sem pridu data z SQL - len pamä<6D>ové miesto, v podobe tabulky
public static DataTable dTable; //datable
//Deklaracia premennych pre pristup k mySQL cez MYSQL
private static MySqlConnection MyConnection;
private static MySqlCommand MyCommand;
public static MySqlDataReader myData;
/////////////////////////////////////////////////////////////////////
/// <summary>
/// Pripojí classSQL.Conection k SQL serveru cez ODBC driver
/// </summary>
public static void connectSQL ()
{
// MessageBox.Show(IPGroup());
string ServerIP = "192.168."+IPGroup()+".39";
TcpClient tcpClient = new TcpClient();
try
{
tcpClient.Connect(ServerIP, 3306);
}
catch (Exception)
{
MessageBox.Show("MariaDB server nie je v lokálnej sieti dostupný!"
+ Environment.NewLine
+ Environment.NewLine
+ "Po staèení tlaèidla OK, sa program skúsi pripoji<6A> cez internet! ");
ServerIP = "87.197.164.107";
try
{
tcpClient.Connect(ServerIP, 3306);
}
catch (Exception)
{
MessageBox.Show("MariaDB server nie je dostupný cez internet!"
+ Environment.NewLine
+ Environment.NewLine
+ "Program Mip bude ukonèený! ");
Environment.Exit(0);
}
}
classSQL.Connection = new OdbcConnection("Driver={MySQL ODBC 5.1 Driver};Server=" + ServerIP + ";Database=mip; User=mip;Password=mip@2013;Option=3;");//
// MyConnection = new MySqlConnection("server=" + ServerIP + ";database=mip; User=mip;Password=mip@2013;;");
}
/// <summary>
/// Vykoná SQL dotaz cez ODBC a výsledok uloží do ¾ubovolnej DataTable
/// </summary>
/// <param name="cmd"> Znenie dotazu</param>
/// <param name="c"> Konštanta napr. 1 - slúži na rozlíšenie medzi parametrickou a neparametrickou commandSQL</param>
public static DataTable commandSQL(string _cmd, int c)
{
OdbcCommand _Commanda; //vygenerovaný príkaz pre SQL, ktorý bude odoslaný - toto nie je text.
OdbcDataAdapter _Adaptera;// sem pridu data z SQL - len pamä<6D>ové miesto, v podobe tabulky
DataTable _dTablea; //datable
connectSQL();
classSQL.Connection.Open();
_Commanda = new OdbcCommand(_cmd, Connection); //Textový príkaz prelozime do reci SQL stroja
_Adaptera = new OdbcDataAdapter(_Commanda ); //Vytvoríme dátový adaptér(ukazovatel v RAMke), kam prídu výsledky z SQL
_dTablea = new DataTable(); //Vytvoríme dátovú (prázdnu) tabulku, pomocou ktorej budeme pristupova<76> k dátam v adaptéri.
_Adaptera.Fill(_dTablea);
classSQL.Connection.Close();
return _dTablea;
}
/// <summary>
/// Vykoná SQL dotaz cez ODBC a výsledok uloží do ¾ubovolnej DataTable
/// </summary>
/// <param name="cmd"> Znenie dotazu</param>
public static void commandSQL(string cmd)
{
connectSQL();
classSQL.Connection.Open();
Command = new OdbcCommand(cmd, Connection); //Textový príkaz prelozime do reci SQL stroja
Adapter = new OdbcDataAdapter(Command); //Vytvoríme dátový adaptér(ukazovatel v RAMke), kam prídu výsledky z SQL
dTable = new DataTable(); //Vytvoríme dátovú (prázdnu) tabulku, pomocou ktorej budeme pristupova<76> k dátam v adaptéri.
Adapter.Fill(classSQL.dTable);
classSQL.Connection.Close();
}
/// <summary>
/// Export súboru (formulára) z SQL na disk
/// </summary>
/// <param name="_nazov"> Nazov súbora v SQL</param>
/// <param name="_filepath"> Path\Názov súbora , pod ktorým bude uložený na disk</param>
public static void ExportFormToHDD(string _nazov,string _filepath)
{
string ServerIP = "192.168." + IPGroup() + ".39";
MyConnection = new MySqlConnection("server=" + ServerIP + ";database=mip; User=mip;Password=mip@2013;;");
byte[] FilewData;
string CmdString = ("SELECT `DataSuboru`,(LENGTH (`DataSuboru`)) AS `size` FROM `tabformular` WHERE `NazovSuboru` LIKE '%"+_nazov+"%';");
MyCommand = new MySqlCommand(CmdString, MyConnection);
MyConnection.Open();
myData = MyCommand.ExecuteReader();
myData.Read();
FilewData = new byte[Convert.ToInt32(myData[1])];
Array.Copy((byte[])myData[0], FilewData, Convert.ToInt32(myData[1]));
FileStream fs;
fs = new FileStream(_filepath, FileMode.CreateNew, FileAccess.Write);
fs.Write(FilewData, 0, FilewData.Length);
MyConnection.Close();
fs.Close();
}
/// <summary>
/// Uloženie výkresu z RAM (byte[] _VykresData) do SQL
/// </summary>
/// <param name="_IDVyrobok"> ID výrobku</param>
/// <param name="_IndexVykresu"> Index výkresu z daného výrobku (výrobok môže obsahova<76> viacero výkresov)</param>
public static void SaveVykresToSQL(int _IDVyrobok,int _IndexVykresu, byte [] _VykresData)
{
string ServerIP = "192.168." + IPGroup() + ".39";
MyConnection = new MySqlConnection("server=" + ServerIP + ";database=mip; User=mip;Password=mip@2013;;");
//INSERT INTO `mip`.`tabvykres` (`NazovVyrobku`, `RozmerTvar`, `Rozmer1`, `Rozmer2`, `Rozmer3`, `SpojeneRozmery`, `Zakaznik`, `InyNazov`, `RozlisZnakKonecnaOp`, `Alias`) VALUES ('"
string CmdString = "INSERT INTO `mip`.`tabvykres` (IDVyrobok,IndexVykresu,VykresData) VALUES(@IDVyrobok,@IndexVykresu,@VykresData)";
MyCommand = new MySqlCommand(CmdString, MyConnection);
MyCommand.Parameters.Add("@IDVyrobok", MySqlDbType.Int32);
MyCommand.Parameters.Add("@IndexVykresu", MySqlDbType.Int32);
MyCommand.Parameters.Add("@VykresData", MySqlDbType.MediumBlob);
MyCommand.Parameters["@IDVyrobok"].Value = _IDVyrobok;
MyCommand.Parameters["@IndexVykresu"].Value = _IndexVykresu;
MyCommand.Parameters["@VykresData"].Value = _VykresData;
MyConnection.Open();
MyCommand.ExecuteNonQuery();
//long id = MyCommand.LastInsertedId;
MyConnection.Close();
}
/// <summary>
/// Export výkresu z SQL na HDD
/// </summary>
/// <param name="_IDVyrobok"> ID výrobku</param>
/// <param name="_IndexVykresu"> Index výkresu z daného výrobku (výrobok môže obsahova<76> viacero výkresov)</param>
/// <param name="_filepath"> Path\Názov súboru, do ktorého je výkres vyexportovaný</param>
public static void ExportVykresToHDD(int _IDVyrobok,int _indexVykresu, string _filepath)
{
string ServerIP = "192.168." + IPGroup() + ".39";
MyConnection = new MySqlConnection("server=" + ServerIP + ";database=mip; User=mip;Password=mip@2013;;");
byte[] FilewData;
string CmdString = ("SELECT `VykresData`,(LENGTH (`VykresData`)) AS `size` FROM `tabvykres` WHERE `IDVyrobok` = " + _IDVyrobok.ToString() + " AND `IndexVykresu`= (SELECT min(`IndexVykresu`) FROM `tabvykres` WHERE `IDVyrobok` = " + _IDVyrobok.ToString() + ");");
MyCommand = new MySqlCommand(CmdString, MyConnection);
MyConnection.Open();
myData = MyCommand.ExecuteReader();
myData.Read();
FilewData = new byte[Convert.ToInt32(myData[1])];
Array.Copy((byte[])myData[0], FilewData, Convert.ToInt32(myData[1]));
FileStream fs;
fs = new FileStream(_filepath, FileMode.CreateNew, FileAccess.Write);
fs.Write(FilewData, 0, FilewData.Length);
MyConnection.Close();
fs.Close();
}
/// <summary>
/// Uloženie formulára z RAM do SQL
/// </summary>
/// <param name="_meno"> Názov formulára</param>
/// <param name="_FormularData"> pole byte[], v ktorom je uložený formulár
public static void SaveFormToSQL(string _meno,byte[] _FormularData)
{
string ServerIP = "192.168." + IPGroup() + ".39";
MyConnection = new MySqlConnection("server=" + ServerIP + ";database=mip; User=mip;Password=mip@2013;;");
//INSERT INTO `mip`.`tabvykres` (`NazovVyrobku`, `RozmerTvar`, `Rozmer1`, `Rozmer2`, `Rozmer3`, `SpojeneRozmery`, `Zakaznik`, `InyNazov`, `RozlisZnakKonecnaOp`, `Alias`) VALUES ('"
String poznamka = Microsoft.VisualBasic.Interaction.InputBox(null, "Zadaj poznámku k formuláru:");
//choice = Integer.parseInt(poznamka);
//choice--;
string CmdString = "INSERT INTO `mip`.`tabformular` (NazovSuboru,DataSuboru,PoznamkaFormulara) VALUES(@NazovSuboru,@DataSuboru,@PoznamkaFormulara)";
MyCommand = new MySqlCommand(CmdString, MyConnection);
MyCommand.Parameters.Add("@NazovSuboru", MySqlDbType.String);
MyCommand.Parameters.Add("@DataSuboru", MySqlDbType.MediumBlob);
MyCommand.Parameters.Add("@PoznamkaFormulara", MySqlDbType.String);
MyCommand.Parameters["@NazovSuboru"].Value = _meno;
MyCommand.Parameters["@DataSuboru"].Value = _FormularData;
MyCommand.Parameters["@PoznamkaFormulara"].Value = poznamka;
MyConnection.Open();
MyCommand.ExecuteNonQuery();
MyConnection.Close();
}
/// <summary>
/// Naèítanie výkresu z SQL do pictureBoxu
/// pictureBox=VykresZSQLDoPictureBox(int _IDVykresu);
/// </summary>
/// <param name="_IDVyrobok"> ID výrobku</param>
public static System.Drawing.Image VykresZSQLDoPictureBox(int _IDVykresu)
{
PictureBox _pictureBox = new PictureBox();
string CmdString = ("SELECT `VykresData` FROM `tabvykres` WHERE `IDVykres` = "
+ _IDVykresu.ToString()
+ ";");
DataTable frmdatatable = new DataTable();
classSQL.SQL(CmdString, out frmdatatable);
DataRow dtrw = frmdatatable.Rows[0];
MemoryStream ms = new MemoryStream((byte[])dtrw["VykresData"]);
System.Drawing.Image img;
img = System.Drawing.Image.FromStream(ms);
return img;
// stara verzia
/*
public static System.Drawing.Image VykresZSQLDoPictureBox(int _IDVykresu)
{
PictureBox _pictureBox = new PictureBox();
string CmdString = ("SELECT `VykresData` FROM `tabvykres` WHERE `IDVykres` = "
+ _IDVykresu.ToString()
+ ";");
DataTable frmdatatable;
frmdatatable = classSQL.commandSQL(CmdString, 1);
DataRow dtrw = frmdatatable.Rows[0];
MemoryStream ms = new MemoryStream((byte[])dtrw["VykresData"]);
System.Drawing.Image img;
img = System.Drawing.Image.FromStream(ms);
return img;
}
*/
}
// pripojenie cez mysqldata.dll
private static MySqlConnection MariaDBConnection;
private static DataTable ReturnDataTable;
private static MySqlDataAdapter MariaDBdataAdapter;
private static MySqlCommandBuilder MariaDBCommandBuilder;
private static Int32 MariaDBLastIndex = 0;
public static Int32 intPocetNaStranu = 0;
public static Int32 intCelkovyPocetZazanmov = 0;
//Funkcia zistí cíšlo skupiny zo sie<69>ovej adresy 192.168.???.1
private static string IPGroup()
{
string _IPGroup="";
int intAddress = BitConverter.ToInt32(IPAddress.Parse(LocalIPAddress().ToString()).GetAddressBytes(), 0);
_IPGroup = ((intAddress & 0x00ff0000) >> 16).ToString();
return _IPGroup;
}
private static IPAddress LocalIPAddress()
{
if (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
{
return null;
}
IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());
return host
.AddressList
.FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork);
}
private static void ConnectMariaDB()
{
if (MariaDBConnection != null)
MariaDBConnection.Close();
string connStr = String.Format("server={0}; database={1}; user id={2}; password={3}; pooling=false", "192.168." + IPGroup() + ".39", "mip", "mip", "mip@2013");
MariaDBConnection = new MySqlConnection(connStr);
try
{
MariaDBConnection = new MySqlConnection(connStr);
MariaDBConnection.Open();
}
catch (MySqlException ex)
{
MessageBox.Show("Chyba pripojenia na server: " + ex.Message);
}
}
private void FindIP()
{
}
private static void DisConnectMariaDB()
{
MariaDBConnection.Close();
}
private static void MariaDBCommand(string Command)
{
try
{
DataTable celkovypocet = new DataTable();
MariaDBdataAdapter = new MySqlDataAdapter(Command, MariaDBConnection);
MariaDBCommandBuilder = new MySqlCommandBuilder(MariaDBdataAdapter);
MariaDBdataAdapter.Fill(celkovypocet);
intCelkovyPocetZazanmov = celkovypocet.Rows.Count;
}
catch (MySqlException ex)
{
MessageBox.Show("MariaDB Chyba: " + ex.Message);
}
}
/// <summary>
/// MariaDB poziadavka - s vystupom celej tabulky(DataTable)
/// </summary>
/// <param name="_cmd"> Prikaz do MariaDB</param>
/// <param name="outDataTable"> Vratena tabulka udajov</param>
public static void SQL(string _cmd, out DataTable outDataTable)
{
if (classUser.mainWindowState != FormWindowState.Minimized && classUser.boolComputerAsleep == false)
{
ConnectMariaDB();
MariaDBCommand(_cmd);
ReturnDataTable = new DataTable();
MariaDBdataAdapter.Fill(ReturnDataTable);
outDataTable = ReturnDataTable;
DisConnectMariaDB();
}
else outDataTable = null;
}
/// <summary>
/// MariaDB poziadavka - pouzitie pri strankovani s vystupom tabulky(DataTable)
/// </summary>
/// <param name="_cmd"> Prikaz do MariaDB</param>
/// <param name="_intStart"> Zaciatocny riadok tabulky</param>
/// <param name="_intCount"> Pocet riadkov na jednu stranu</param>
/// <param name="outDataTable"> Vratena tabulka udajov</param>
public static void SQL(string _cmd,Int32 _intStart, Int32 _intCount, out DataTable outDataTable)
{
if (classUser.mainWindowState != FormWindowState.Minimized && classUser.boolComputerAsleep == false)
{
ConnectMariaDB();
MariaDBCommand(_cmd);
ReturnDataTable = new DataTable();
MariaDBdataAdapter.Fill(_intStart, _intCount, ReturnDataTable);
outDataTable = ReturnDataTable;
DisConnectMariaDB();
}
else outDataTable = null;
}
/// <summary>
/// MariaDB poziadavka - pouzitie pre INSERT s vystupom posledneho vkladaneho indexu
/// </summary>
/// <param name="_cmd"> Prikaz do MariaDB (Mal by to byt INSERT) </param>
/// <param name="outLastIndex"> Vrateny index posledneho vkladaneho zaznamu </param>
public static void SQL(string _cmd, out Int32 outLastIndex)
{
if (classUser.mainWindowState != FormWindowState.Minimized && classUser.boolComputerAsleep == false)
{
ConnectMariaDB();
MariaDBCommand(_cmd);
object Index = MySqlHelper.ExecuteScalar(MariaDBConnection, "SELECT LAST_INSERT_ID();");
if (Index != null) MariaDBLastIndex = Convert.ToInt32(Index);
else MariaDBLastIndex = 0;
outLastIndex = MariaDBLastIndex;
DisConnectMariaDB();
}
else outLastIndex = 0;
}
/// <summary>
/// MariaDB poziadavka - pouzitie pre vystup jednej hodnoty z MariaDB v textovej podobe (moze to byt hodnota, cislo, suma, pocet....)
/// </summary>
/// <param name="_cmd"> Prikaz do MariaDB (prikaz by mal byt nastaveny na vystup jedinej hodnoty) </param>
/// <param name="outString"> Vratena textova hodnota </param>
public static void SQL(string _cmd, out string outString)
{
if (classUser.mainWindowState != FormWindowState.Minimized && classUser.boolComputerAsleep == false)
{
ConnectMariaDB();
MariaDBCommand(_cmd);
ReturnDataTable = new DataTable();
MariaDBdataAdapter.Fill(ReturnDataTable);
if (intCelkovyPocetZazanmov != 1) outString = "";
else outString = ReturnDataTable.Rows[0][0].ToString();
DisConnectMariaDB();
}
else outString = "";
}
/// <summary>
/// MariaDB poziadavka - pouzitie pre UPDATE alebo INSERT (nevracia ziadne hodnoty)
/// </summary>
/// <param name="_cmd"> Prikaz do MariaDB (UPDATE alebo INSERT ak nechceme index posledneho vkladaneho zaznamu) </param>
public static void SQL(string _cmd)
{
if (classUser.mainWindowState != FormWindowState.Minimized && classUser.boolComputerAsleep == false)
{
ConnectMariaDB();
MariaDBCommand(_cmd);
DisConnectMariaDB();
}
}
}
}
namespace System {
public class classSQL {
/// <summary>
/// sem pridu data z SQL - len pamä<6D>ové miesto, v podobe tabulky
/// </summary>
private static OdbcDataAdapter Adapter;
/// <summary>
/// vygenerovaný príkaz pre SQL, ktorý bude odoslaný - toto nie je text.
/// </summary>
private static OdbcCommand Command;
/// <summary>
/// kanál pre connectovanie databazy
/// </summary>
private static OdbcConnection Connection;
/// <summary>
/// datable
/// </summary>
public static DataTable dTable;
public static Int32 intCelkovyPocetZazanmov = 0;
public static Int32 intPocetNaStranu = 0;
private static MySqlCommandBuilder MariaDBCommandBuilder;
/// <summary>
/// pripojenie cez mysqldata.dll
/// </summary>
private static MySqlConnection MariaDBConnection;
private static MySqlDataAdapter MariaDBdataAdapter;
private static Int32 MariaDBLastIndex = 0;
private static MySqlCommand MyCommand;
/// <summary>
/// Deklaracia premennych pre pristup k mySQL cez MYSQL
/// </summary>
private static MySqlConnection MyConnection;
public static MySqlDataReader myData;
private static DataTable ReturnDataTable;
public classSQL(){
}
~classSQL(){
}
public virtual void Dispose(){
}
/// <summary>
/// Vykoná SQL dotaz cez ODBC a výsledok uloží do ¾ubovolnej DataTable
/// </summary>
/// <param name="cmd">Znenie dotazu</param>
/// <param name="_cmd"></param>
/// <param name="c">Konštanta napr. 1 - slúži na rozlíšenie medzi parametrickou a
/// neparametrickou commandSQL</param>
public static DataTable commandSQL(string _cmd, int c){
return null;
}
/// <summary>
/// Vykoná SQL dotaz cez ODBC a výsledok uloží do ¾ubovolnej DataTable
/// </summary>
/// <param name="cmd">Znenie dotazu</param>
public static void commandSQL(string cmd){
}
private static void ConnectMariaDB(){
}
/// <summary>
/// Pripojí classSQL.Conection k SQL serveru cez ODBC driver
/// </summary>
public static void connectSQL(){
}
private static void DisConnectMariaDB(){
}
/// <summary>
/// Export súboru (formulára) z SQL na disk
/// </summary>
/// <param name="_nazov">Nazov súbora v SQL</param>
/// <param name="_filepath">Path\Názov súbora , pod ktorým bude uložený na
/// disk</param>
public static void ExportFormToHDD(string _nazov, string _filepath){
}
/// <summary>
/// Export výkresu z SQL na HDD
/// </summary>
/// <param name="_IndexVykresu">Index výkresu z daného výrobku (výrobok môže
/// obsahova<76> viacero výkresov)</param>
/// <param name="_IDVyrobok">ID výrobku</param>
/// <param name="_indexVykresu"></param>
/// <param name="_filepath">Path\Názov súboru, do ktorého je výkres
/// vyexportovaný</param>
public static void ExportVykresToHDD(int _IDVyrobok, int _indexVykresu, string _filepath){
}
private void FindIP(){
}
/// <summary>
/// Funkcia zistí cíšlo skupiny zo sie<69>ovej adresy 192.168.???.1
/// </summary>
private static string IPGroup(){
return "";
}
private static IPAddress LocalIPAddress(){
return null;
}
///
/// <param name="Command"></param>
private static void MariaDBCommand(string Command){
}
/// <summary>
/// Uloženie formulára z RAM do SQL
/// </summary>
/// <param name="_meno">Názov formulára</param>
/// <param name="_FormularData">pole byte[], v ktorom je uložený</param>
public static void SaveFormToSQL(string _meno, byte[] _FormularData){
}
/// <summary>
/// Uloženie výkresu z RAM (byte[] _VykresData) do SQL
/// </summary>
/// <param name="_IDVyrobok">ID výrobku</param>
/// <param name="_IndexVykresu">Index výkresu z daného výrobku (výrobok môže
/// obsahova<76> viacero výkresov)</param>
/// <param name="_VykresData"></param>
public static void SaveVykresToSQL(int _IDVyrobok, int _IndexVykresu, byte [] _VykresData){
}
/// <summary>
/// MariaDB poziadavka - s vystupom celej tabulky(DataTable)
/// </summary>
/// <param name="_cmd">Prikaz do MariaDB</param>
/// <param name="outDataTable">Vratena tabulka udajov</param>
public static void SQL(string _cmd, out DataTable outDataTable){
}
/// <summary>
/// MariaDB poziadavka - pouzitie pri strankovani s vystupom tabulky(DataTable)
/// </summary>
/// <param name="_cmd">Prikaz do MariaDB</param>
/// <param name="_intStart">Zaciatocny riadok tabulky</param>
/// <param name="_intCount">Pocet riadkov na jednu stranu</param>
/// <param name="outDataTable">Vratena tabulka udajov</param>
public static void SQL(string _cmd, Int32 _intStart, Int32 _intCount, out DataTable outDataTable){
}
/// <summary>
/// MariaDB poziadavka - pouzitie pre INSERT s vystupom posledneho vkladaneho
/// indexu
/// </summary>
/// <param name="_cmd">Prikaz do MariaDB (Mal by to byt INSERT)</param>
/// <param name="outLastIndex">Vrateny index posledneho vkladaneho zaznamu</param>
public static void SQL(string _cmd, out Int32 outLastIndex){
}
/// <summary>
/// MariaDB poziadavka - pouzitie pre vystup jednej hodnoty z MariaDB v textovej
/// podobe (moze to byt hodnota, cislo, suma, pocet....)
/// </summary>
/// <param name="_cmd">Prikaz do MariaDB (prikaz by mal byt nastaveny na vystup
/// jedinej hodnoty)</param>
/// <param name="outString">Vratena textova hodnota</param>
public static void SQL(string _cmd, out string outString){
}
/// <summary>
/// MariaDB poziadavka - pouzitie pre UPDATE alebo INSERT (nevracia ziadne
/// hodnoty)
/// </summary>
/// <param name="_cmd">Prikaz do MariaDB (UPDATE alebo INSERT ak nechceme index
/// posledneho vkladaneho zaznamu)</param>
public static void SQL(string _cmd){
}
/// <summary>
/// Naèítanie výkresu z SQL do pictureBoxu pictureBox=VykresZSQLDoPictureBox(int
/// _IDVykresu);
/// </summary>
/// <param name="_IDVyrobok">ID výrobku</param>
/// <param name="_IDVykresu"></param>
public static System.Drawing.Image VykresZSQLDoPictureBox(int _IDVykresu){
return null;
}
}
}

53
Mip/app.manifest Normal file
View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel node will disable file and registry virtualization.
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<!--requestedExecutionLevel level="asInvoker" uiAccess="false" />-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet ID="Custom" SameSite="site" Unrestricted="true" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with.
Windows will automatically select the most compatible environment.-->
<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>-->
</application>
</compatibility>
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!-- <dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>-->
</asmv1:assembly>

Binary file not shown.

Binary file not shown.

BIN
Mip/bin/Debug/Mip.exe Normal file

Binary file not shown.

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source = |SQL/CE|" />
</connectionStrings>
</configuration>

BIN
Mip/bin/Debug/Mip.pdb Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source = |SQL/CE|" />
</connectionStrings>
</configuration>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel node will disable file and registry virtualization.
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<!--requestedExecutionLevel level="asInvoker" uiAccess="false" />-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet ID="Custom" SameSite="site" Unrestricted="true" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with.
Windows will automatically select the most compatible environment.-->
<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>-->
</application>
</compatibility>
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!-- <dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>-->
</asmv1:assembly>

Binary file not shown.

Binary file not shown.

BIN
Mip/bin/Debug/MyTools.dll Normal file

Binary file not shown.

Binary file not shown.

151
Mip/classDiskOperations.cs Normal file
View File

@@ -0,0 +1,151 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Management;
using System.Runtime.InteropServices;
using System.Security.AccessControl;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mip
{
static class classDiskOperations
{
public static string TempPath = Application.StartupPath + @"\MipTemp";
public static void CreatePath()
{
if (Directory.Exists(TempPath)) //adresár už existuje
{
RemovePathProtection(TempPath);
System.IO.DirectoryInfo adresar = new System.IO.DirectoryInfo(TempPath);
foreach (System.IO.FileInfo file in adresar.GetFiles()) file.Delete();
foreach (System.IO.DirectoryInfo subDirectory in adresar.GetDirectories()) subDirectory.Delete(true);
//AddPathProtection(TempPath);
}
// adresar neexistuje - vytvorenie
else
{
Directory.CreateDirectory(TempPath);
//AddPathProtection(TempPath);
}
}
public static void AddPathProtection(string _Directory)
{
string UserName = "";
SelectQuery query = new SelectQuery("Win32_UserAccount");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
foreach (ManagementObject envVar in searcher.Get())
{
UserName = envVar["Domain"].ToString() + "\\" + envVar["Name"].ToString();
DirectorySecurity ds = Directory.GetAccessControl(_Directory);
FileSystemAccessRule fsa = new FileSystemAccessRule(UserName, FileSystemRights.FullControl, AccessControlType.Deny);
ds.AddAccessRule(fsa);
Directory.SetAccessControl(_Directory, ds);
}
}
public static void RemovePathProtection(string _Directory)
{
string UserName = "";
SelectQuery query = new SelectQuery("Win32_UserAccount");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
foreach (ManagementObject envVar in searcher.Get())
{
UserName = envVar["Domain"].ToString() + "\\" + envVar["Name"].ToString();
DirectorySecurity ds = Directory.GetAccessControl(_Directory);
FileSystemAccessRule fsa = new FileSystemAccessRule(UserName, FileSystemRights.FullControl, AccessControlType.Deny);
ds.RemoveAccessRule(fsa);
Directory.SetAccessControl(_Directory, ds);
}
}
public static void RemoveCurrentUserProtecion(string _Directory)
{
string UserName = "";
UserName = Environment.UserDomainName + "\\" + Environment.UserName;
DirectorySecurity ds = Directory.GetAccessControl(_Directory);
FileSystemAccessRule fsa = new FileSystemAccessRule(UserName, FileSystemRights.FullControl, AccessControlType.Deny);
ds.RemoveAccessRule(fsa);
Directory.SetAccessControl(_Directory, ds);
}
public static void AddCurrentUserProtecion(string _Directory)
{
string UserName = "";
UserName = Environment.UserDomainName + "\\" + Environment.UserName;
DirectorySecurity ds = Directory.GetAccessControl(_Directory);
FileSystemAccessRule fsa = new FileSystemAccessRule(UserName, FileSystemRights.FullControl, AccessControlType.Deny);
ds.AddAccessRule(fsa);
Directory.SetAccessControl(_Directory, ds);
}
public static void RemovePath(string _Directory)
{
System.IO.DirectoryInfo adresar = new System.IO.DirectoryInfo(_Directory);
foreach (System.IO.FileInfo file in adresar.GetFiles()) file.Delete();
foreach (System.IO.DirectoryInfo subDirectory in adresar.GetDirectories()) subDirectory.Delete(true);
Directory.Delete(_Directory);
}
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern bool DefineDosDevice(int flags, string devname, string path);
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern int QueryDosDevice(string devname, StringBuilder buffer, int bufSize);
public static void MapDrive(char letter, string path)
{
if (!DefineDosDevice(0, devName(letter), path))
throw new Win32Exception();
}
public static void UnmapDrive(char letter)
{
if (!DefineDosDevice(2, devName(letter), null))
throw new Win32Exception();
}
public static string GetDriveMapping(char letter)
{
var sb = new StringBuilder(259);
if (QueryDosDevice(devName(letter), sb, sb.Capacity) == 0)
{
// Return empty string if the drive is not mapped
int err = Marshal.GetLastWin32Error();
if (err == 2) return "";
throw new Win32Exception();
}
return sb.ToString().Substring(4);
}
private static string devName(char letter)
{
return new string(char.ToUpper(letter), 1) + ":";
}
}
}

726
Mip/classGlobal.cs Normal file
View File

@@ -0,0 +1,726 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Management;
using System.Net.NetworkInformation;
using System.Security.AccessControl;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;
namespace Mip
{
class classGlobal
{
private static char Disk = 'W';
/// <summary>
/// Vytvorí v RAM disk W:
/// </summary>
public static void CreateRamDisk()
{
classDiskOperations.CreatePath();
//classDiskOperations.RemoveCurrentUserProtecion(classDiskOperations.TempPath);
classDiskOperations.MapDrive(Disk, classDiskOperations.TempPath);
}
/// <summary>
/// Vymaže RAM disk W:
/// </summary>
public static void DeleteRamDisk()
{
string TempPath = Application.StartupPath + @"\MipTemp";
classDiskOperations.CreatePath();
classDiskOperations.UnmapDrive(Disk);
classDiskOperations.RemovePath(TempPath);
//classDiskOperations.AddCurrentUserProtecion(classDiskOperations.TempPath);
}
//Stara verzia s pouzitim imdisk a vytvorenim noveho RAM disku
/*
private static string Disk = "W:";
//cmd /C imdisk -a -s 10M -m W: -p "/fs:fat /q /y"
//cmd /C imdisk -D -m W:
//net user administrator /active:yes
/// <summary>
/// Vytvorí v RAM disk W:
/// </summary>
public static void CreateRamDisk()
{
ProcessStartInfo procStartInfo = new ProcessStartInfo();
procStartInfo.UseShellExecute = false;
procStartInfo.CreateNoWindow = true;
procStartInfo.Verb = "runas";
procStartInfo.FileName = "cmd";
procStartInfo.Arguments = "/C imdisk -a -s 10M -m " + Disk + " -p \"/fs:fat /q /y\"";
var process = Process.Start(procStartInfo);
process.WaitForExit();
}
/// <summary>
/// Vymaže RAM disk W:
/// </summary>
public static void DeleteRamDisk()
{
ProcessStartInfo procStartInfo = new ProcessStartInfo();
procStartInfo.UseShellExecute = false;
procStartInfo.CreateNoWindow = true;
procStartInfo.FileName = "cmd";
procStartInfo.Arguments = "/C imdisk -D -m " + Disk;
Process.Start(procStartInfo);
var process = Process.Start(procStartInfo);
process.WaitForExit();
}
*/
public static string strNovyPomocnyUdaj;
/// <summary>
/// Naplna comboBox cb udajmi z SQL servera
/// </summary>
/// <param name="cb"> nazov naplnaneho comboBoxu</param>
/// <param name="strTab"> nazov tabulky z ktorej comboBox naplname</param>
/// <param name="strCollumn"> nazov stlpca z tabulky z ktorého data naplname do comboBoxu</param>
public static void FillCB(ComboBox cb, string strTab, string strCollumn)
{
DataTable dtbl = new DataTable();
string c = "SELECT DISTINCT `"
+ strCollumn + "` FROM `mip`.`"
+ strTab + "` ORDER BY "
+ strCollumn + ";";
classSQL.SQL(c, out dtbl);
cb.Items.Clear();
foreach (DataRow row in dtbl.Rows)
{
cb.Items.Add(row[strCollumn].ToString());
}
}
/// <summary>
/// Naplna comboBox cb udajmi z SQL servera
/// </summary>
/// <param name="cb"> nazov naplnaneho comboBoxu</param>
/// <param name="strTab"> nazov tabulky z ktorej comboBox naplname</param>
/// <param name="strCollumn"> nazov stlpca z tabulky z ktorého data naplname do comboBoxu</param>
/// <param name="strCollumnWhere"> nazov stlpca v ktorom sa nachadza hladana hodnota</param>
/// <param name="strHodnotaWhere"> hladana hodnota</param>
public static void FillCB(ComboBox cb, string strTab, string strCollumn, string strCollumnWhere, string strHodnotaWhere)
{
DataTable dtbl = new DataTable();
string c = "SELECT DISTINCT `" + strCollumn
+ "` FROM `mip`.`" + strTab
+ "` WHERE `" + strCollumnWhere
+ "` = '" + strHodnotaWhere
+ "' ORDER BY " + strCollumn
+ ";";
classSQL.SQL(c, out dtbl);
cb.Items.Clear();
foreach (DataRow row in dtbl.Rows)
{
cb.Items.Add(row[strCollumn].ToString());
}
}
/*
/// <summary>
/// Naplna comboBox cb udajmi z SQL servera (viac stlpcov a vrati datasource)
/// </summary>
/// <param name="cb"> nazov naplnaneho comboBoxu</param>
/// <param name="strTab"> nazov tabulky z ktorej comboBox naplname</param>
/// <param name="strCollumn"> nazov stlpca (stlpcov) z tabulky z ktorého data naplname do comboBoxu</param>
public static void FillCBMultiColumn(ComboBox cb, string strTab, string strCollumn)
{
DataTable dtbl = new DataTable();
string c = "SELECT DISTINCT `" + strCollumn
+ "` FROM `mip`.`" + strTab + "`;";
classSQL.SQL(c, out dtbl);
cb.Items.Clear();
cb.DataSource = dtbl;
}
*/
/// <summary>
/// Naplna comboBox cb udajmi z SQL servera (Urceny pre comboboxy na vydaj a prijem do skladu vyrobkov, konvertuje nazvy krabic(string na integer))
/// </summary>
/// <param name="cb"> nazov naplnaneho comboBoxu</param>
/// <param name="strTab"> nazov tabulky z ktorej comboBox naplname</param>
/// <param name="strCollumn"> nazov stlpca z tabulky z ktorého data naplname do comboBoxu</param>
/// <param name="strCollumnWhere"> nazov stlpca v ktorom sa nachadza hladana hodnota</param>
/// <param name="strHodnotaWhere"> hladana hodnota</param>
public static void FillCBSklad(ComboBox cb, string strTab, string strCollumn, string strCollumnWhere, string strHodnotaWhere)
{
//select convert(`hodnota`,int) as num from `tabpomocnychudajov` where `kategoria` = 'Pridat krabicu' order by num
DataTable dtbl = new DataTable();
string c = "SELECT DISTINCT CONVERT (`" + strCollumn + "`,int) as NUMBER "
+ " FROM `mip`.`" + strTab
+ "` WHERE `" + strCollumnWhere
+ "` = '" + strHodnotaWhere
+ "' ORDER BY NUMBER;";
classSQL.SQL(c, out dtbl);
cb.Items.Clear();
foreach (DataRow row in dtbl.Rows)
{
cb.Items.Add(row["NUMBER"].ToString());
}
}
/// <summary>
/// Naplna comboBox cb udajmi z SQL servera s pridaným textboxom ako filtrom
/// </summary>
/// <param name="cb"> nazov naplnaneho comboBoxu</param>
/// <param name="strTab"> nazov tabulky z ktorej comboBox naplname</param>
/// <param name="strCollumn"> nazov stlpca z tabulky z ktorého data naplname do comboBoxu</param>
/// <param name="strCollumnWhere"> nazov stlpca v ktorom sa nachadza hladana hodnota</param>
/// <param name="strHodnotaWhere"> hladana hodnota</param>
/// <param name="tb"> hodnota z textboxu podla ktorej sa tiez filtruju polozky v comboboxe</param>
public static void FillCB(ComboBox cb, string strTab, string strCollumn, string strCollumnWhere, string strHodnotaWhere, TextBox tb)
{
DataTable dtbl = new DataTable();
string c = "SELECT DISTINCT `" + strCollumn
+ "` FROM `mip`.`" + strTab
+ "` WHERE `" + strCollumnWhere
+ "` = '" + strHodnotaWhere
+ "' AND INSTR(`" + strCollumn + "`, '" + tb.Text + "')>0"
+ " ORDER BY " + strCollumn
+ ";";
classSQL.SQL(c, out dtbl);
cb.Items.Clear();
foreach (DataRow row in dtbl.Rows)
{
cb.Items.Add(row[strCollumn].ToString());
}
}
/// <summary>
/// Nastavi farbu riadkov v datagridview
/// </summary>
/// <param name="dgv"> nazov prefarbovaneho datagridview</param>
/// <param name="eColumnIndex"> e.columnindex odosielatela</param>
/// <param name="eRowIndex"> e.rowindex odosielatela</param>
/// <param name="eValue"> stringova hodnota e.value odosielatela</param>
public static void SetRowColor(DataGridView dgv, int eColumnIndex, int eRowIndex, string eValue)
{
if (dgv.DataSource != null)
{
if (eColumnIndex == dgv.Columns["StatusDopytu"].Index)
{
string RepVisits = eValue.ToString();
if (RepVisits != null)
{
if (RepVisits == "Prijatý" || RepVisits == "Prijatá")
{
dgv.Rows[eRowIndex].DefaultCellStyle.ForeColor = Color.Black;
dgv.Rows[eRowIndex].DefaultCellStyle.BackColor = Color.LightGray;
}
if (RepVisits == "Zrušená" || RepVisits == "Zrušený")
{
dgv.Rows[eRowIndex].DefaultCellStyle.ForeColor = Color.Red;
dgv.Rows[eRowIndex].DefaultCellStyle.BackColor = Color.MistyRose;
}
if (RepVisits == "Vo výrobe")
{
dgv.Rows[eRowIndex].DefaultCellStyle.ForeColor = Color.DarkGreen;
dgv.Rows[eRowIndex].DefaultCellStyle.BackColor = Color.Honeydew;
}
if (RepVisits == "Zaradená do výroby")
{
dgv.Rows[eRowIndex].DefaultCellStyle.ForeColor = Color.SaddleBrown;
dgv.Rows[eRowIndex].DefaultCellStyle.BackColor = Color.AntiqueWhite;
}
if (RepVisits == "Na lapovni")
{
dgv.Rows[eRowIndex].DefaultCellStyle.ForeColor = Color.MidnightBlue;
dgv.Rows[eRowIndex].DefaultCellStyle.BackColor = Color.Azure;
}
if (RepVisits == "Pozastavená" || RepVisits == "Pozastavený")
{
dgv.Rows[eRowIndex].DefaultCellStyle.ForeColor = Color.Red;
dgv.Rows[eRowIndex].DefaultCellStyle.BackColor = Color.MistyRose;
}
if (RepVisits == "Skončený" || RepVisits == "Odoslaná" || RepVisits == "Odoslaný")
{
dgv.Rows[eRowIndex].DefaultCellStyle.ForeColor = Color.Olive;
dgv.Rows[eRowIndex].DefaultCellStyle.BackColor = Color.LightGoldenrodYellow;
}
if (RepVisits == "Nacenená")
{
dgv.Rows[eRowIndex].DefaultCellStyle.ForeColor = Color.DarkMagenta;
dgv.Rows[eRowIndex].DefaultCellStyle.BackColor = Color.LavenderBlush;
}
}
}
}
}
/// <summary>
/// Nastavi farbu riadkov v datagridview
/// </summary>
/// <param name="dgv"> nazov prefarbovaneho datagridview</param>
/// <param name="str"> nazov stlpca v ktorom sa nachada status dopytu</param>
public static void SetRowColor2(DataGridView dgv, string str)
{
for (int i = 0; i < dgv.RowCount; i++)
{
switch (dgv.Rows[i].Cells[str].Value.ToString())
{
case "Vo výrobe":
case "Čiastočne odoslaná":
dgv.Rows[i].DefaultCellStyle.ForeColor = Color.DarkGreen;
dgv.Rows[i].DefaultCellStyle.BackColor = Color.Honeydew;
break;
case "Prijatý":
case "Prijatá":
dgv.Rows[i].DefaultCellStyle.ForeColor = Color.Black;
dgv.Rows[i].DefaultCellStyle.BackColor = Color.LightGray;
break;
case "Zrušená":
case "Zrušený":
dgv.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
dgv.Rows[i].DefaultCellStyle.BackColor = Color.MistyRose;
break;
case "Zaradená do výroby":
dgv.Rows[i].DefaultCellStyle.ForeColor = Color.SaddleBrown;
dgv.Rows[i].DefaultCellStyle.BackColor = Color.AntiqueWhite;
break;
case "Na lapovni":
dgv.Rows[i].DefaultCellStyle.ForeColor = Color.MidnightBlue;
dgv.Rows[i].DefaultCellStyle.BackColor = Color.Azure;
break;
case "Pozastavená":
case "Pozastavený":
dgv.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
dgv.Rows[i].DefaultCellStyle.BackColor = Color.MistyRose;
break;
case "Skončený":
case "Odoslaná":
case "Odoslaný":
dgv.Rows[i].DefaultCellStyle.ForeColor = Color.Olive;
dgv.Rows[i].DefaultCellStyle.BackColor = Color.LightGoldenrodYellow;
break;
case "Nacenená":
dgv.Rows[i].DefaultCellStyle.ForeColor = Color.DarkMagenta;
dgv.Rows[i].DefaultCellStyle.BackColor = Color.LavenderBlush;
break;
}
}
}
/// <summary>
/// Nastavi farbu riadkov v datagridview naspet na predvolenu
/// </summary>
/// <param name="dgv"> nazov prefarbovaneho datagridview</param>
/// <param name="str"> nazov stlpca v ktorom sa nachada status dopytu</param>
public static void SetRowColorBack(DataGridView dgv)
{
for (int i = 0; i < dgv.RowCount; i++)
{
dgv.Rows[i].DefaultCellStyle.ForeColor = Color.Empty;
dgv.Rows[i].DefaultCellStyle.BackColor = Color.Empty;
}
}
public static void SetCellColor(DataGridView dgv, int eColumnIndex, int eRowIndex, string eValue)
{
if (dgv.DataSource != null)
{
if (eColumnIndex == dgv.Columns["OnlineStatus"].Index)
{
string RepVisits = eValue.ToString();
if (RepVisits != null)
{
if (RepVisits == "Online")
{
dgv.Rows[eRowIndex].Cells[eColumnIndex].Style.ForeColor = Color.Green;
}
if (RepVisits == "Offline")
{
dgv.Rows[eRowIndex].Cells[eColumnIndex].Style.ForeColor = Color.Red;
}
}
}
if (eColumnIndex == dgv.Columns["Meno"].Index && dgv.Rows[eRowIndex].Cells["NoveSpravy"].Value.ToString() == "True")
{
string RepVisits = eValue.ToString();
if (RepVisits != null)
{
dgv.Rows[eRowIndex].DefaultCellStyle.BackColor = Color.Gold;
dgv.Rows[eRowIndex].Cells[eColumnIndex].Style.ForeColor = Color.Blue;
}
}
}
}
public static void SetRowColorExpedicneZaznamy(DataGridView dgv, int eColumnIndex, int eRowIndex, string eValue)
{
if (dgv.DataSource != null)
{
if (eColumnIndex == dgv.Columns["StatusSkladOperacie"].Index)
{
string RepVisits = eValue.ToString();
if (RepVisits != null)
{
if (RepVisits == "Nevybavený" || RepVisits == "Bez skladovej operácie") for (int i = 0; i < dgv.Columns.Count; i++)
{
dgv.Rows[eRowIndex].Cells[i].Style.ForeColor = Color.Green;
if (dgv.Columns[i].Name.ToString() == "DatumOperacie" ||
dgv.Columns[i].Name.ToString() == "SkladOperacia" ||
dgv.Columns[i].Name.ToString() == "StatusSkladOperacie") dgv.Rows[eRowIndex].Cells[i].ReadOnly = true;
}
if (RepVisits == "Vybavený") for (int i = 0; i < dgv.Columns.Count; i++)
{
dgv.Rows[eRowIndex].Cells[i].Style.ForeColor = Color.Red;
dgv.Rows[eRowIndex].Cells[i].ReadOnly = true;
}
}
}
}
}
public static void RowColor(DataGridView _dgv, Int32 _cI)
{
switch (_dgv.Name.ToString())
{
case "dataGridView16":
for (int i = 0; i < _dgv.RowCount; i++)
{
switch (_dgv.Rows[i].Cells["Status žiadanky"].Value.ToString())
{
case "Prijatá":
_dgv.Rows[i].DefaultCellStyle.BackColor = Color.Aqua;
break;
case "Zamietnutá":
_dgv.Rows[i].DefaultCellStyle.BackColor = Color.LightSalmon;
break;
case "Schválená":
_dgv.Rows[i].DefaultCellStyle.BackColor = Color.LightGoldenrodYellow;
break;
case "Dopyt odoslaný":
_dgv.Rows[i].DefaultCellStyle.BackColor = Color.PaleGoldenrod;
break;
case "Objednávka odoslaná":
_dgv.Rows[i].DefaultCellStyle.BackColor = Color.Tan;
break;
case "Potvrdená":
_dgv.Rows[i].DefaultCellStyle.BackColor = Color.PaleGreen;
break;
case "Tovar doručený":
_dgv.Rows[i].DefaultCellStyle.BackColor = Color.PaleTurquoise;
break;
case "Vybavená":
_dgv.Rows[i].DefaultCellStyle.BackColor = Color.LightSkyBlue;
break;
case "Nevybavená":
_dgv.Rows[i].DefaultCellStyle.BackColor = Color.MistyRose;
break;
}
}
break;
case "dataGridView7":
for (int i = 0; i < _dgv.RowCount; i++)
{
switch (_dgv.Rows[i].Cells["Status"].Value.ToString())
{
case "Prijatá":
_dgv.Rows[i].DefaultCellStyle.BackColor = Color.LightGoldenrodYellow;
break;
case "Zrušená":
_dgv.Rows[i].DefaultCellStyle.BackColor = Color.LightSalmon;
break;
case "Nacenená":
_dgv.Rows[i].DefaultCellStyle.BackColor = Color.PaleGreen;
break;
}
}
if(_cI>-1) _dgv.Columns[_cI].DefaultCellStyle.BackColor = Color.GreenYellow;
break;
}
}
// kod na zrychlenie datagridview,
public class DoubleBufferedDataGridView : DataGridView
{
public DoubleBufferedDataGridView()
{
DoubleBuffered = true;
}
}
public class MyTransparentTrackBar : TrackBar
{
protected override void OnCreateControl()
{
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
if (Parent != null)
BackColor = Parent.BackColor;
base.OnCreateControl();
}
}
public static void SetServerIP ()
{
System.Net.NetworkInformation.Ping pingIP = new System.Net.NetworkInformation.Ping();
string IPaddress = "";
PingReply pingReply;
IPaddress = "192.168.1.12"; //IP Adresa MariaDB pre VLAN1
//ked sa programuje mino firmu aby to hned naslo staticku ip
IPaddress = "87.197.164.107";
pingReply = pingIP.Send(IPaddress);
if (pingReply.Status.ToString() == "Success")
{
classUser.MariaDBServerIPAddress = IPaddress;
}
else
{
IPaddress = "192.168.1.13"; //IP Adresa MariaDB pre VLAN2
pingReply = pingIP.Send(IPaddress);
if (pingReply.Status.ToString() == "Success")
{
classUser.MariaDBServerIPAddress = IPaddress;
}
else
{
IPaddress = "87.197.164.107";
pingReply = pingIP.Send(IPaddress);
if (pingReply.Status.ToString() == "Success")
{
classUser.MariaDBServerIPAddress = IPaddress;
}
else
{
classUser.MariaDBServerIPAddress = "0.0.0.0";
MessageBox.Show("Žiadny lokálny ani internetový MariaDB server nebol nájdený!"
+ Environment.NewLine
+ "Program Mip bude ukončený! ");
Environment.Exit(0);
}
}
}
}
public static void fillExcelForm(DataTable _formToFill)
{
Excel.Application xlApp = new Excel.Application();
Excel.Workbook xlWorkBook = xlApp.Workbooks.Open(@"C:\" + _formToFill.TableName + ".xlsx");
Excel.Worksheet xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
for (int i = _formToFill.Columns.Count - 1; i >= 0; i--)
{
xlWorkBook.Names.Item(_formToFill.Columns[i].ColumnName.ToString()).RefersToRange.Value
=
_formToFill.Rows[0][i].ToString();
}
/*
range = xlWorkSheet.UsedRange;
xlWorkBook.Names.Item("ZakCislo").RefersToRange.Value = "55";
//xlWorkSheet.Cells["ZakCislo"].Value2 = "55";
xlWorkSheet.Range["D2", "F2"].Value = dtrw.Cells["ZakCislo"].Value.ToString();
xlWorkSheet.Range["G2", "K2"].Value = "Č.V.: " + dtrw.Cells["NazovVyrobku"].Value.ToString();
if (dtrw.Cells["UpravaMaterialu"].Value.ToString() == "") xlWorkSheet.Range["H6", "I6"].Value = dtrw.Cells["Material"].Value.ToString();
else xlWorkSheet.Range["H6", "I6"].Value = dtrw.Cells["Material"].Value.ToString() + "-" + dtrw.Cells["UpravaMaterialu"].Value.ToString();
DateTime date = (DateTime)dtrw.Cells["DatumPrijatiaOBJ"].Value;
xlWorkSheet.Range["B4", "C4"].Value = date.Day.ToString() + "." + date.Month.ToString() + "." + date.Year.ToString();
xlWorkSheet.Range["B6", "C6"].Value = dtrw.Cells["Zakaznik"].Value.ToString();
xlWorkSheet.Range["D6", "E6"].Value = dtrw.Cells["CisloObj"].Value.ToString();
xlWorkSheet.Range["F8", "G9"].Value = dtrw.Cells["PocetDoVyroby"].Value.ToString();
date = (DateTime)dtrw.Cells["DatumPotvrdeny"].Value;
xlWorkSheet.Range["D10", "F10"].Value = date.Day.ToString() + "." + date.Month.ToString() + "." + date.Year.ToString();
xlWorkSheet.Range["B8", "E9"].Value = dtrw.Cells["SpojeneRozmery"].Value.ToString();
if (dtrw.Cells["NazovKontraktu"].Value.ToString() == "") xlWorkSheet.Range["F5", "G5"].Value = "K.č.: --";
else xlWorkSheet.Range["F5", "G5"].Value = "K.č.: " + dtrw.Cells["NazovKontraktu"].Value.ToString();
xlWorkSheet.Range["F6", "G6"].Value = "Kon.op.: " + dtrw.Cells["RozlisZnakKonecnaOp"].Value.ToString();
if (dtrw.Cells["PoznamkaOBJ"].Value.ToString() == "") xlWorkSheet.Range["B49", "O54"].Value = "Poznámky:";
else xlWorkSheet.Range["B49", "O54"].Value = "Poznámky: " + dtrw.Cells["PoznamkaOBJ"].Value.ToString();
*/
/*
for (int i = _changes.Rows.Count; i >= 1; i--)
{
xlWorkSheet.Range[_changes.Rows[i - 1]["Start"].ToString(), _changes.Rows[i - 1]["End"].ToString()].Value = _changes.Rows[i - 1]["Value"].ToString();
}
*/
xlApp.Visible = true;
xlApp.ActiveWindow.Activate();
xlWorkSheet.PrintPreview();
xlApp.Visible = false;
xlWorkBook.Save();
xlWorkBook.Close(false, null, null);
xlApp.Quit();
}
public static void wait(Boolean _switch)
{
//Form cf = Form.ActiveForm;
//MessageBox.Show(cf.Name.ToString());
/*
if (_switch) cf.Cursor = System.Windows.Forms.Cursors.WaitCursor;
else cf.Cursor = System.Windows.Forms.Cursors.Default;
*/
if (_switch) Application.UseWaitCursor = true;
else Application.UseWaitCursor = false;
}
/// <summary>
/// Kontrola prístupu k jednotlivým komponentom MIP
/// Doposiaľ implementované komponenty:
/// 1. "Ziadanka-zobrazit vsetky"
/// 2. "Ziadanka-schvalit"
/// 3. "Ziadanka-operacie"
/// </summary>
/// <param name="_IDUSER"> ID užívateľa pre ktorého za zisťujú prístupové práva</param>
/// <param name="_NAZOVPRISTUPU"> Názov komponentu ku ktorému sa zisťuje prístup</param>
public static bool PristupovePrava(Int32 _IDUSER, string _NAZOVPRISTUPU)
{
bool bReturnValue = false;
string NazovPristupu = _NAZOVPRISTUPU;
Int32 IDUser = _IDUSER;
// 1.Čulák 2.Kuna 4.Bujna 5.Ďurčeková 8.Kúdelová 9.Bahelka 10.Štefke 11.Bulák 12.Bielich 13.Zajko 14.Bolha 15.Fiala
// 17.Poluch 18.Staňo 19.Urbaník 20.Danko 21.Močáry 22.Beneš 23.Kučerka 25.Adamcová 26.Balog 27.Kubala 28.Rybanská
// 29.Káčerová 30.Ďurček
switch (NazovPristupu)
{
case "Ziadanka-zobrazit vymazane":
switch (_IDUSER)
{
case 1:
case 4:
case 13:
case 28:
case 29:
bReturnValue = true;
break;
default:
bReturnValue = false;
break;
}
break;
case "Ziadanka-zobrazit vsetky":
switch (_IDUSER)
{
case 1:
case 4:
case 6:
case 9:
case 13:
case 28:
case 29:
bReturnValue = true;
break;
default:
bReturnValue = false;
break;
}
break;
case "Ziadanka-schvalit":
switch (_IDUSER)
{
case 1:
case 4:
case 6:
case 9:
case 13:
case 24:
case 28:
bReturnValue = true;
break;
default:
bReturnValue = false;
break;
}
break;
case "Ziadanka-operacie":
switch (_IDUSER)
{
case 1:
case 4:
case 5:
case 13:
case 24:
case 28:
bReturnValue = true;
break;
default:
bReturnValue = false;
break;
}
break;
default:
bReturnValue = false;
break;
}
return bReturnValue;
}
}
}

183
Mip/classMapa.cs Normal file
View File

@@ -0,0 +1,183 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Newtonsoft.Json;
using System.Data;
namespace Mip
{
public class AddressComponent
{
public string long_name { get; set; }
public string short_name { get; set; }
public List<string> types { get; set; }
}
public class Northeast
{
public double lat { get; set; }
public double lng { get; set; }
}
public class Southwest
{
public double lat { get; set; }
public double lng { get; set; }
}
public class Bounds
{
public Northeast northeast { get; set; }
public Southwest southwest { get; set; }
}
public class Location
{
public double lat { get; set; }
public double lng { get; set; }
}
public class Northeast2
{
public double lat { get; set; }
public double lng { get; set; }
}
public class Southwest2
{
public double lat { get; set; }
public double lng { get; set; }
}
public class Viewport
{
public Northeast2 northeast { get; set; }
public Southwest2 southwest { get; set; }
}
public class Geometry
{
public Bounds bounds { get; set; }
public Location location { get; set; }
public string location_type { get; set; }
public Viewport viewport { get; set; }
}
public class Result
{
public List<AddressComponent> address_components { get; set; }
public string formatted_address { get; set; }
public Geometry geometry { get; set; }
public List<string> types { get; set; }
}
public class RootObject
{
public List<Result> results { get; set; }
public string status { get; set; }
}
class classMapa
{
public static double zemSirka;
public static double zemDlzka;
public static DataTable dataTable;
public static void SearchGoogleAPI(string hladanyNazov, string paramArr )
{
RootObject rootObj = new RootObject();
//http://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536,-104.9847034&sensor=false
//http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true_or_false&key=API_KEY
string hs = "http://maps.googleapis.com/maps/api/geocode/json?" + paramArr + hladanyNazov + "&sensor=false";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(hs);
try
{
WebResponse response = request.GetResponse();
using (Stream responseStream = response.GetResponseStream())
{
StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);
string str = reader.ReadToEnd();
rootObj = null;
rootObj = JsonConvert.DeserializeObject<RootObject>(str);
if (rootObj.status == "OK")
{
DataTable dataTab2 = new DataTable();
dataTab2.Columns.Add("Hľadaný názov", typeof(string));
dataTab2.Columns.Add("Číslo", typeof(string));
dataTab2.Columns.Add("Ulica", typeof(string));
dataTab2.Columns.Add("Názov", typeof(string));
dataTab2.Columns.Add("Č.D.", typeof(string));
dataTab2.Columns.Add("PSČ", typeof(string));
dataTab2.Columns.Add("Krajina", typeof(string));
dataTab2.Columns.Add("Šírka", typeof(double));
dataTab2.Columns.Add("Dĺžka", typeof(double));
dataTab2.Columns.Add("ViewSV-šírka", typeof(double));
dataTab2.Columns.Add("ViewSV-dížka", typeof(double));
dataTab2.Columns.Add("ViewJZ-šírka", typeof(double));
dataTab2.Columns.Add("ViewJZ-dížka", typeof(double));
foreach (Result rs in rootObj.results)
{
DataRow newDataRow = dataTab2.NewRow();
zemSirka = rs.geometry.location.lat;
zemDlzka = rs.geometry.location.lng;
foreach (AddressComponent ac in rs.address_components)
{
if (ac.types[0] == "street_number") newDataRow["Číslo"] = ac.long_name.ToString();
if (ac.types[0] == "route") newDataRow["Ulica"] = ac.long_name.ToString();
if (ac.types[0] == "locality") newDataRow["Názov"] = ac.long_name.ToString();
if (ac.types[0] == "country") newDataRow["Krajina"] = ac.long_name.ToString();
if (ac.types[0] == "postal_code") newDataRow["PSČ"] = ac.long_name.ToString();
if (ac.types[0] == "premise") newDataRow["Č.D."] = ac.long_name.ToString();
}
newDataRow["Hľadaný názov"] = rs.formatted_address;
newDataRow["Šírka"] = rs.geometry.location.lat;
newDataRow["Dĺžka"] = rs.geometry.location.lng;
newDataRow["ViewSV-šírka"] = rs.geometry.viewport.northeast.lat;
newDataRow["ViewSV-dížka"] = rs.geometry.viewport.northeast.lng;
newDataRow["ViewJZ-šírka"] = rs.geometry.viewport.southwest.lat;
newDataRow["ViewJZ-dížka"] = rs.geometry.viewport.southwest.lng;
dataTab2.Rows.Add(newDataRow);
dataTab2.AcceptChanges();
}
dataTable = dataTab2;
}
}
}
catch (WebException ex)
{
WebResponse errorResponse = ex.Response;
using (Stream responseStream = errorResponse.GetResponseStream())
{
StreamReader reader = new StreamReader(responseStream, Encoding.GetEncoding("utf-8"));
String errorText = reader.ReadToEnd();
// log errorText
}
throw;
}
}
}
}

546
Mip/classSQL.cs Normal file
View File

@@ -0,0 +1,546 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using System.IO;
using System.Net.Sockets;
using System.Net;
using System.Drawing;
namespace Mip
{
class classSQL
{
//Deklaracia premennych pre pristup k mySQL cez MYSQL.data
private static MySqlConnection MyConnection;
private static MySqlCommand MyCommand;
public static MySqlDataReader myData;
/////////////////////////////////////////////////////////////////////
/// <summary>
/// Export súboru (formulára) z SQL na disk
/// </summary>
/// <param name="_nazov"> Nazov súbora v SQL</param>
/// <param name="_filepath"> Path\Názov súbora , pod ktorým bude uložený na disk</param>
public static void ExportFormToHDD(string _nazov,string _filepath)
{
string ServerIP = classUser.MariaDBServerIPAddress;
MyConnection = new MySqlConnection("server=" + ServerIP + ";database=mip; User=mip;Password=mip@2013;;");
byte[] FilewData;
string CmdString = ("SELECT `DataSuboru`,(LENGTH (`DataSuboru`)) AS `size` FROM `tabformular` WHERE `NazovSuboru` LIKE '%"+_nazov+"%';");
MyCommand = new MySqlCommand(CmdString, MyConnection);
MyConnection.Open();
myData = MyCommand.ExecuteReader();
myData.Read();
FilewData = new byte[Convert.ToInt32(myData[1])];
Array.Copy((byte[])myData[0], FilewData, Convert.ToInt32(myData[1]));
FileStream fs;
fs = new FileStream(_filepath, FileMode.CreateNew, FileAccess.Write);
fs.Write(FilewData, 0, FilewData.Length);
MyConnection.Close();
fs.Close();
}
/// <summary>
/// Uloženie výkresu z RAM (byte[] _VykresData) do SQL
/// </summary>
/// <param name="_IDVyrobok"> ID výrobku</param>
/// <param name="_IndexVykresu"> Index výkresu z daného výrobku (výrobok môže obsahovať viacero výkresov)</param>
/// <param name="_VykresData"> pole byte[], v ktorom je uložený obrázok</param>
public static void SaveVykresToSQL(int _IDVyrobok,int _IndexVykresu, byte [] _VykresData)
{
string ServerIP = classUser.MariaDBServerIPAddress;
MyConnection = new MySqlConnection("server=" + ServerIP + ";database=mip; User=mip;Password=mip@2013;;");
string CmdString = "INSERT INTO `mip`.`tabvykres` (IDVyrobok,IndexVykresu,VykresData) VALUES(@IDVyrobok,@IndexVykresu,@VykresData)";
MyCommand = new MySqlCommand(CmdString, MyConnection);
MyCommand.Parameters.Add("@IDVyrobok", MySqlDbType.Int32);
MyCommand.Parameters.Add("@IndexVykresu", MySqlDbType.Int32);
MyCommand.Parameters.Add("@VykresData", MySqlDbType.MediumBlob);
MyCommand.Parameters["@IDVyrobok"].Value = _IDVyrobok;
MyCommand.Parameters["@IndexVykresu"].Value = _IndexVykresu;
MyCommand.Parameters["@VykresData"].Value = _VykresData;
MyConnection.Open();
MyCommand.ExecuteNonQuery();
MyConnection.Close();
}
/// <summary>
/// Export výkresu z SQL na HDD
/// </summary>
/// <param name="_IDVyrobok"> ID výrobku</param>
/// <param name="_IndexVykresu"> Index výkresu z daného výrobku (výrobok môže obsahovať viacero výkresov)</param>
/// <param name="_filepath"> Path\Názov súboru, do ktorého je výkres vyexportovaný</param>
public static void ExportVykresToHDD(int _IDVyrobok,int _indexVykresu, string _filepath)
{
string ServerIP = classUser.MariaDBServerIPAddress;
MyConnection = new MySqlConnection("server=" + ServerIP + ";database=mip; User=mip;Password=mip@2013;;");
byte[] FilewData;
string CmdString = ("SELECT `VykresData`,(LENGTH (`VykresData`)) AS `size` FROM `tabvykres` WHERE `IDVyrobok` = " + _IDVyrobok.ToString() + " AND `IndexVykresu`= (SELECT min(`IndexVykresu`) FROM `tabvykres` WHERE `IDVyrobok` = " + _IDVyrobok.ToString() + ");");
MyCommand = new MySqlCommand(CmdString, MyConnection);
MyConnection.Open();
myData = MyCommand.ExecuteReader();
myData.Read();
FilewData = new byte[Convert.ToInt32(myData[1])];
Array.Copy((byte[])myData[0], FilewData, Convert.ToInt32(myData[1]));
RotateImage(ref FilewData);
FileStream fs;
fs = new FileStream(_filepath, FileMode.CreateNew, FileAccess.Write);
fs.Write(FilewData, 0, FilewData.Length);
MyConnection.Close();
fs.Close();
}
public static void RotateImage(ref byte[] _filedata)
{
MemoryStream msOld = new MemoryStream(_filedata);
Image img = Image.FromStream(msOld);
if(img.Height>img.Width)
{
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
MemoryStream msNew = new MemoryStream();
img.Save(msNew, System.Drawing.Imaging.ImageFormat.Jpeg);
_filedata = msNew.ToArray();
}
}
/// <summary>
/// Uloženie formulára z RAM do SQL
/// </summary>
/// <param name="_meno"> Názov formulára</param>
/// <param name="_FormularData"> pole byte[], v ktorom je uložený formulár</param>
public static void SaveFormToSQL(string _meno,byte[] _FormularData)
{
string ServerIP = classUser.MariaDBServerIPAddress;
MyConnection = new MySqlConnection("server=" + ServerIP + ";database=mip; User=mip;Password=mip@2013;;");
String poznamka = Microsoft.VisualBasic.Interaction.InputBox(null, "Zadaj poznámku k formuláru:");
string CmdString = "INSERT INTO `mip`.`tabformular` (NazovSuboru,DataSuboru,PoznamkaFormulara) VALUES(@NazovSuboru,@DataSuboru,@PoznamkaFormulara)";
MyCommand = new MySqlCommand(CmdString, MyConnection);
MyCommand.Parameters.Add("@NazovSuboru", MySqlDbType.String);
MyCommand.Parameters.Add("@DataSuboru", MySqlDbType.MediumBlob);
MyCommand.Parameters.Add("@PoznamkaFormulara", MySqlDbType.String);
MyCommand.Parameters["@NazovSuboru"].Value = _meno;
MyCommand.Parameters["@DataSuboru"].Value = _FormularData;
MyCommand.Parameters["@PoznamkaFormulara"].Value = poznamka;
MyConnection.Open();
MyCommand.ExecuteNonQuery();
MyConnection.Close();
}
/// <summary>
/// Načítanie výkresu z SQL do pictureBoxu
/// pictureBox=VykresZSQLDoPictureBox(int _IDVykresu);
/// </summary>
/// <param name="_IDVyrobok"> ID výrobku</param>
public static System.Drawing.Image VykresZSQLDoPictureBox(int _IDVykresu)
{
PictureBox _pictureBox = new PictureBox();
string CmdString = ("SELECT `VykresData` FROM `tabvykres` WHERE `IDVykres` = "
+ _IDVykresu.ToString()
+ ";");
DataTable frmdatatable = new DataTable();
classSQL.SQL(CmdString, out frmdatatable);
DataRow dtrw = frmdatatable.Rows[0];
MemoryStream ms = new MemoryStream((byte[])dtrw["VykresData"]);
System.Drawing.Image img;
img = System.Drawing.Image.FromStream(ms);
return img;
}
/// <summary>
/// Uloženie (alebo nahradenie ak uz existuje) nákresu z RAM (byte[] _NakresData) do SQL. Pri nahradení pôvodný obrázok vymaže a potom vloží nový.
/// </summary>
/// <param name="_IDVyrobok"> ID žiadanka</param>
/// <param name="_NakresData"> pole byte[], v ktorom je uložený nákres</param>
public static void SaveNakresToSQL(int _IDZiadanka, byte[] _NakresData)
{
string ServerIP = classUser.MariaDBServerIPAddress;
MyConnection = new MySqlConnection("server=" + ServerIP + ";database=mip; User=mip;Password=mip@2013;;");
classSQL.SQL("DELETE FROM `mip`.`tabziadankanakres` WHERE `IDZiadanka` = " + _IDZiadanka.ToString());
string CmdString = "INSERT INTO `mip`.`tabziadankanakres` (`IDZiadanka`, `NakresData`) VALUES(@IDZiadanka, @NakresData)";
MyCommand = new MySqlCommand(CmdString, MyConnection);
MyCommand.Parameters.Add("@IDZiadanka", MySqlDbType.Int32);
MyCommand.Parameters.Add("@NakresData", MySqlDbType.MediumBlob);
MyCommand.Parameters["@IDZiadanka"].Value = _IDZiadanka;
MyCommand.Parameters["@NakresData"].Value = _NakresData;
MyConnection.Open();
if(_NakresData != null) MyCommand.ExecuteNonQuery();
MyConnection.Close();
}
// pripojenie cez mysqldata.dll
private static MySqlConnection MariaDBConnection;
private static DataTable ReturnDataTable;
private static MySqlDataAdapter MariaDBdataAdapter;
private static MySqlCommandBuilder MariaDBCommandBuilder;
private static Int32 MariaDBLastIndex = 0;
public static Int32 intPocetNaStranu = 0;
public static Int32 intCelkovyPocetZazanmov = 0;
// Nepouziva sa lebo vsetky IP adresy su x.x.1.x
/*
//Funkcia zistí cíšlo skupiny zo sieťovej adresy 192.168.???.1
private static string IPGroup()
{
string _IPGroup="";
int intAddress = BitConverter.ToInt32(IPAddress.Parse(LocalIPAddress().ToString()).GetAddressBytes(), 0);
_IPGroup = ((intAddress & 0x00ff0000) >> 16).ToString();
return _IPGroup;
}
private static IPAddress LocalIPAddress()
{
if (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
{
return null;
}
IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());
return host
.AddressList
.FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork);
}
*/
// Nepouziva sa lebo vsetky IP adresy su x.x.1.x
//stara verzia na siet 192.168.2.39 a 192.168.1.39
/*
private static void ConnectMariaDB()
{
if (MariaDBConnection != null)
MariaDBConnection.Close();
string connStr = String.Format("server={0}; database={1}; user id={2}; password={3}; pooling=false", "192.168." + IPGroup() + ".39", "mip", "mip", "mip@2013");
MariaDBConnection = new MySqlConnection(connStr);
try
{
MariaDBConnection = new MySqlConnection(connStr);
MariaDBConnection.Open();
}
catch (MySqlException ex)
{
DialogResult dr = MessageBox.Show("Chyba pripojenia na server: " + ex.Message
+ Environment.NewLine
+ Environment.NewLine
+ "Po stačení tlačidla Yes, sa program skúsi pripojiť cez internet!"
+ Environment.NewLine
+ "Tlačidlo No ukončí program MIP"
, "MariaDB server nedostupný!", MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
{
string ServerIP = "87.197.164.107";
connStr = String.Format("server={0}; database={1}; user id={2}; password={3}; pooling=false", ServerIP, "mip", "mip", "mip@2013");
MariaDBConnection = new MySqlConnection(connStr);
try
{
MariaDBConnection = new MySqlConnection(connStr);
MariaDBConnection.Open();
}
catch (MySqlException ex2)
{
MessageBox.Show("Chyba pripojenia na server cez internet: " + ex2.Message
+ Environment.NewLine
+ Environment.NewLine
+ "Program Mip bude ukončený! ");
Environment.Exit(0);
}
}
else Environment.Exit(0);
}
}
*/
private static void ConnectMariaDB()
{
if (MariaDBConnection != null)
MariaDBConnection.Close();
string connStr = String.Format("server={0}; database={1}; user id={2}; password={3}; pooling=false", classUser.MariaDBServerIPAddress, "mip", "mip", "mip@2013");
MariaDBConnection = new MySqlConnection(connStr);
try
{
MariaDBConnection = new MySqlConnection(connStr);
MariaDBConnection.Open();
}
catch (MySqlException ex)
{
DialogResult dr = MessageBox.Show("Chyba pripojenia na server: " + ex.Message
+ Environment.NewLine
+ Environment.NewLine
+ "Po stačení tlačidla Yes, sa program skúsi zistiť IP adresu servera MariaDB!"
+ Environment.NewLine
+ "Tlačidlo No ukončí program MIP"
, "MariaDB server nedostupný!", MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
{
classGlobal.SetServerIP();
connStr = String.Format("server={0}; database={1}; user id={2}; password={3}; pooling=false", classUser.MariaDBServerIPAddress, "mip", "mip", "mip@2013");
MariaDBConnection = new MySqlConnection(connStr);
try
{
MariaDBConnection = new MySqlConnection(connStr);
MariaDBConnection.Open();
}
catch (MySqlException ex2)
{
MessageBox.Show("Chyba pripojenia na server MariaDB: " + ex2.Message
+ Environment.NewLine
+ Environment.NewLine
+ "Program Mip bude ukončený! ");
Environment.Exit(0);
}
}
else Environment.Exit(0);
}
}
/*
private void FindIP()
{
}
*/
private static void DisConnectMariaDB()
{
MariaDBConnection.Close();
}
private static void MariaDBCommand(string Command, bool Zistipocet)
{
try
{
DataTable celkovypocet = new DataTable();
MariaDBdataAdapter = new MySqlDataAdapter(Command, MariaDBConnection);
MariaDBCommandBuilder = new MySqlCommandBuilder(MariaDBdataAdapter);
if (Zistipocet == true)
{
MariaDBdataAdapter.Fill(celkovypocet);
intCelkovyPocetZazanmov = celkovypocet.Rows.Count;
}
}
catch (MySqlException ex)
{
MessageBox.Show("MariaDB Chyba: " + ex.Message);
}
}
/// <summary>
/// MariaDB poziadavka - s vystupom celej tabulky(DataTable)
/// </summary>
/// <param name="_cmd"> Prikaz do MariaDB</param>
/// <param name="outDataTable"> Vratena tabulka udajov</param>
public static void SQL(string _cmd, out DataTable outDataTable)
{
if (classUser.mainWindowState != FormWindowState.Minimized && classUser.boolComputerAsleep == false)
{
//classGlobal.wait(true);
ConnectMariaDB();
MariaDBCommand(_cmd,true);
ReturnDataTable = new DataTable();
MariaDBdataAdapter.Fill(ReturnDataTable);
outDataTable = ReturnDataTable;
DisConnectMariaDB();
//classGlobal.wait(false);
}
else outDataTable = null;
}
/// <summary>
/// MariaDB poziadavka - pouzitie pri strankovani s vystupom tabulky(DataTable)
/// </summary>
/// <param name="_cmd"> Prikaz do MariaDB</param>
/// <param name="_intStart"> Zaciatocny riadok tabulky</param>
/// <param name="_intCount"> Pocet riadkov na jednu stranu</param>
/// <param name="outDataTable"> Vratena tabulka udajov</param>
public static void SQL(string _cmd,Int32 _intStart, Int32 _intCount, out DataTable outDataTable)
{
if (classUser.mainWindowState != FormWindowState.Minimized && classUser.boolComputerAsleep == false)
{
//classGlobal.wait(true);
ConnectMariaDB();
MariaDBCommand(_cmd,true);
ReturnDataTable = new DataTable();
MariaDBdataAdapter.Fill(_intStart, _intCount, ReturnDataTable);
outDataTable = ReturnDataTable;
DisConnectMariaDB();
//classGlobal.wait(false);
}
else outDataTable = null;
}
/// <summary>
/// MariaDB poziadavka - pouzitie pre INSERT s vystupom posledneho vkladaneho indexu
/// </summary>
/// <param name="_cmd"> Prikaz do MariaDB (Mal by to byt INSERT) </param>
/// <param name="outLastIndex"> Vrateny index posledneho vkladaneho zaznamu </param>
public static void SQL(string _cmd, out Int32 outLastIndex)
{
if (classUser.mainWindowState != FormWindowState.Minimized && classUser.boolComputerAsleep == false)
{
//classGlobal.wait(true);
ConnectMariaDB();
MariaDBCommand(_cmd,true);
object Index = MySqlHelper.ExecuteScalar(MariaDBConnection, "SELECT LAST_INSERT_ID();");
if (Index != null) MariaDBLastIndex = Convert.ToInt32(Index);
else MariaDBLastIndex = 0;
outLastIndex = MariaDBLastIndex;
DisConnectMariaDB();
//classGlobal.wait(false);
}
else outLastIndex = 0;
}
/// <summary>
/// MariaDB poziadavka - pouzitie pre vystup jednej hodnoty z MariaDB v textovej podobe (moze to byt hodnota, cislo, suma, pocet....)
/// </summary>
/// <param name="_cmd"> Prikaz do MariaDB (prikaz by mal byt nastaveny na vystup jedinej hodnoty) </param>
/// <param name="outString"> Vratena textova hodnota </param>
public static void SQL(string _cmd, out string outString)
{
if (classUser.mainWindowState != FormWindowState.Minimized && classUser.boolComputerAsleep == false)
{
//classGlobal.wait(true);
ConnectMariaDB();
MariaDBCommand(_cmd,true);
ReturnDataTable = new DataTable();
MariaDBdataAdapter.Fill(ReturnDataTable);
if (intCelkovyPocetZazanmov != 1) outString = "";
else outString = ReturnDataTable.Rows[0][0].ToString();
DisConnectMariaDB();
//classGlobal.wait(false);
}
else outString = "";
}
/// <summary>
/// MariaDB poziadavka - pouzitie pre UPDATE alebo INSERT (nevracia ziadne hodnoty)
/// </summary>
/// <param name="_cmd"> Prikaz do MariaDB (UPDATE alebo INSERT ak nechceme index posledneho vkladaneho zaznamu) </param>
public static void SQL(string _cmd)
{
if (classUser.mainWindowState != FormWindowState.Minimized && classUser.boolComputerAsleep == false)
{
//classGlobal.wait(true);
ConnectMariaDB();
MariaDBCommand(_cmd, true);
DisConnectMariaDB();
//classGlobal.wait(false);
}
}
/// <summary>
/// MariaDB poziadavka - pouzitie pri strankovani s vystupom tabulky(DataTable) bez zisťovania celkoveho poctu zaznamov
/// </summary>
/// <param name="_cmd"> Prikaz do MariaDB</param>
/// <param name="_intStart"> Zaciatocny riadok tabulky</param>
/// <param name="_intCount"> Pocet riadkov na jednu stranu</param>
/// <param name="outDataTable"> Vratena tabulka udajov</param>
public static void SQL(string _cmd, bool zistiPocet, Int32 _intStart, Int32 _intCount, out DataTable outDataTable)
{
if (classUser.mainWindowState != FormWindowState.Minimized && classUser.boolComputerAsleep == false)
{
//classGlobal.wait(true);
ConnectMariaDB();
MariaDBCommand(_cmd, zistiPocet);
ReturnDataTable = new DataTable();
MariaDBdataAdapter.Fill(_intStart, _intCount, ReturnDataTable);
outDataTable = ReturnDataTable;
DisConnectMariaDB();
//classGlobal.wait(false);
}
else outDataTable = null;
}
/// <summary>
/// MariaDB poziadavka - pouzitie pre vystup jednej hodnoty z MariaDB vo forme byte[] (mozu to byt data obrazku alebo formulara)
/// </summary>
/// <param name="_cmd"> Prikaz do MariaDB (prikaz by mal byt nastaveny na vystup jedinej hodnoty) </param>
/// <param name="outString"> Vratena byte[] hodnota </param>
public static void SQL(string _cmd, out byte[] filedata)
{
if (classUser.mainWindowState != FormWindowState.Minimized && classUser.boolComputerAsleep == false)
{
//classGlobal.wait(true);
ConnectMariaDB();
MariaDBCommand(_cmd, true);
ReturnDataTable = new DataTable();
MariaDBdataAdapter.Fill(ReturnDataTable);
if (intCelkovyPocetZazanmov != 1) filedata = null;
else filedata = (byte[])ReturnDataTable.Rows[0][0];
DisConnectMariaDB();
//classGlobal.wait(false);
}
else filedata = null;
}
}
}

39
Mip/classUser.cs Normal file
View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mip
{
class classUser
{
public static int ID;
public static string Titul;
public static string Meno;
public static string Priezvisko;
public static string Zaradenie;
public static int Tab;
public static string MariaDBServerIPAddress;
public static Int32 IndexZmatkovitost;
public static Int32 IndexExpedicia;
public static Int32 IndexDopyt;
public static Int32 IndexVyrobok;
public static Int32 IndexVydajMat;
public static Int32 IndexRV;
public static Int32 IndexChat;
public static Int32 IndexNacenovanie;
public static Int32 IndexPoziadavka;
//public static Int32 IndexEXP;
public static Int32 IndexZoznamVyrobkov;
public static string strLastSelect;
public static FormWindowState mainWindowState = FormWindowState.Normal;
public static bool boolComputerAsleep = false; //sluzi na zablokovanie pristupu do sql pokial je pocitac v rezime spanku
public static bool boolEnableRowEnter = true; //sluzi na zablokovanie inych funkcii aby sa nevykonavali pokial sa vykonava funkcia check v frmMain v karte dopytov
//public static Int32 IndexVykres;
}
}

417
Mip/frmAddCenovuPonuku.Designer.cs generated Normal file
View File

@@ -0,0 +1,417 @@
namespace Mip
{
partial class frmAddCenovuPonuku
{
/// <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 Windows Form 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.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.comboBox3 = new System.Windows.Forms.ComboBox();
this.comboBox4 = new System.Windows.Forms.ComboBox();
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.panel1 = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
this.label16 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.label17 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label1.Location = new System.Drawing.Point(1, 1);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(401, 28);
this.label1.TabIndex = 0;
this.label1.Text = "Názov výrobku";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label2.Location = new System.Drawing.Point(1, 28);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(401, 28);
this.label2.TabIndex = 1;
this.label2.Text = "---";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label3
//
this.label3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label3.Location = new System.Drawing.Point(1, 57);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(200, 22);
this.label3.TabIndex = 2;
this.label3.Text = "Zákazník";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label4
//
this.label4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label4.Location = new System.Drawing.Point(1, 78);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(200, 22);
this.label4.TabIndex = 3;
this.label4.Text = "---";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label5
//
this.label5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label5.Location = new System.Drawing.Point(1, 101);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(200, 22);
this.label5.TabIndex = 4;
this.label5.Text = "Spojené rozmery";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label6
//
this.label6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label6.Location = new System.Drawing.Point(1, 122);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(200, 22);
this.label6.TabIndex = 5;
this.label6.Text = "---";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label7
//
this.label7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label7.Location = new System.Drawing.Point(202, 101);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(200, 22);
this.label7.TabIndex = 6;
this.label7.Text = "Počet segmentov";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label8
//
this.label8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label8.Location = new System.Drawing.Point(202, 122);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(200, 22);
this.label8.TabIndex = 7;
this.label8.Text = "---";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label9
//
this.label9.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label9.Location = new System.Drawing.Point(202, 57);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(200, 22);
this.label9.TabIndex = 8;
this.label9.Text = "Dátum prijatia";
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label10
//
this.label10.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label10.Location = new System.Drawing.Point(202, 78);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(200, 22);
this.label10.TabIndex = 9;
this.label10.Text = "---";
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label11
//
this.label11.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label11.Location = new System.Drawing.Point(1, 71);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(401, 28);
this.label11.TabIndex = 10;
this.label11.Text = "Naceňované materiály";
this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(70, 100);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(129, 21);
this.comboBox1.TabIndex = 11;
//
// comboBox2
//
this.comboBox2.Enabled = false;
this.comboBox2.FormattingEnabled = true;
this.comboBox2.Location = new System.Drawing.Point(70, 123);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(129, 21);
this.comboBox2.TabIndex = 12;
//
// comboBox3
//
this.comboBox3.Enabled = false;
this.comboBox3.FormattingEnabled = true;
this.comboBox3.Location = new System.Drawing.Point(271, 100);
this.comboBox3.Name = "comboBox3";
this.comboBox3.Size = new System.Drawing.Size(129, 21);
this.comboBox3.TabIndex = 13;
//
// comboBox4
//
this.comboBox4.Enabled = false;
this.comboBox4.FormattingEnabled = true;
this.comboBox4.Location = new System.Drawing.Point(271, 123);
this.comboBox4.Name = "comboBox4";
this.comboBox4.Size = new System.Drawing.Size(129, 21);
this.comboBox4.TabIndex = 14;
//
// numericUpDown1
//
this.numericUpDown1.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.numericUpDown1.Location = new System.Drawing.Point(1, 30);
this.numericUpDown1.Maximum = new decimal(new int[] {
100000,
0,
0,
0});
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(401, 40);
this.numericUpDown1.TabIndex = 15;
this.numericUpDown1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.Snow;
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.label5);
this.panel1.Controls.Add(this.label6);
this.panel1.Controls.Add(this.label7);
this.panel1.Controls.Add(this.label10);
this.panel1.Controls.Add(this.label8);
this.panel1.Controls.Add(this.label9);
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(405, 147);
this.panel1.TabIndex = 16;
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.Beige;
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel2.Controls.Add(this.label16);
this.panel2.Controls.Add(this.label15);
this.panel2.Controls.Add(this.comboBox4);
this.panel2.Controls.Add(this.numericUpDown1);
this.panel2.Controls.Add(this.comboBox3);
this.panel2.Controls.Add(this.label14);
this.panel2.Controls.Add(this.comboBox2);
this.panel2.Controls.Add(this.label13);
this.panel2.Controls.Add(this.comboBox1);
this.panel2.Controls.Add(this.label12);
this.panel2.Controls.Add(this.label11);
this.panel2.Location = new System.Drawing.Point(0, 148);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(405, 148);
this.panel2.TabIndex = 17;
//
// label16
//
this.label16.BackColor = System.Drawing.Color.LightSalmon;
this.label16.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label16.Location = new System.Drawing.Point(202, 123);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(67, 22);
this.label16.TabIndex = 15;
this.label16.Text = "Materiál č. 4";
this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label16.Click += new System.EventHandler(this.label16_Click);
//
// label15
//
this.label15.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label15.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label15.Location = new System.Drawing.Point(1, 1);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(401, 28);
this.label15.TabIndex = 14;
this.label15.Text = "Počet naceňovaných kusov";
this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label14
//
this.label14.BackColor = System.Drawing.Color.LightSalmon;
this.label14.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label14.Location = new System.Drawing.Point(202, 100);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(67, 22);
this.label14.TabIndex = 13;
this.label14.Text = "Materiál č. 3";
this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label14.Click += new System.EventHandler(this.label14_Click);
//
// label13
//
this.label13.BackColor = System.Drawing.Color.LightSalmon;
this.label13.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label13.Location = new System.Drawing.Point(1, 123);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(67, 22);
this.label13.TabIndex = 12;
this.label13.Text = "Materiál č. 2";
this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label13.Click += new System.EventHandler(this.label13_Click);
//
// label12
//
this.label12.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label12.Location = new System.Drawing.Point(1, 100);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(67, 22);
this.label12.TabIndex = 11;
this.label12.Text = "Materiál č.1";
this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.button1.Location = new System.Drawing.Point(0, 356);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(139, 26);
this.button1.TabIndex = 18;
this.button1.Tag = "add";
this.button1.Text = "Pridať cenovú ponuku";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button2.Location = new System.Drawing.Point(305, 356);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(100, 26);
this.button2.TabIndex = 19;
this.button2.Text = "Zavrieť";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// label17
//
this.label17.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label17.Location = new System.Drawing.Point(0, 297);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(69, 59);
this.label17.TabIndex = 20;
this.label17.Text = "Poznámka";
this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(71, 297);
this.textBox1.MaxLength = 150;
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(332, 59);
this.textBox1.TabIndex = 21;
//
// frmAddCenovuPonuku
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(405, 382);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label17);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "frmAddCenovuPonuku";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Pridať cenovú ponuku";
this.Shown += new System.EventHandler(this.frmAddCenovuPonuku_Shown);
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
this.panel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.ComboBox comboBox2;
private System.Windows.Forms.ComboBox comboBox3;
private System.Windows.Forms.ComboBox comboBox4;
private System.Windows.Forms.NumericUpDown numericUpDown1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.TextBox textBox1;
}
}

177
Mip/frmAddCenovuPonuku.cs Normal file
View File

@@ -0,0 +1,177 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mip
{
public partial class frmAddCenovuPonuku : Form
{
string nazovVyrobku;
Int32 IDVyrobok;
Int32 IDNacenovanie;
string zakaznik;
string spojeneRozmery;
int pocetSegmentov;
DataTable tblEditData;
public frmAddCenovuPonuku(string _nazovVyrobku, Int32 _IDVyrobok, string _zakaznik, string _spojeneRozmery, int _pocetSegmentov)
{
InitializeComponent();
nazovVyrobku = _nazovVyrobku;
IDVyrobok = _IDVyrobok;
zakaznik = _zakaznik;
spojeneRozmery = _spojeneRozmery;
pocetSegmentov = _pocetSegmentov;
label2.Text = nazovVyrobku;
label4.Text = zakaznik;
label6.Text = spojeneRozmery;
label10.Text = DateTime.Today.Day.ToString() + "." + DateTime.Today.Month.ToString() + "." + DateTime.Today.Year.ToString();
label8.Text = pocetSegmentov.ToString();
}
public frmAddCenovuPonuku(string _nazovVyrobku, Int32 _IDVyrobok, string _zakaznik, string _spojeneRozmery, int _pocetSegmentov, Int32 _IDNacenovanie)
{
InitializeComponent();
nazovVyrobku = _nazovVyrobku;
IDVyrobok = _IDVyrobok;
zakaznik = _zakaznik;
spojeneRozmery = _spojeneRozmery;
pocetSegmentov = _pocetSegmentov;
IDNacenovanie = _IDNacenovanie;
label2.Text = nazovVyrobku;
label4.Text = zakaznik;
label6.Text = spojeneRozmery;
label8.Text = pocetSegmentov.ToString();
string cmd;
cmd = "SELECT * FROM `tab-nacenovanie` WHERE `IDNacenovanie` = " + IDNacenovanie.ToString() + ";";
classSQL.SQL(cmd, out tblEditData);
numericUpDown1.Value = Convert.ToInt32(tblEditData.Rows[0]["PocetNacenovanychKusov"].ToString());
label10.Text = tblEditData.Rows[0]["DatumPrijatia"].ToString();
comboBox1.Text = tblEditData.Rows[0]["Material1"].ToString();
comboBox2.Text = tblEditData.Rows[0]["Material2"].ToString();
comboBox3.Text = tblEditData.Rows[0]["Material3"].ToString();
comboBox4.Text = tblEditData.Rows[0]["Material4"].ToString();
textBox1.Text = tblEditData.Rows[0]["Poznamka"].ToString();
if (comboBox2.Text != "") { comboBox2.Enabled = true; label13.BackColor = Color.Beige; }
if (comboBox3.Text != "") { comboBox3.Enabled = true; label14.BackColor = Color.Beige; }
if (comboBox4.Text != "") { comboBox4.Enabled = true; label16.BackColor = Color.Beige; }
button1.Text = "Uložiť cenovú ponuku";
button1.Tag = "edit";
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void frmAddCenovuPonuku_Shown(object sender, EventArgs e)
{
classGlobal.FillCB(comboBox1, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať materiál");
classGlobal.FillCB(comboBox2, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať materiál");
classGlobal.FillCB(comboBox3, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať materiál");
classGlobal.FillCB(comboBox4, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať materiál");
}
private void button1_Click(object sender, EventArgs e)
{
string cmd;
if(button1.Tag.ToString() == "add")
{
cmd = @"INSERT INTO `mip`.`tab-nacenovanie` (`IDUser`, `Status`, `DatumPrijatia`, `Material1`, `Material2`, `Material3`, `Material4`, `PocetNacenovanychKusov`, `Poznamka`, `IDVyrobokNac`)
VALUES ("
+ classUser.ID + ", '"
+ "Prijatá" + "', "
+ "DATE(NOW())" + ", '"
+ comboBox1.Text + "', '"
+ comboBox2.Text + "', '"
+ comboBox3.Text + "', '"
+ comboBox4.Text + "', "
+ numericUpDown1.Value.ToString() + ", '"
+ textBox1.Text + "', "
+ IDVyrobok.ToString()
+ ");";
}
else
{
cmd = @"UPDATE `tab-nacenovanie`
SET
`Material1` = '" + comboBox1.Text + "'," +
"`Material2` = '" + comboBox2.Text + "'," +
"`Material3` = '" + comboBox3.Text + "'," +
"`Material4` = '" + comboBox4.Text + "'," +
"`PocetNacenovanychKusov` = " + numericUpDown1.Value.ToString() + "," +
"`Poznamka` = '" + textBox1.Text + "'" +
" WHERE `IDNacenovanie`= " + IDNacenovanie.ToString() + ";";
}
classSQL.SQL(cmd);
MessageBox.Show("Operácia úspešná!");
this.Close();
}
private void label14_Click(object sender, EventArgs e)
{
if (label14.BackColor == Color.LightSalmon)
{
label14.BackColor = Color.Beige;
comboBox3.Enabled = true;
}
else
{
label14.BackColor = Color.LightSalmon;
comboBox3.Enabled = false;
comboBox3.Text = "";
}
}
private void label13_Click(object sender, EventArgs e)
{
if (label13.BackColor == Color.LightSalmon)
{
label13.BackColor = Color.Beige;
comboBox2.Enabled = true;
}
else
{
label13.BackColor = Color.LightSalmon;
comboBox2.Enabled = false;
comboBox2.Text = "";
}
}
private void label16_Click(object sender, EventArgs e)
{
if (label16.BackColor == Color.LightSalmon)
{
label16.BackColor = Color.Beige;
comboBox4.Enabled = true;
}
else
{
label16.BackColor = Color.LightSalmon;
comboBox4.Enabled = false;
comboBox4.Text = "";
}
}
}
}

120
Mip/frmAddCenovuPonuku.resx Normal file
View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Some files were not shown because too many files have changed in this diff Show More