From: newton-cn Date: Tue, 18 Jun 2024 08:44:56 +0000 (+0900) Subject: 적립금 사용 로직 개선 X-Git-Url: https://git.insang.kr/gitweb/?a=commitdiff_plain;h=33235d268eca442083d2f65af13d0c50807a0355;p=newton-cn_pos.git 적립금 사용 로직 개선 --- diff --git a/.vs/newton-cn/v16/.suo b/.vs/newton-cn/v16/.suo index be5f909..135d3de 100644 Binary files a/.vs/newton-cn/v16/.suo and b/.vs/newton-cn/v16/.suo differ diff --git a/newton-cn/DBConnector.cs b/newton-cn/DBConnector.cs index b19f083..b89ef73 100644 --- a/newton-cn/DBConnector.cs +++ b/newton-cn/DBConnector.cs @@ -57,7 +57,7 @@ namespace newton_cn int result = 0; #if DEBUG - SqlConnection conn = new SqlConnection("Data Source=125.133.161.13, 1818; Initial Catalog=food; User ID=newton; Password=newton123!;"); + SqlConnection conn = new SqlConnection("Data Source=newton-cn1.duckdns.org, 1818; Initial Catalog=food; User ID=newton; Password=newton123!;"); #else SqlConnection conn = new SqlConnection("Data Source=localhost; Initial Catalog=food; User ID=newton; Password=newton123!;"); #endif diff --git a/newton-cn/Form3.cs b/newton-cn/Form3.cs index c65094e..9c06215 100644 --- a/newton-cn/Form3.cs +++ b/newton-cn/Form3.cs @@ -148,6 +148,8 @@ namespace newton_cn decimal tthousand1 = 0; decimal thundred5 = 0; decimal thundred1 = 0; + int mInitCount = 0; + bool mInit = true; textBox1.Clear(); closeForm(); @@ -192,7 +194,13 @@ namespace newton_cn if (tmillion5 > 0) { - MouseEvent1 me = new MouseEvent1(Convert.ToInt32(million_5), Convert.ToInt32(kind), Convert.ToInt32(tmillion5)); + if (mInitCount != 0) + { + mInit = false; + } + mInitCount++; + + MouseEvent1 me = new MouseEvent1(Convert.ToInt32(million_5), Convert.ToInt32(kind), Convert.ToInt32(tmillion5), mInit); ThreadStart ts = new ThreadStart(me.find); Thread th = new Thread(ts); th.Start(); @@ -200,7 +208,12 @@ namespace newton_cn } if (tmillion1 > 0) { - MouseEvent1 me = new MouseEvent1(Convert.ToInt32(million_1), Convert.ToInt32(kind), Convert.ToInt32(tmillion1)); + if (mInitCount != 0) + { + mInit = false; + } + mInitCount++; + MouseEvent1 me = new MouseEvent1(Convert.ToInt32(million_1), Convert.ToInt32(kind), Convert.ToInt32(tmillion1), mInit); ThreadStart ts = new ThreadStart(me.find); Thread th = new Thread(ts); th.Start(); @@ -208,7 +221,12 @@ namespace newton_cn } if (tthousand5 > 0) { - MouseEvent1 me = new MouseEvent1(Convert.ToInt32(thousand_5), Convert.ToInt32(kind), Convert.ToInt32(tthousand5)); + if (mInitCount != 0) + { + mInit = false; + } + mInitCount++; + MouseEvent1 me = new MouseEvent1(Convert.ToInt32(thousand_5), Convert.ToInt32(kind), Convert.ToInt32(tthousand5), mInit); ThreadStart ts = new ThreadStart(me.find); Thread th = new Thread(ts); th.Start(); @@ -216,7 +234,12 @@ namespace newton_cn } if (tthousand1 > 0) { - MouseEvent1 me = new MouseEvent1(Convert.ToInt32(thousand_1), Convert.ToInt32(kind), Convert.ToInt32(tthousand1)); + if (mInitCount != 0) + { + mInit = false; + } + mInitCount++; + MouseEvent1 me = new MouseEvent1(Convert.ToInt32(thousand_1), Convert.ToInt32(kind), Convert.ToInt32(tthousand1), mInit); ThreadStart ts = new ThreadStart(me.find); Thread th = new Thread(ts); th.Start(); @@ -224,7 +247,12 @@ namespace newton_cn } if (thundred5 > 0) { - MouseEvent1 me = new MouseEvent1(Convert.ToInt32(hundred_5), Convert.ToInt32(kind), Convert.ToInt32(thundred5)); + if (mInitCount != 0) + { + mInit = false; + } + mInitCount++; + MouseEvent1 me = new MouseEvent1(Convert.ToInt32(hundred_5), Convert.ToInt32(kind), Convert.ToInt32(thundred5), mInit); ThreadStart ts = new ThreadStart(me.find); Thread th = new Thread(ts); th.Start(); @@ -232,13 +260,20 @@ namespace newton_cn } if (thundred1 > 0) { - MouseEvent1 me = new MouseEvent1(Convert.ToInt32(hundred_1), Convert.ToInt32(kind), Convert.ToInt32(thundred1)); + if (mInitCount != 0) + { + mInit = false; + } + mInitCount++; + MouseEvent1 me = new MouseEvent1(Convert.ToInt32(hundred_1), Convert.ToInt32(kind), Convert.ToInt32(thundred1), mInit); ThreadStart ts = new ThreadStart(me.find); Thread th = new Thread(ts); th.Start(); th.Join(); } + mInitCount = 0; + } private void closeForm() { diff --git a/newton-cn/MouseEvent1.cs b/newton-cn/MouseEvent1.cs index 3abc617..11d5861 100644 --- a/newton-cn/MouseEvent1.cs +++ b/newton-cn/MouseEvent1.cs @@ -19,13 +19,16 @@ namespace newton_cn private int pr; private int kind; private int aCount; + private bool mInit; - public MouseEvent1(int pr, int kind, int aCount= 1) + public MouseEvent1(int pr, int kind, int aCount= 1, bool mInit= true) { this.pr = pr; this.kind = kind; this.aCount = aCount; + this.mInit = mInit; + } [DllImport("user32.dll")] @@ -97,17 +100,19 @@ namespace newton_cn items.Add(new Point(755, 535)); items.Add(new Point(860, 535)); - this.menuinit(kind); - - int tkind = kind; - while(tkind - 11 > 0) + if (mInit) { - move(arrowmenu["right"]); + this.menuinit(kind); + int tkind = kind; + while (tkind - 11 > 0) + { + move(arrowmenu["right"]); + click(); + tkind = tkind - 11; + } + move(menus[tkind]); click(); - tkind = tkind - 11; - } - move(menus[tkind]); - click(); + } int tpr = pr; //43 diff --git a/newton-cn/bin/Debug/newton-cn.exe b/newton-cn/bin/Debug/newton-cn.exe index 79dc137..f671054 100644 Binary files a/newton-cn/bin/Debug/newton-cn.exe and b/newton-cn/bin/Debug/newton-cn.exe differ diff --git a/newton-cn/bin/Debug/newton-cn.pdb b/newton-cn/bin/Debug/newton-cn.pdb index 6145778..96d1f0d 100644 Binary files a/newton-cn/bin/Debug/newton-cn.pdb and b/newton-cn/bin/Debug/newton-cn.pdb differ diff --git a/newton-cn/bin/Release/newton-cn.exe b/newton-cn/bin/Release/newton-cn.exe index 411dcbd..a065ce2 100644 Binary files a/newton-cn/bin/Release/newton-cn.exe and b/newton-cn/bin/Release/newton-cn.exe differ diff --git a/newton-cn/bin/Release/newton-cn.pdb b/newton-cn/bin/Release/newton-cn.pdb index 4d4a3e5..b9a40bd 100644 Binary files a/newton-cn/bin/Release/newton-cn.pdb and b/newton-cn/bin/Release/newton-cn.pdb differ diff --git a/newton-cn/bin/Release/newton-cn.zip b/newton-cn/bin/Release/newton-cn.zip index 434be5f..eefdfcd 100644 Binary files a/newton-cn/bin/Release/newton-cn.zip and b/newton-cn/bin/Release/newton-cn.zip differ diff --git a/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 173a425..616654b 100644 Binary files a/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/newton-cn/obj/Debug/newton-cn.csproj.AssemblyReference.cache b/newton-cn/obj/Debug/newton-cn.csproj.AssemblyReference.cache new file mode 100644 index 0000000..f5e894a Binary files /dev/null and b/newton-cn/obj/Debug/newton-cn.csproj.AssemblyReference.cache differ diff --git a/newton-cn/obj/Debug/newton-cn.csproj.FileListAbsolute.txt b/newton-cn/obj/Debug/newton-cn.csproj.FileListAbsolute.txt index 10ac79c..0f05a54 100644 --- a/newton-cn/obj/Debug/newton-cn.csproj.FileListAbsolute.txt +++ b/newton-cn/obj/Debug/newton-cn.csproj.FileListAbsolute.txt @@ -23,6 +23,7 @@ C:\Users\NEWTON-Choengna\Desktop\insang\workspace\newton-cn\newton-cn\obj\Debug\ z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\bin\Debug\newton-cn.exe.config z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\bin\Debug\newton-cn.exe z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\bin\Debug\newton-cn.pdb +z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Debug\newton-cn.csproj.AssemblyReference.cache z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Debug\newton_cn.Form1.resources z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Debug\newton_cn.Form2.resources z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Debug\newton_cn.Form3.resources diff --git a/newton-cn/obj/Debug/newton-cn.exe b/newton-cn/obj/Debug/newton-cn.exe index 79dc137..f671054 100644 Binary files a/newton-cn/obj/Debug/newton-cn.exe and b/newton-cn/obj/Debug/newton-cn.exe differ diff --git a/newton-cn/obj/Debug/newton-cn.pdb b/newton-cn/obj/Debug/newton-cn.pdb index 6145778..96d1f0d 100644 Binary files a/newton-cn/obj/Debug/newton-cn.pdb and b/newton-cn/obj/Debug/newton-cn.pdb differ diff --git a/newton-cn/obj/Release/newton-cn.csproj.AssemblyReference.cache b/newton-cn/obj/Release/newton-cn.csproj.AssemblyReference.cache index f5e894a..9e16c69 100644 Binary files a/newton-cn/obj/Release/newton-cn.csproj.AssemblyReference.cache and b/newton-cn/obj/Release/newton-cn.csproj.AssemblyReference.cache differ diff --git a/newton-cn/obj/Release/newton-cn.exe b/newton-cn/obj/Release/newton-cn.exe index 411dcbd..a065ce2 100644 Binary files a/newton-cn/obj/Release/newton-cn.exe and b/newton-cn/obj/Release/newton-cn.exe differ diff --git a/newton-cn/obj/Release/newton-cn.pdb b/newton-cn/obj/Release/newton-cn.pdb index 4d4a3e5..b9a40bd 100644 Binary files a/newton-cn/obj/Release/newton-cn.pdb and b/newton-cn/obj/Release/newton-cn.pdb differ