]> insang Git - newton-cn_pos.git/commitdiff
매출정보 색상넣기
authornewton-cn <insang@kakao.com>
Thu, 1 May 2025 07:23:09 +0000 (16:23 +0900)
committernewton-cn <insang@kakao.com>
Thu, 1 May 2025 07:23:09 +0000 (16:23 +0900)
12 files changed:
.vs/newton-cn/v16/.suo
newton-cn/Form6.cs
newton-cn/bin/Debug/newton-cn.exe
newton-cn/bin/Debug/newton-cn.pdb
newton-cn/bin/Release/newton-cn.exe
newton-cn/bin/Release/newton-cn.pdb
newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache
newton-cn/obj/Debug/newton-cn.csproj.AssemblyReference.cache
newton-cn/obj/Debug/newton-cn.exe
newton-cn/obj/Debug/newton-cn.pdb
newton-cn/obj/Release/newton-cn.exe
newton-cn/obj/Release/newton-cn.pdb

index 0044392eb167d3964c9cde867c92d40d53041501..28b6fff303a1f712f605f0401093ea0637dc4310 100644 (file)
Binary files a/.vs/newton-cn/v16/.suo and b/.vs/newton-cn/v16/.suo differ
index 65076ec40185ed424a9d21e3a6bc859a4074f76f..2994bd27359cd5116ce629765a721f4552a52a10 100644 (file)
@@ -43,15 +43,38 @@ namespace newton_cn
             dataGridView1.DataSource = dbc.getDisposableAnalysis(todayFormatted);
             try
             {
-                dataGridView1.Columns["상품명"].Width = 200;
-                dataGridView1.Columns["비율"].Width = 55;
+                dataGridView1.Columns["상품명"].Width = 180;
+                dataGridView1.Columns["비율"].Width = 80;
                 dataGridView1.Columns["개수"].Width = 55;
-                dataGridView1.Columns["매출"].Width = 80;
+                dataGridView1.Columns["매출"].Width = 105;
             }
             catch (Exception)
             {
 
             }
+
+            // 색상 적용
+            foreach (DataGridViewRow row in dataGridView1.Rows)
+            {
+                if (row.IsNewRow) continue; // 새 행 무시
+
+                string colorStr = row.Cells["row_color"].Value?.ToString();
+                if (!string.IsNullOrEmpty(colorStr))
+                {
+                    try
+                    {
+                        row.DefaultCellStyle.BackColor = Color.FromName(colorStr);
+                        row.DefaultCellStyle.Font = new Font(dataGridView1.Font.FontFamily, 10, FontStyle.Bold);
+                    }
+                    catch
+                    {
+                        // 유효하지 않은 색상일 경우 무시
+                    }
+                }
+            }
+
+            // 색상 표기된 컬럼 숨기기 (원한다면)
+            dataGridView1.Columns["row_color"].Visible = false;
         }
 
         private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
@@ -71,16 +94,47 @@ namespace newton_cn
             dataGridView1.DataSource = dbc.getDisposableAnalysis(result);
             try
             {
-                dataGridView1.Columns["상품명"].Width = 200;
-                dataGridView1.Columns["비율"].Width = 55;
+                dataGridView1.Columns["상품명"].Width = 180;
+                dataGridView1.Columns["비율"].Width = 80;
                 dataGridView1.Columns["개수"].Width = 55;
-                dataGridView1.Columns["매출"].Width = 80;
+                dataGridView1.Columns["매출"].Width = 105;
             }
             catch (Exception)
             {
 
             }
 
+            // 색상 적용
+            foreach (DataGridViewRow row in dataGridView1.Rows)
+            {
+                if (row.IsNewRow) continue; // 새 행 무시
+
+                try 
+                {
+                    string colorStr = row.Cells["row_color"].Value?.ToString();
+                    if (!string.IsNullOrEmpty(colorStr))
+                    {
+                        try
+                        {
+                            row.DefaultCellStyle.BackColor = Color.FromName(colorStr);
+                            row.DefaultCellStyle.Font = new Font(dataGridView1.Font.FontFamily, 10, FontStyle.Bold);
+                        }
+                        catch
+                        {
+                            // 유효하지 않은 색상일 경우 무시
+                        }
+                    }
+                    // 색상 표기된 컬럼 숨기기 (원한다면)
+                    dataGridView1.Columns["row_color"].Visible = false;
+                }
+                catch
+                {
+
+                }
+            }
+
+            
+
         }
 
         private void button4_Click(object sender, EventArgs e)
index b6ab76398465f5e244d3cacddf5d3ca3a277ebbf..258a21d9fc50f6d03f160ad069cc5605727c15b7 100644 (file)
Binary files a/newton-cn/bin/Debug/newton-cn.exe and b/newton-cn/bin/Debug/newton-cn.exe differ
index 88f94014e1f6590b3f3249504f3920f4b80375fe..ff7dfa14d3846f587c81a3dd2893fad95553871c 100644 (file)
Binary files a/newton-cn/bin/Debug/newton-cn.pdb and b/newton-cn/bin/Debug/newton-cn.pdb differ
index 7cd0a92b391acd361c4c7aa6f3a4d3b3b7c9b784..500fe40242bbc1f2894e4d611ee69244dec6661d 100644 (file)
Binary files a/newton-cn/bin/Release/newton-cn.exe and b/newton-cn/bin/Release/newton-cn.exe differ
index 55a898c9d441f0b8d3234d8a21118cd90772ce06..503c93875442e39db4ba8067cf183065c79c7668 100644 (file)
Binary files a/newton-cn/bin/Release/newton-cn.pdb and b/newton-cn/bin/Release/newton-cn.pdb differ
index c038318b31d9100802f7b40c77503409d0bdcd77..2e4a33e50bfc117ed10cb7369a11d19cb7b82002 100644 (file)
Binary files a/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ
index 654fe63c3d45a2e8165502122afabf3ee530b55b..f5e894aea93a73e58fa9d4feab241bc197ee1a40 100644 (file)
Binary files a/newton-cn/obj/Debug/newton-cn.csproj.AssemblyReference.cache and b/newton-cn/obj/Debug/newton-cn.csproj.AssemblyReference.cache differ
index b6ab76398465f5e244d3cacddf5d3ca3a277ebbf..258a21d9fc50f6d03f160ad069cc5605727c15b7 100644 (file)
Binary files a/newton-cn/obj/Debug/newton-cn.exe and b/newton-cn/obj/Debug/newton-cn.exe differ
index 88f94014e1f6590b3f3249504f3920f4b80375fe..ff7dfa14d3846f587c81a3dd2893fad95553871c 100644 (file)
Binary files a/newton-cn/obj/Debug/newton-cn.pdb and b/newton-cn/obj/Debug/newton-cn.pdb differ
index 7cd0a92b391acd361c4c7aa6f3a4d3b3b7c9b784..500fe40242bbc1f2894e4d611ee69244dec6661d 100644 (file)
Binary files a/newton-cn/obj/Release/newton-cn.exe and b/newton-cn/obj/Release/newton-cn.exe differ
index 55a898c9d441f0b8d3234d8a21118cd90772ce06..503c93875442e39db4ba8067cf183065c79c7668 100644 (file)
Binary files a/newton-cn/obj/Release/newton-cn.pdb and b/newton-cn/obj/Release/newton-cn.pdb differ