Commit 6343b18959f060b64809d9352255df4f211b697c

Authored by r-ujihara
1 parent 009cdaa4

出力機能調整

@@ -80,6 +80,8 @@ @@ -80,6 +80,8 @@
80 this.button4 = new System.Windows.Forms.Button(); 80 this.button4 = new System.Windows.Forms.Button();
81 this.button5 = new System.Windows.Forms.Button(); 81 this.button5 = new System.Windows.Forms.Button();
82 this.button6 = new System.Windows.Forms.Button(); 82 this.button6 = new System.Windows.Forms.Button();
  83 + this.checkBox4 = new System.Windows.Forms.CheckBox();
  84 + this.button7 = new System.Windows.Forms.Button();
83 ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); 85 ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
84 this.SuspendLayout(); 86 this.SuspendLayout();
85 // 87 //
@@ -180,7 +182,7 @@ @@ -180,7 +182,7 @@
180 this.dataGridView1.Name = "dataGridView1"; 182 this.dataGridView1.Name = "dataGridView1";
181 this.dataGridView1.ReadOnly = true; 183 this.dataGridView1.ReadOnly = true;
182 this.dataGridView1.RowTemplate.Height = 21; 184 this.dataGridView1.RowTemplate.Height = 21;
183 - this.dataGridView1.Size = new System.Drawing.Size(1040, 381); 185 + this.dataGridView1.Size = new System.Drawing.Size(1102, 381);
184 this.dataGridView1.TabIndex = 5; 186 this.dataGridView1.TabIndex = 5;
185 this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); 187 this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
186 // 188 //
@@ -515,7 +517,7 @@ @@ -515,7 +517,7 @@
515 // comboBox1 517 // comboBox1
516 // 518 //
517 this.comboBox1.FormattingEnabled = true; 519 this.comboBox1.FormattingEnabled = true;
518 - this.comboBox1.Location = new System.Drawing.Point(789, 69); 520 + this.comboBox1.Location = new System.Drawing.Point(771, 69);
519 this.comboBox1.Name = "comboBox1"; 521 this.comboBox1.Name = "comboBox1";
520 this.comboBox1.Size = new System.Drawing.Size(68, 20); 522 this.comboBox1.Size = new System.Drawing.Size(68, 20);
521 this.comboBox1.TabIndex = 11; 523 this.comboBox1.TabIndex = 11;
@@ -534,7 +536,7 @@ @@ -534,7 +536,7 @@
534 // label5 536 // label5
535 // 537 //
536 this.label5.AutoSize = true; 538 this.label5.AutoSize = true;
537 - this.label5.Location = new System.Drawing.Point(863, 72); 539 + this.label5.Location = new System.Drawing.Point(845, 72);
538 this.label5.Name = "label5"; 540 this.label5.Name = "label5";
539 this.label5.Size = new System.Drawing.Size(35, 12); 541 this.label5.Size = new System.Drawing.Size(35, 12);
540 this.label5.TabIndex = 13; 542 this.label5.TabIndex = 13;
@@ -542,7 +544,7 @@ @@ -542,7 +544,7 @@
542 // 544 //
543 // button4 545 // button4
544 // 546 //
545 - this.button4.Location = new System.Drawing.Point(904, 67); 547 + this.button4.Location = new System.Drawing.Point(886, 67);
546 this.button4.Name = "button4"; 548 this.button4.Name = "button4";
547 this.button4.Size = new System.Drawing.Size(43, 23); 549 this.button4.Size = new System.Drawing.Size(43, 23);
548 this.button4.TabIndex = 14; 550 this.button4.TabIndex = 14;
@@ -552,7 +554,7 @@ @@ -552,7 +554,7 @@
552 // 554 //
553 // button5 555 // button5
554 // 556 //
555 - this.button5.Location = new System.Drawing.Point(977, 67); 557 + this.button5.Location = new System.Drawing.Point(958, 67);
556 this.button5.Name = "button5"; 558 this.button5.Name = "button5";
557 this.button5.Size = new System.Drawing.Size(75, 23); 559 this.button5.Size = new System.Drawing.Size(75, 23);
558 this.button5.TabIndex = 15; 560 this.button5.TabIndex = 15;
@@ -562,19 +564,41 @@ @@ -562,19 +564,41 @@
562 // 564 //
563 // button6 565 // button6
564 // 566 //
565 - this.button6.Location = new System.Drawing.Point(977, 8); 567 + this.button6.Location = new System.Drawing.Point(958, 9);
566 this.button6.Name = "button6"; 568 this.button6.Name = "button6";
567 this.button6.Size = new System.Drawing.Size(75, 23); 569 this.button6.Size = new System.Drawing.Size(75, 23);
568 this.button6.TabIndex = 16; 570 this.button6.TabIndex = 16;
569 - this.button6.Text = "集計"; 571 + this.button6.Text = "ロット集計";
570 this.button6.UseVisualStyleBackColor = true; 572 this.button6.UseVisualStyleBackColor = true;
571 this.button6.Click += new System.EventHandler(this.button6_Click); 573 this.button6.Click += new System.EventHandler(this.button6_Click);
572 // 574 //
  575 + // checkBox4
  576 + //
  577 + this.checkBox4.AutoSize = true;
  578 + this.checkBox4.Location = new System.Drawing.Point(1039, 71);
  579 + this.checkBox4.Name = "checkBox4";
  580 + this.checkBox4.Size = new System.Drawing.Size(68, 16);
  581 + this.checkBox4.TabIndex = 17;
  582 + this.checkBox4.Text = "第1ロット";
  583 + this.checkBox4.UseVisualStyleBackColor = true;
  584 + //
  585 + // button7
  586 + //
  587 + this.button7.Location = new System.Drawing.Point(1039, 9);
  588 + this.button7.Name = "button7";
  589 + this.button7.Size = new System.Drawing.Size(75, 23);
  590 + this.button7.TabIndex = 18;
  591 + this.button7.Text = "保健区集計";
  592 + this.button7.UseVisualStyleBackColor = true;
  593 + this.button7.Click += new System.EventHandler(this.button7_Click);
  594 + //
