diff --git a/solarApp/fmArchive.Designer.cs b/solarApp/fmArchive.Designer.cs index dcabc40..301cd21 100644 --- a/solarApp/fmArchive.Designer.cs +++ b/solarApp/fmArchive.Designer.cs @@ -29,8 +29,8 @@ namespace solarApp /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); @@ -69,6 +69,7 @@ namespace solarApp this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); + this.btInvDay_oldData = new System.Windows.Forms.Button(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); @@ -119,6 +120,7 @@ namespace solarApp // splitContainer1.Panel1 // this.splitContainer1.Panel1.BackColor = System.Drawing.SystemColors.ActiveCaption; + this.splitContainer1.Panel1.Controls.Add(this.btInvDay_oldData); this.splitContainer1.Panel1.Controls.Add(this.bt_rpt_invDay); this.splitContainer1.Panel1.Controls.Add(this.bt_meter); this.splitContainer1.Panel1.Controls.Add(this.lbmsg); @@ -146,7 +148,7 @@ namespace solarApp // bt_rpt_invDay // this.bt_rpt_invDay.Font = new System.Drawing.Font("Microsoft JhengHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.bt_rpt_invDay.Location = new System.Drawing.Point(223, 790); + this.bt_rpt_invDay.Location = new System.Drawing.Point(262, 790); this.bt_rpt_invDay.Name = "bt_rpt_invDay"; this.bt_rpt_invDay.Size = new System.Drawing.Size(135, 44); this.bt_rpt_invDay.TabIndex = 12; @@ -281,8 +283,8 @@ namespace solarApp // this.gv_inv_detail.AllowUserToAddRows = false; this.gv_inv_detail.AllowUserToDeleteRows = false; - dataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); - this.gv_inv_detail.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.gv_inv_detail.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; this.gv_inv_detail.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gv_inv_detail.Dock = System.Windows.Forms.DockStyle.Fill; this.gv_inv_detail.Location = new System.Drawing.Point(768, 75); @@ -298,8 +300,8 @@ namespace solarApp // this.gv_rpt_invDay.AllowUserToAddRows = false; this.gv_rpt_invDay.AllowUserToDeleteRows = false; - dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); - this.gv_rpt_invDay.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.gv_rpt_invDay.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle2; this.gv_rpt_invDay.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gv_rpt_invDay.Dock = System.Windows.Forms.DockStyle.Left; this.gv_rpt_invDay.Location = new System.Drawing.Point(0, 75); @@ -536,6 +538,17 @@ namespace solarApp this.label4.TabIndex = 9; this.label4.Text = "Site_Name"; // + // btInvDay_oldData + // + this.btInvDay_oldData.Font = new System.Drawing.Font("Microsoft JhengHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.btInvDay_oldData.Location = new System.Drawing.Point(156, 790); + this.btInvDay_oldData.Name = "btInvDay_oldData"; + this.btInvDay_oldData.Size = new System.Drawing.Size(100, 44); + this.btInvDay_oldData.TabIndex = 13; + this.btInvDay_oldData.Text = "日報-舊"; + this.btInvDay_oldData.UseVisualStyleBackColor = true; + this.btInvDay_oldData.Click += new System.EventHandler(this.btInvDay_oldData_Click); + // // fmArchive // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 19F); @@ -610,5 +623,6 @@ namespace solarApp private System.Windows.Forms.Label label4; private System.Windows.Forms.Button bt_invDay; private System.Windows.Forms.DataGridView gv_inv_detail; + private System.Windows.Forms.Button btInvDay_oldData; } } \ No newline at end of file diff --git a/solarApp/fmArchive.cs b/solarApp/fmArchive.cs index f2e657e..3bdc812 100644 --- a/solarApp/fmArchive.cs +++ b/solarApp/fmArchive.cs @@ -222,6 +222,11 @@ namespace solarApp MessageBox.Show("OK"); } + /// + /// 日報表 - 每日歸檔 + /// + /// + /// private void bt_rpt_invDay_Click(object sender, EventArgs e) { string date1 = dtSelect1.Value.ToString("yyyy-MM-dd"); @@ -309,5 +314,14 @@ namespace solarApp gv_inv_detail.Columns[4].Width = 80; gv_inv_detail.Columns[5].Width = 80; } + + private void btInvDay_oldData_Click(object sender, EventArgs e) + { + procInvSvc invSvc = new procInvSvc(); + foreach (DateTime day in EachDay(DateTime.Parse(date1), DateTime.Parse(date2))) + { + invSvc.report_invDay(lbSiteID_sensor.Text.Substring(0, 9), day.ToString("yyyy-MM-dd")); + } + } } }