1.歸檔流程 - 獨立立昌

2.報表匯出功能, Null 異常修復
This commit is contained in:
jiahao 2023-09-02 09:17:48 +08:00
parent 9475fff227
commit 02e0245c92
10 changed files with 2017 additions and 1844 deletions

View File

@ -484,9 +484,30 @@ namespace SolarPower.Controllers
if (vForDataCount < (Formbody.Result.Data.Count - 1))//最後一筆(總計),不須取值 if (vForDataCount < (Formbody.Result.Data.Count - 1))//最後一筆(總計),不須取值
{ {
vForDataCount++; vForDataCount++;
avghour = (Convert.ToDouble(dbody["tothour"].ToString()) + Convert.ToDouble(avghour)).ToString(); object vv = "";
avgKWHKWP = (Convert.ToDouble(dbody["KWHKWP"].ToString()) + Convert.ToDouble(avgKWHKWP)).ToString();
avgdayKWH = (Convert.ToDouble(dbody["dayKWH"].ToString()) + Convert.ToDouble(avgdayKWH)).ToString(); avghour = Convert.ToString( dbody["tothour"]) ?? "NaN";
avgKWHKWP = Convert.ToString(dbody["KWHKWP"]) ?? "NaN";
avgKWHKWP = Convert.ToString(dbody["dayKWH"]) ?? "NaN";
//if (dbody.TryGetValue("tothour", out vv))
// avghour = (Convert.ToDouble(dbody["tothour"].ToString()) + Convert.ToDouble(avghour)).ToString();
//else
// avghour = "NaN";
//if (dbody.TryGetValue("KWHKWP", out vv))
// avgKWHKWP = (Convert.ToDouble(dbody["KWHKWP"].ToString()) + Convert.ToDouble(avgKWHKWP)).ToString();
//else
// avgKWHKWP = "NaN";
//if (dbody.TryGetValue("dayKWH", out vv))
// avgKWHKWP = (Convert.ToDouble(dbody["dayKWH"].ToString()) + Convert.ToDouble(avgdayKWH)).ToString();
//else
// avgKWHKWP = "NaN";
//avghour = (Convert.ToDouble(dbody["tothour"].ToString()) + Convert.ToDouble(avghour)).ToString();
//avgKWHKWP = (Convert.ToDouble(dbody["KWHKWP"].ToString()) + Convert.ToDouble(avgKWHKWP)).ToString();
//avgdayKWH = (Convert.ToDouble(dbody["dayKWH"].ToString()) + Convert.ToDouble(avgdayKWH)).ToString();
monthKWH = dbody["monthKWH"] == null ? "0" : dbody["monthKWH"].ToString(); monthKWH = dbody["monthKWH"] == null ? "0" : dbody["monthKWH"].ToString();
monthmoney = dbody["monthmoney"] == null ? "0" : dbody["monthmoney"].ToString(); monthmoney = dbody["monthmoney"] == null ? "0" : dbody["monthmoney"].ToString();
monthmoneyone = dbody["monthmoneyone"] == null ? "0" : dbody["monthmoneyone"].ToString(); monthmoneyone = dbody["monthmoneyone"] == null ? "0" : dbody["monthmoneyone"].ToString();

View File

@ -331,7 +331,7 @@ namespace solarApp.Service
{ {
//System.Diagnostics.Debug.WriteLine("【ArchiveRowData】[搬移資料失敗】"); //System.Diagnostics.Debug.WriteLine("【ArchiveRowData】[搬移資料失敗】");
TimeSpan duration = DateTime.Now - dt_start1; TimeSpan duration = DateTime.Now - dt_start1;
arclog.insert_log(_powerStationID, "move raw s1", duration.TotalSeconds, $"{_siteDB}.s{_siteID}_station", $"{_siteDB}_history.s{_siteID}_station", "1", ex.Message, "0", conn, null); arclog.insert_log(_powerStationID, @$"move raw s1-{move_month}", duration.TotalSeconds, $"{_siteDB}.s{_siteID}_station", $"{_siteDB}_history.s{_siteID}_station", "1", ex.Message, "0", conn, null);
throw ex; throw ex;
} }
@ -366,7 +366,7 @@ namespace solarApp.Service
//System.Diagnostics.Debug.WriteLine($"【ArchiveRowData】{_siteDB}.s{_siteID}_inv的七月前資料寫入至{_siteDB}_history.s{_siteID}_inv【寫入成功】於{dateTime}"); //System.Diagnostics.Debug.WriteLine($"【ArchiveRowData】{_siteDB}.s{_siteID}_inv的七月前資料寫入至{_siteDB}_history.s{_siteID}_inv【寫入成功】於{dateTime}");
// log // log
TimeSpan duration = DateTime.Now - dt_start1; TimeSpan duration = DateTime.Now - dt_start1;
arclog.insert_log(_powerStationID, "move raw s1", duration.TotalSeconds, $"{_siteDB}.s{_siteID01}_inv", $"{_siteDB}_history.s{_siteID01}_inv", "0", "", rowCT.ToString(), conn, null); arclog.insert_log(_powerStationID, @$"move raw s1 - {move_month}", duration.TotalSeconds, $"{_siteDB}.s{_siteID01}_inv", $"{_siteDB}_history.s{_siteID01}_inv", "0", "", rowCT.ToString(), conn, null);
//arclog.insert_log(_powerStationID, "sensor step1", duration.TotalSeconds, "sensor_history_hour", "insert sensor hour", "0", "", rowCT.ToString(), conn, cmd); //arclog.insert_log(_powerStationID, "sensor step1", duration.TotalSeconds, "sensor_history_hour", "insert sensor hour", "0", "", rowCT.ToString(), conn, cmd);
dt_start1 = DateTime.Now; dt_start1 = DateTime.Now;
@ -375,12 +375,12 @@ namespace solarApp.Service
rowCT = conn.Execute(for_delete_inv, commandTimeout: 6000); rowCT = conn.Execute(for_delete_inv, commandTimeout: 6000);
//System.Diagnostics.Debug.WriteLine($"【ArchiveRowData】{_siteDB}.s{_siteID}_sensoravg搬移至{_siteDB}_history.s{_siteID}_sensoravg【搬移資料成功】於{dateTime} 共 {delete_inv.ToString()} 筆"); //System.Diagnostics.Debug.WriteLine($"【ArchiveRowData】{_siteDB}.s{_siteID}_sensoravg搬移至{_siteDB}_history.s{_siteID}_sensoravg【搬移資料成功】於{dateTime} 共 {delete_inv.ToString()} 筆");
duration = DateTime.Now - dt_start1; duration = DateTime.Now - dt_start1;
arclog.insert_log(_powerStationID, "delete raw s2", duration.TotalSeconds, $"{_siteDB}.s{_siteID01}_inv", "", "0", "", rowCT.ToString(), conn, null); arclog.insert_log(_powerStationID, @$"delete raw s2 - {move_month}", duration.TotalSeconds, $"{_siteDB}.s{_siteID01}_inv", "", "0", "", rowCT.ToString(), conn, null);
} }
catch (Exception ex) catch (Exception ex)
{ {
TimeSpan duration = DateTime.Now - dt_start1; TimeSpan duration = DateTime.Now - dt_start1;
arclog.insert_log(_powerStationID, "move raw s1", duration.TotalSeconds, $"{_siteDB}.s{_siteID01}_station", $"{_siteDB}_history.s{_siteID01}_station", "1", ex.Message, "0", conn, null); arclog.insert_log(_powerStationID, @$"move raw s1 - {move_month}", duration.TotalSeconds, $"{_siteDB}.s{_siteID01}_station", $"{_siteDB}_history.s{_siteID01}_station", "1", ex.Message, "err", conn, null);
//arclog.insert_log(_powerStationID, "sensor step1", duration.TotalSeconds, "sensor_history_hour", "insert sensor hour", "0", "", rowCT.ToString(), conn, cmd); //arclog.insert_log(_powerStationID, "sensor step1", duration.TotalSeconds, "sensor_history_hour", "insert sensor hour", "0", "", rowCT.ToString(), conn, cmd);
throw ex; throw ex;
} }
@ -411,20 +411,20 @@ namespace solarApp.Service
int rowCT = conn.Execute(for_insert_sensoravg, commandTimeout: 600); int rowCT = conn.Execute(for_insert_sensoravg, commandTimeout: 600);
// log // log
TimeSpan duration = DateTime.Now - dt_start1; TimeSpan duration = DateTime.Now - dt_start1;
arclog.insert_log(_powerStationID, "move raw s1", duration.TotalSeconds, $"{_siteDB}.s{_siteID01}_sensoravg", $"{_siteDB}_history.s{_siteID01}_sensoravg", "0", "", rowCT.ToString(), conn, null); arclog.insert_log(_powerStationID, @$"move raw s1 - {move_month}", duration.TotalSeconds, $"{_siteDB}.s{_siteID01}_sensoravg", $"{_siteDB}_history.s{_siteID01}_sensoravg", "0", "", rowCT.ToString(), conn, null);
dt_start1 = DateTime.Now; dt_start1 = DateTime.Now;
string for_delete_sensoravg = $@"DELETE FROM {_siteDB}.s{_siteID01}_sensoravg WHERE LEFT(crdTime, 7) < '{move_month}'"; string for_delete_sensoravg = $@"DELETE FROM {_siteDB}.s{_siteID01}_sensoravg WHERE LEFT(crdTime, 7) < '{move_month}'";
rowCT = conn.Execute(for_delete_sensoravg, commandTimeout: 600); rowCT = conn.Execute(for_delete_sensoravg, commandTimeout: 600);
duration = DateTime.Now - dt_start1; duration = DateTime.Now - dt_start1;
arclog.insert_log(_powerStationID, "delete raw s2", duration.TotalSeconds, $"{_siteDB}.s{_siteID01}_sensoravg", "", "0", "", rowCT.ToString(), conn, null); arclog.insert_log(_powerStationID, @$"delete raw s2 - {move_month}", duration.TotalSeconds, $"{_siteDB}.s{_siteID01}_sensoravg", "", "0", "", rowCT.ToString(), conn, null);
} }
catch (Exception ex) catch (Exception ex)
{ {
TimeSpan duration = DateTime.Now - dt_start1; TimeSpan duration = DateTime.Now - dt_start1;
arclog.insert_log(_powerStationID, "move raw s1", duration.TotalSeconds, $"{_siteDB}.s{_siteID01}_sensoravg", $"{_siteDB}_history.s{_siteID01}_sensoravg", "1", ex.Message, "0", conn, null); arclog.insert_log(_powerStationID, @$"move raw s1 - {move_month}", duration.TotalSeconds, $"{_siteDB}.s{_siteID01}_sensoravg", $"{_siteDB}_history.s{_siteID01}_sensoravg", "1", ex.Message, "0", conn, null);
throw; throw;
} }