573 // Form3 595 // Form3
574 // 596 //
575 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 597 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
576 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 598 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
577 - this.ClientSize = new System.Drawing.Size(1064, 493); 599 + this.ClientSize = new System.Drawing.Size(1126, 493);
  600 + this.Controls.Add(this.button7);
  601 + this.Controls.Add(this.checkBox4);
578 this.Controls.Add(this.button6); 602 this.Controls.Add(this.button6);
579 this.Controls.Add(this.button5); 603 this.Controls.Add(this.button5);
580 this.Controls.Add(this.button4); 604 this.Controls.Add(this.button4);
@@ -655,5 +679,7 @@ @@ -655,5 +679,7 @@
655 private System.Windows.Forms.DataGridViewTextBoxColumn s_身体不自由; 679 private System.Windows.Forms.DataGridViewTextBoxColumn s_身体不自由;
656 private System.Windows.Forms.Button button5; 680 private System.Windows.Forms.Button button5;
657 private System.Windows.Forms.Button button6; 681 private System.Windows.Forms.Button button6;
  682 + private System.Windows.Forms.CheckBox checkBox4;
  683 + private System.Windows.Forms.Button button7;
658 } 684 }
659 } 685 }
@@ -386,9 +386,17 @@ namespace MedicalCheckInputTool @@ -386,9 +386,17 @@ namespace MedicalCheckInputTool
386 MySqlConnection readerCon = new MySqlConnection(connstr); 386 MySqlConnection readerCon = new MySqlConnection(connstr);
387 readerCon.Open(); 387 readerCon.Open();
388 388
389 - string readQuery = "select * from `1回目` where (`ロット番号` = @lotNo) order by `保健区`"; 389 + string readQuery = "";
  390 +
  391 + if (checkBox4.Checked)
  392 + {
  393 + readQuery = "select * from `1回目` where (`ロット番号` = '1') order by `整理番号`";
  394 + }
  395 + else
  396 + {
  397 + readQuery = "select * from `1回目` where (`ロット番号` <> '1') order by `ロット番号`,`整理番号`";
  398 + }
