db連携動作確認バージョン

This commit is contained in:
SongSong 2025-10-10 17:33:21 +09:00
parent 4db2486104
commit 87281c7abe
4 changed files with 230 additions and 58 deletions

View File

@ -6,7 +6,7 @@
<UseWindowsForms>True</UseWindowsForms> <UseWindowsForms>True</UseWindowsForms>
<TargetFramework>net461</TargetFramework> <TargetFramework>net461</TargetFramework>
<Prefer32Bit>True</Prefer32Bit> <Prefer32Bit>True</Prefer32Bit>
<Platforms>AnyCPU;x86</Platforms> <Platforms>AnyCPU;x86;x64</Platforms>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<LangVersion>12.0</LangVersion> <LangVersion>12.0</LangVersion>

View File

@ -1,24 +1,30 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.14.36401.2 d17.14 VisualStudioVersion = 17.14.36401.2
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoM_PrnControl", "SoM_PrnControl.csproj", "{4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoM_PrnControl", "SoM_PrnControl.csproj", "{4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86 Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86 Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Debug|Any CPU.Build.0 = Debug|Any CPU {4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Debug|x64.ActiveCfg = Debug|x64
{4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Debug|x64.Build.0 = Debug|x64
{4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Debug|x86.ActiveCfg = Debug|x86 {4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Debug|x86.ActiveCfg = Debug|x86
{4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Debug|x86.Build.0 = Debug|x86 {4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Debug|x86.Build.0 = Debug|x86
{4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Release|Any CPU.ActiveCfg = Release|Any CPU {4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Release|Any CPU.Build.0 = Release|Any CPU {4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Release|Any CPU.Build.0 = Release|Any CPU
{4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Release|x64.ActiveCfg = Release|x64
{4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Release|x64.Build.0 = Release|x64
{4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Release|x86.ActiveCfg = Release|x86 {4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Release|x86.ActiveCfg = Release|x86
{4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Release|x86.Build.0 = Release|x86 {4CF6E170-C8BE-2FA3-5F92-585EDECDC4F9}.Release|x86.Build.0 = Release|x86
EndGlobalSection EndGlobalSection

View File

@ -1,16 +1,26 @@
#define TRACE #define TRACE
#define DEBUG #define DEBUG
using Citizen.LayoutUtilities.Printing;
using com.citizen.sdk.LabelPrint;
using MySql.Data.MySqlClient;
using PCSC;
using PCSC.Exceptions;
using PCSC.Iso7816;
using SoM_PrnControl;
using SoM_PrnControl.YoyakuServiceReference;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Drawing.Printing;
using System.Dynamic; using System.Dynamic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.IO.Ports; using System.IO.Ports;
using System.Linq; using System.Linq;
using System.Management;
using System.Net; using System.Net;
using System.Net.NetworkInformation; using System.Net.NetworkInformation;
using System.Reflection; using System.Reflection;
@ -21,14 +31,6 @@ using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml; using System.Xml;
using Citizen.LayoutUtilities.Printing;
using com.citizen.sdk.LabelPrint;
using MySql.Data.MySqlClient;
using PCSC;
using PCSC.Exceptions;
using PCSC.Iso7816;
using SoM_PrnControl;
using SoM_PrnControl.YoyakuServiceReference;
namespace qk30ic; namespace qk30ic;
@ -2904,10 +2906,8 @@ public class Form1 : Form
form2.BackgroundImage = backgroundImage5; form2.BackgroundImage = backgroundImage5;
RemoveHomeButton(); RemoveHomeButton();
Application.DoEvents(); Application.DoEvents();
// 立刻结束程序
Environment.Exit(0);
num = SO_PrnOut(); num = SO_PrnOut();
//num = SO_PrnOut_EpsonNetwork(); SO_PrnInit_Epson();
Debug.WriteLine(" --処理印刷\u3000 result " + num); Debug.WriteLine(" --処理印刷\u3000 result " + num);
if (num != 0) if (num != 0)
{ {
@ -3015,9 +3015,10 @@ public class Form1 : Form
Application.Exit(); Application.Exit();
} }
private void SO_FullScreen(int msgn, int mode) /*private void SO_FullScreen(int msgn, int mode)
{ {
try
try
{ {
if (!string.IsNullOrWhiteSpace(str_Confile[msgn]) && str_Confile[msgn].Length > 2) if (!string.IsNullOrWhiteSpace(str_Confile[msgn]) && str_Confile[msgn].Length > 2)
{ {
@ -3052,9 +3053,50 @@ public class Form1 : Form
Application.Exit(); Application.Exit();
Console.WriteLine("Exit"); Console.WriteLine("Exit");
} }
}*/
private void SO_FullScreen(int msgn, int mode)
{
try
{
if (!string.IsNullOrWhiteSpace(str_Confile[msgn]) && str_Confile[msgn].Length > 2)
{
int num = str_Confile[msgn].Length;
string text = str_Confile[msgn];
if (num > 6)
{
num = 6;
text = str_Confile[9].Substring(0, 6);
}
int num2 = 300 - (num - 3) * 40;
int num3 = 110 + (num - 3) * 110;
if (mode == 0)
{
form2.Show();
}
form2.label1.Text = text;
Bitmap backgroundImage = new Bitmap(AppDomain.CurrentDomain.BaseDirectory + "\\pic1.png");
form2.BackgroundImage = backgroundImage;
Debug.WriteLine("ラベル表示名: " + text);
form2.Text = "駐ID: " + str_Confile[6] + " LOG:" + str_Confile[8] + " DBG:" + str_Confile[5];
form2.label1.TextAlign = ContentAlignment.MiddleCenter;
form2.TopMost = true;
form2.WindowState = FormWindowState.Maximized;
}
}
catch (Exception ex)
{
Debug.WriteLine("★★_ERROR_イメージリソースエラー:" + ex.Message + " --> " + ex);
MessageBox.Show("起動に必要なイメージリソースが見つかりません。正しくセットアップしてください。", "リソースエラー", MessageBoxButtons.OK, MessageBoxIcon.Hand);
Close();
Application.Exit();
Console.WriteLine("Exit");
}
} }
public string GetGIP(string url)
public string GetGIP(string url)
{ {
string input = ""; string input = "";
try try
@ -3470,7 +3512,9 @@ public class Form1 : Form
private uint SO_WriteLog(int type) private uint SO_WriteLog(int type)
{ {
uint result = 0u;
uint result = 0u;
string text = ""; string text = "";
string text2 = Convert.ToString(DateTime.Now); string text2 = Convert.ToString(DateTime.Now);
string text3 = DateTime.Now.ToString("yyyyMMdd"); string text3 = DateTime.Now.ToString("yyyyMMdd");
@ -3503,10 +3547,13 @@ public class Form1 : Form
int num = 0; int num = 0;
int num2 = -1; int num2 = -1;
int num3 = -1; int num3 = -1;
if (MFresult == 10 && MFCODE != "") Debug.WriteLine("★MFresult:" + MFresult);
Debug.WriteLine("★MFCODE:" + MFCODE);
if (MFresult == 10 && MFCODE != "")
{ {
num3 = CheckNewContract(MFCODE); num3 = CheckNewContract(MFCODE);
switch (num3) Debug.WriteLine("★num3:" +num3);
switch (num3)
{ {
case 0: case 0:
Console.WriteLine("SOMPR-110に進む"); Console.WriteLine("SOMPR-110に進む");
@ -4996,43 +5043,42 @@ public class Form1 : Form
private bool SO_PrnInit() private bool SO_PrnInit()
{ {
if (DEBUG_MODE == "1") if (DEBUG_MODE == "1")
{ {
return true; return true;
} }
try try
{ {
int num = 0; int num = 0;
short num2 = 0; short num2 = 0;
for (num2 = 1; num2 <= 9; num2++) for (num2 = 1; num2 <= 9; num2++)
{ {
printerPortName = "USB00" + Convert.ToString(num2); printerPortName = "USB00" + Convert.ToString(num2);
Debug.WriteLine(printerPortName + "が接続されているか確認しています。"); Debug.WriteLine(printerPortName + "が接続されているか確認しています。");
printer.Disconnect(); printer.Disconnect();
num = printer.Connect(3, printerPortName); num = printer.Connect(3, printerPortName);
Debug.WriteLine("返り値:" + Convert.ToString(num)); Debug.WriteLine("返り値:" + Convert.ToString(num));
if (num == 0) if (num == 0)
{ {
break; break;
} }
} }
if (num != 0) if (num != 0)
{ {
return SO_PrnGetStatus(); return SO_PrnGetStatus();
} }
Debug.WriteLine("コネクト確認までクリア"); Debug.WriteLine("コネクト確認までクリア");
return SO_PrnGetStatus(); return SO_PrnGetStatus();
} }
catch (Exception ex) catch (Exception ex)
{ {
Debug.WriteLine("★★_ERROR_25"); Debug.WriteLine("★★_ERROR_25");
MessageBox.Show("プリンタの初期化に失敗しました。PCを起動後にプリンタの電源を入れてください。", "プリンタ初期化エラー", MessageBoxButtons.OK, MessageBoxIcon.Hand); MessageBox.Show("プリンタの初期化に失敗しました。PCを起動後にプリンタの電源を入れてください。", "プリンタ初期化エラー", MessageBoxButtons.OK, MessageBoxIcon.Hand);
Trace.WriteLine(ex.Message); Trace.WriteLine(ex.Message);
return false; return false;
} }
} }
@ -5131,7 +5177,7 @@ public class Form1 : Form
return true; return true;
} }
ERRORINFO = "PrinterCheck Error\u3000戻り値=" + num + " プリンタステータス =(PrinterCheck Error)"; ERRORINFO = "PrinterCheck Error\u3000戻り値=" + num + " プリンタステータス =(PrinterCheck Error)";
return false; return false;
} }
private uint SO_PrnLabeEdit(uint type) private uint SO_PrnLabeEdit(uint type)

120
qk30ic/Form1.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>