View File

@ -194,13 +194,36 @@ namespace solarApp.Service
string sql = @" select id, CompanyId, `code` , SerialNumber, CONCAT(`code` ,'01') SiteID, SiteDB, `name` SiteName string sql = @" select id, CompanyId, `code` , SerialNumber, CONCAT(`code` ,'01') SiteID, SiteDB, `name` SiteName
from power_station from power_station
where deleted = 0 and `status`= 1 where deleted = 0 and `status`= 1
ORDER BY GeneratingCapacity "; ORDER BY id ";
// id <> 14";and id > 24 // id <> 14";and id > 24
List<station_list> ds = conn.Query<station_list>(sql).AsList<station_list>(); List<station_list> ds = conn.Query<station_list>(sql).AsList<station_list>();
conn.Close(); conn.Close();
return ds; return ds;
} }
} }
public List<station_list> get_station_list32(bool include32)
{
using (MySqlConnection conn = new MySqlConnection(Connection1))
{
conn.Open(); // 01 控制器編號
string sql = @" select id, CompanyId, `code` , SerialNumber, CONCAT(`code` ,'01') SiteID, SiteDB, `name` SiteName
from power_station
where deleted = 0 and `status`= 1 and id <> 32 ";
if (include32)
{
sql = @" select id, CompanyId, `code` , SerialNumber, CONCAT(`code` ,'01') SiteID, SiteDB, `name` SiteName
from power_station
where deleted = 0 and `status`= 1 and id = 32";
}
// id <> 14";and id > 24
List<station_list> ds = conn.Query<station_list>(sql).AsList<station_list>();
conn.Close();
return ds;
}
}
public List<PowerStation> get_powerStation() public List<PowerStation> get_powerStation()
{ {
using (MySqlConnection conn = new MySqlConnection(Connection1)) using (MySqlConnection conn = new MySqlConnection(Connection1))

View File

@ -562,7 +562,7 @@ namespace solarApp.Service
} }
catch (Exception ex) catch (Exception ex)
{ {
arclog.insert_log(_powerStationID, "sensor step1 ", 0, "sensor_history_", "insert sensor error", "0", "", "", conn, cmd); arclog.insert_log(_powerStationID, "sensor step1 ", 0, "sensor_history_", "insert sensor error", "err", "", "", conn, cmd);
//throw ex; //throw ex;
} }
@ -628,7 +628,7 @@ namespace solarApp.Service
} }
catch (Exception ex) catch (Exception ex)
{ {
arclog.insert_log(_powerStationID, "sensor step1 irrDayHour", 0, "sensor_history_", "sensor_history_hour error", "0", "", "", conn, cmd); arclog.insert_log(_powerStationID, "sensor step1 irrDayHour", 0, "sensor_history_", "sensor_history_hour error", "err", "", "", conn, cmd);
//throw ex; //throw ex;
} }
conn.Close(); conn.Close();
@ -716,7 +716,7 @@ namespace solarApp.Service
catch (Exception ex) catch (Exception ex)
{ {
//throw ex; //throw ex;
arclog.insert_log(_powerStationID, "sensor step1 meter_hour", 0, "meter_history_hour", "meter_history_hour error", "0", "", "", conn, null); arclog.insert_log(_powerStationID, "sensor step1 meter_hour", 0, "meter_history_hour", "meter_history_hour error", "err", "", "", conn, null);
} }
conn.Close(); conn.Close();
} }