390 MySqlCommand readCmd = new MySqlCommand(readQuery, readerCon); 399 MySqlCommand readCmd = new MySqlCommand(readQuery, readerCon);
391 - readCmd.Parameters.AddWithValue("lotNo", EditParam.lotNo);  
392 400
393 try 401 try
394 { 402 {
@@ -456,11 +464,11 @@ namespace MedicalCheckInputTool @@ -456,11 +464,11 @@ namespace MedicalCheckInputTool
456 //行政区集計 464 //行政区集計
457 private void makeSummaryAdmin(MySqlConnection readerCon) 465 private void makeSummaryAdmin(MySqlConnection readerCon)
458 { 466 {
459 - string readQuery = "select `行政区コード`,`行政区名称`,count(行政区コード) from `1回目` group by `行政区コード` order by `行政区コード`"; 467 + string readQuery = "select `行政区コード`,`行政区名称`,count(行政区コード) from `1回目` where (`ロット番号` = @lotNo) group by `行政区コード` order by `行政区コード`";
460 MySqlCommand readCmd = new MySqlCommand(readQuery, readerCon); 468 MySqlCommand readCmd = new MySqlCommand(readQuery, readerCon);
461 readCmd.Parameters.AddWithValue("lotNo", EditParam.lotNo); 469 readCmd.Parameters.AddWithValue("lotNo", EditParam.lotNo);
462 470
463 - string countQuery = "select count(distinct `世帯番号`) from `1回目` where `行政区コード`= @adminCode"; 471 + string countQuery = "select count(distinct `世帯番号`) from `1回目` where (`行政区コード`= @adminCode) and (`ロット番号` = @lotNo)";
464 MySqlCommand countCmd = new MySqlCommand(countQuery, readerCon); 472 MySqlCommand countCmd = new MySqlCommand(countQuery, readerCon);
465 473
466 try 474 try
@@ -484,7 +492,7 @@ namespace MedicalCheckInputTool @@ -484,7 +492,7 @@ namespace MedicalCheckInputTool
484 } 492 }
485 reader.Close(); 493 reader.Close();
486 494
487 - StreamWriter writer = new StreamWriter("SummaryAdmin.csv", false, System.Text.Encoding.GetEncoding("shift_jis")); //ファイルストリーム 495 + StreamWriter writer = new StreamWriter("SummaryAdmin_" + EditParam.lotNo +".csv", false, System.Text.Encoding.GetEncoding("shift_jis")); //ファイルストリーム
488 writer.WriteLine("行政区コード,行政区名称,データ作成件数,世帯数"); 496 writer.WriteLine("行政区コード,行政区名称,データ作成件数,世帯数");
489 497
490 foreach (SummaryAdmin sa in adminList) 498 foreach (SummaryAdmin sa in adminList)
@@ -515,7 +523,7 @@ namespace MedicalCheckInputTool @@ -515,7 +523,7 @@ namespace MedicalCheckInputTool
515 523
516 } 524 }
517 525
518 - //行政区サマリ 526 + //保健区サマリ
519 public class SummaryHealthArea 527 public class SummaryHealthArea
520 { 528 {
521 public int lotNo; 529 public int lotNo;
@@ -641,21 +649,19 @@ namespace MedicalCheckInputTool @@ -641,21 +649,19 @@ namespace MedicalCheckInputTool
641 } 649 }
642 650
643 651
644 - //集計 652 + //ロット集計
645 private void button6_Click(object sender, EventArgs e) 653 private void button6_Click(object sender, EventArgs e)
646 { 654 {
647 string connstr = System.Configuration.ConfigurationManager.AppSettings["Conn"]; 655 string connstr = System.Configuration.ConfigurationManager.AppSettings["Conn"];
648 MySqlConnection readerCon = new MySqlConnection(connstr); 656 MySqlConnection readerCon = new MySqlConnection(connstr);
649 readerCon.Open(); 657 readerCon.Open();
650 658
651 - makeSummaryHealthArea(readerCon);  
652 -  
653 makeSummaryAdmin(readerCon); 659 makeSummaryAdmin(readerCon);
654 660
655 readerCon.Close(); 661 readerCon.Close();
656 662
657 // 完了 663 // 完了
658 - MessageBox.Show("集計を出力しました"); 664 + MessageBox.Show("ロット集計を出力しました");
659 665
660 } 666 }
661 667
@@ -667,5 +673,20 @@ namespace MedicalCheckInputTool @@ -667,5 +673,20 @@ namespace MedicalCheckInputTool
667 SetValue(dataGridView1, true, null); 673 SetValue(dataGridView1, true, null);
668 } 674 }
669 675
  676 + //保健区集計
  677 + private void button7_Click(object sender, EventArgs e)
  678 + {
  679 + string connstr = System.Configuration.ConfigurationManager.AppSettings["Conn"];
  680 + MySqlConnection readerCon = new MySqlConnection(connstr);
  681 + readerCon.Open();
  682 +
  683 + makeSummaryHealthArea(readerCon);
  684 +
  685 + readerCon.Close();
  686 +
  687 + // 完了
  688 + MessageBox.Show("保健区集計を出力しました");
  689 + }
  690 +