File diff suppressed because it is too large Load Diff

View File

@ -64,7 +64,7 @@ namespace solarApp
private void fmArchive_Load(object sender, EventArgs e) private void fmArchive_Load(object sender, EventArgs e)
{ {
// MessageBox.Show(" loading "); // MessageBox.Show(" loading ");
#region #region
int i = 0; int i = 0;
var site_list = stationSvc.get_station_list(); var site_list = stationSvc.get_station_list();
@ -338,27 +338,37 @@ namespace solarApp
private void bt_archive_Click(object sender, EventArgs e) private void bt_archive_Click(object sender, EventArgs e)
{ {
var site_list = stationSvc.get_station_list(); var site_list = stationSvc.get_station_list32(false); // 不含 32
//var site_list = stationSvc.get_station_list32(true); // 不含 32
string date1 = dtSelect1.Value.ToString("yyyy-MM-dd"); string date1 = dtSelect1.Value.ToString("yyyy-MM-dd");
string date2 = dtSelect2.Value.ToString("yyyy-MM-dd"); string date2 = dtSelect2.Value.ToString("yyyy-MM-dd");
procSensorSvc sensorSvc = new procSensorSvc(); procSensorSvc sensorSvc = new procSensorSvc();
procInvSvc invSvc = new procInvSvc(); procInvSvc invSvc = new procInvSvc();
procStationSvc siteSvc = new procStationSvc(); procStationSvc siteSvc = new procStationSvc();
archiveRawData(site_list, date1, date2, sensorSvc, invSvc, siteSvc);
//單獨製作 32
site_list = stationSvc.get_station_list32(true); // 不含 32
archiveRawData(site_list, date1, date2, sensorSvc, invSvc, siteSvc);
lbMsgTitle.Text = System.DateTime.Now.ToString() + " 完成!";
}
private void archiveRawData(List<station_list> site_list, string date1, string date2, procSensorSvc sensorSvc, procInvSvc invSvc, procStationSvc siteSvc)
{
foreach (var item in site_list) foreach (var item in site_list)
{ {
//RadioButton rb = new RadioButton(); RadioButton rb = new RadioButton();
//rb.Name = item.SiteID; rb.Name = item.SiteID;
//rb.Text = item.SiteName; rb.Text = item.SiteName;
//rb.Tag = item.SiteDB; rb.Tag = item.SiteDB;
//foreach (DateTime day in EachDay(DateTime.Parse(date1), DateTime.Parse(date2))) foreach (DateTime day in EachDay(DateTime.Parse(date1), DateTime.Parse(date2)))
//{ {
// sensorSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); sensorSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd"));
// invSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); invSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd"));
// siteSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); siteSvc.archiveData(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd"));
//} }
} }
sensorSvc.isFirst = true; sensorSvc.isFirst = true;
foreach (var item in site_list) foreach (var item in site_list)
@ -371,8 +381,6 @@ namespace solarApp
invSvc.report_invDay(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd")); invSvc.report_invDay(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd"));
} }
} }
lbMsgTitle.Text = System.DateTime.Now.ToString() + " 完成!";
} }
private void bt_clear_sensor_Click(object sender, EventArgs e) private void bt_clear_sensor_Click(object sender, EventArgs e)
@ -433,7 +441,7 @@ namespace solarApp
string date1 = dtSelect1.Value.ToString("yyyy-MM-dd"); string date1 = dtSelect1.Value.ToString("yyyy-MM-dd");
string date2 = dtSelect2.Value.ToString("yyyy-MM-dd"); string date2 = dtSelect2.Value.ToString("yyyy-MM-dd");
get_inv_svc invSvc = new get_inv_svc(); get_inv_svc invSvc = new get_inv_svc();
var ds = invSvc.get_ck_invDay_list(date1, date2); var ds = invSvc.get_ck_invDay_list(date1, date2);
gv_rpt_invDay.DataSource = ds; gv_rpt_invDay.DataSource = ds;
gv_rpt_invDay.Columns[0].Width = 60; gv_rpt_invDay.Columns[0].Width = 60;
gv_rpt_invDay.Columns[1].Width = 80; gv_rpt_invDay.Columns[1].Width = 80;
@ -481,9 +489,10 @@ namespace solarApp
gv_inv_detail.Columns[1].Width = 160; //invID gv_inv_detail.Columns[1].Width = 160; //invID
gv_inv_detail.Columns[2].Width = 80; gv_inv_detail.Columns[2].Width = 80;
gv_inv_detail.Columns[3].Width = 90; gv_inv_detail.Columns[3].Width = 90;
} else }
else
{ // 日報 { // 日報
var ds = invSvc.get_reportDay(powerStationID, date1, date2); var ds = invSvc.get_reportDay(powerStationID, date1, date2);
gv_inv_detail.DataSource = ds; gv_inv_detail.DataSource = ds;
gv_inv_detail.Columns[0].Width = 60; gv_inv_detail.Columns[0].Width = 60;
gv_inv_detail.Columns[1].Width = 80; //report_date gv_inv_detail.Columns[1].Width = 80; //report_date
@ -761,10 +770,11 @@ namespace solarApp
if (result.CompareTo("成功") == 0) if (result.CompareTo("成功") == 0)
{ {
// MessageBox.Show("【SendEmailJob】 寄送成功! "); // MessageBox.Show("【SendEmailJob】 寄送成功! ");
richTextBox1.AppendText(Environment.NewLine + System.DateTime.Now.ToString() + " " + result.ToString()); richTextBox1.AppendText(Environment.NewLine + System.DateTime.Now.ToString() + " " + result.ToString());
} }
else { else
{
richTextBox1.AppendText(Environment.NewLine + System.DateTime.Now.ToShortTimeString() + " " + result.ToString()); richTextBox1.AppendText(Environment.NewLine + System.DateTime.Now.ToShortTimeString() + " " + result.ToString());
} }
} }