670 } 691 }
671 } 692 }
@@ -222,4 +222,109 @@ @@ -222,4 +222,109 @@
222 <metadata name="s_身体不自由.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 222 <metadata name="s_身体不自由.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
223 <value>True</value> 223 <value>True</value>
224 </metadata> 224 </metadata>
  225 + <metadata name="状況.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  226 + <value>True</value>
  227 + </metadata>
  228 + <metadata name="編集1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  229 + <value>True</value>
  230 + </metadata>
  231 + <metadata name="f_行政区コード.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  232 + <value>True</value>
  233 + </metadata>
  234 + <metadata name="f_整理番号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  235 + <value>True</value>
  236 + </metadata>
  237 + <metadata name="f_世帯番号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  238 + <value>True</value>
  239 + </metadata>
  240 + <metadata name="f_電話番号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  241 + <value>True</value>
  242 + </metadata>
  243 + <metadata name="f_携帯番号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  244 + <value>True</value>
  245 + </metadata>
  246 + <metadata name="f_健康診査.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  247 + <value>True</value>
  248 + </metadata>
  249 + <metadata name="f_結核肺がん.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  250 + <value>True</value>
  251 + </metadata>
  252 + <metadata name="f_胃がん.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  253 + <value>True</value>
  254 + </metadata>
  255 + <metadata name="f_大腸がん.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  256 + <value>True</value>
  257 + </metadata>
  258 + <metadata name="f_前立腺がん.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  259 + <value>True</value>
  260 + </metadata>
  261 + <metadata name="f_骨粗鬆症.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  262 + <value>True</value>
  263 + </metadata>
  264 + <metadata name="f_成人歯科.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  265 + <value>True</value>
  266 + </metadata>
  267 + <metadata name="f_子宮頸がん.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  268 + <value>True</value>
  269 + </metadata>
  270 + <metadata name="f_乳がん.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  271 + <value>True</value>
  272 + </metadata>
  273 + <metadata name="f_希望場所.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  274 + <value>True</value>
  275 + </metadata>
  276 + <metadata name="f_身体不自由.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  277 + <value>True</value>
  278 + </metadata>
  279 + <metadata name="編集2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  280 + <value>True</value>
  281 + </metadata>
  282 + <metadata name="s_行政区コード.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  283 + <value>True</value>
  284 + </metadata>
  285 + <metadata name="s_整理番号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  286 + <value>True</value>
  287 + </metadata>
  288 + <metadata name="s_世帯番号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  289 + <value>True</value>
  290 + </metadata>
  291 + <metadata name="s_電話番号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  292 + <value>True</value>
  293 + </metadata>
  294 + <metadata name="s_携帯番号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  295 + <value>True</value>
  296 + </metadata>
  297 + <metadata name="s_健康診査.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  298 + <value>True</value>
  299 + </metadata>
  300 + <metadata name="s_結核肺がん.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  301 + <value>True</value>
  302 + </metadata>
  303 + <metadata name="s_胃がん.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  304 + <value>True</value>
  305 + </metadata>
  306 + <metadata name="s_大腸がん.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  307 + <value>True</value>
  308 + </metadata>
  309 + <metadata name="s_前立腺がん.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  310 + <value>True</value>
  311 + </metadata>
  312 + <metadata name="s_骨粗鬆症.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  313 + <value>True</value>
  314 + </metadata>
  315 + <metadata name="s_成人歯科.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  316 + <value>True</value>
  317 + </metadata>
  318 + <metadata name="s_子宮頸がん.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  319 + <value>True</value>
  320 + </metadata>
  321 + <metadata name="s_乳がん.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  322 + <value>True</value>
  323 + </metadata>
  324 + <metadata name="s_希望場所.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  325 + <value>True</value>
  326 + </metadata>
  327 + <metadata name="s_身体不自由.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  328 + <value>True</value>
  329 + </metadata>
225 </root> 330 </root>
Please register or login to post a comment