View File

@ -1,4 +1,64 @@
<root> <?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: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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@ namespace solarApp
public fmMain() public fmMain()
{ {
InitializeComponent(); InitializeComponent();
// init_GridView(); // init_GridView();
} }
private async void button1_Click(object sender, EventArgs e) private async void button1_Click(object sender, EventArgs e)
@ -45,7 +45,7 @@ namespace solarApp
gv_web_inv_day.DataSource = inv_svc.get_web_Inv_day(date1, date2, lbInverterID.Text); gv_web_inv_day.DataSource = inv_svc.get_web_Inv_day(date1, date2, lbInverterID.Text);
gv_web_inv_month.DataSource = inv_svc.get_web_Inv_month( date1.Substring(0, 7), date2.Substring(0, 7), lbInverterID.Text); gv_web_inv_month.DataSource = inv_svc.get_web_Inv_month(date1.Substring(0, 7), date2.Substring(0, 7), lbInverterID.Text);
lbMsg_inv.Text = " done " + System.DateTime.Now.ToShortTimeString(); lbMsg_inv.Text = " done " + System.DateTime.Now.ToShortTimeString();
} }
@ -57,7 +57,7 @@ namespace solarApp
//string date2 = dtSelect_sensor2.Value.ToString("yyyy-MM-dd"); //string date2 = dtSelect_sensor2.Value.ToString("yyyy-MM-dd");
string date1 = dtselect_inv.Value.AddDays(-7).ToString("yyyy-MM-dd"); string date1 = dtselect_inv.Value.AddDays(-7).ToString("yyyy-MM-dd");
gv_web_inv_hour.DataSource = inv_svc.get_web_Inv_15min(date2, lbInverterID.Text , lbSiteID_inv.Text.Substring(0, 9)); gv_web_inv_hour.DataSource = inv_svc.get_web_Inv_15min(date2, lbInverterID.Text, lbSiteID_inv.Text.Substring(0, 9));
} }
private void fmMain_Load(object sender, EventArgs e) private void fmMain_Load(object sender, EventArgs e)
@ -112,7 +112,7 @@ namespace solarApp
lbSiteID_sensor.Text = lbSiteID_inv.Text; lbSiteID_sensor.Text = lbSiteID_inv.Text;
//顯示 table name on label //顯示 table name on label
lbSiteRaw.Text = lbSiteName_inv.Text + " "+ lbSiteDB_inv.Text + ".s" + lbSiteID_inv.Text + "_Station"; lbSiteRaw.Text = lbSiteName_inv.Text + " " + lbSiteDB_inv.Text + ".s" + lbSiteID_inv.Text + "_Station";
lbInvRaw.Text = lbSiteName_inv.Text + " " + lbSiteDB_inv.Text + ".s" + lbSiteID_inv.Text + "_Inv"; lbInvRaw.Text = lbSiteName_inv.Text + " " + lbSiteDB_inv.Text + ".s" + lbSiteID_inv.Text + "_Inv";
lbSensorRaw.Text = lbSiteName_inv.Text + " " + lbSiteDB_inv.Text + ".s" + lbSiteID_inv.Text + "_SensorAVG"; lbSensorRaw.Text = lbSiteName_inv.Text + " " + lbSiteDB_inv.Text + ".s" + lbSiteID_inv.Text + "_SensorAVG";
@ -125,9 +125,10 @@ namespace solarApp
/// </summary> /// </summary>
/// <param name="siteDB"></param> /// <param name="siteDB"></param>
/// <param name="siteID"></param> /// <param name="siteID"></param>
void add_inv_list(string siteDB, string siteID) { void add_inv_list(string siteDB, string siteID)
{
fp_inv.Controls.Clear(); fp_inv.Controls.Clear();
var inv_list = inv_svc.get_Inv_list(siteDB, siteID); var inv_list = inv_svc.get_Inv_list(siteDB, siteID);
int i = 0; int i = 0;
foreach (var item in inv_list) foreach (var item in inv_list)
{ {
@ -196,9 +197,9 @@ namespace solarApp
gv_fic_station_raw.DataSource = stationSvc.get_station_raw(date2, lbSiteDB_inv.Text, lbSiteID_inv.Text); gv_fic_station_raw.DataSource = stationSvc.get_station_raw(date2, lbSiteDB_inv.Text, lbSiteID_inv.Text);
gv_fic_station_day.DataSource = stationSvc.get_station_rawAvg(date1, date2, lbSiteDB_inv.Text, lbSiteID_inv.Text); gv_fic_station_day.DataSource = stationSvc.get_station_rawAvg(date1, date2, lbSiteDB_inv.Text, lbSiteID_inv.Text);
} }
catch (Exception ex ) catch (Exception ex)
{ {
MessageBox.Show( ex.Message); MessageBox.Show(ex.Message);
} }
gv_web_station_hour.DataSource = stationSvc.get_web_station_hour(date2, lbSiteID_inv.Text); gv_web_station_hour.DataSource = stationSvc.get_web_station_hour(date2, lbSiteID_inv.Text);
@ -329,7 +330,7 @@ namespace solarApp
private void button1_Click_2(object sender, EventArgs e) private void button1_Click_2(object sender, EventArgs e)
{ {
if(label13.Text == "solar_master.notice_schedule資料表") if (label13.Text == "solar_master.notice_schedule資料表")
{ {
gv_notice_data.DataSource = errorSvc.QueryAlarmorion_orionalarmrecordData(); gv_notice_data.DataSource = errorSvc.QueryAlarmorion_orionalarmrecordData();
label13.Text = "solar_master.alarmorion_orionalarmrecord資料表"; label13.Text = "solar_master.alarmorion_orionalarmrecord資料表";

View File

@ -1,4 +1,64 @@
<root> <?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: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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">