C2023-006 Add time / eidt time to showing change bars.
This commit is contained in:
@@ -32,13 +32,46 @@ namespace VEPROMS
|
||||
{
|
||||
string cbdt = MyProcConfig.Print_ChangeBarDate;
|
||||
string[] tmp = cbdt.Split(' ');
|
||||
cbdt = tmp[0] + " 00:00:00";
|
||||
dateTimeInput1.Value = (cbdt == null || cbdt == "") ? DateTime.Now : DateTime.Parse(cbdt);
|
||||
|
||||
if (tmp[0] == null || tmp[0] == "") // First time date set.
|
||||
{
|
||||
cbdt = DateTime.Now.ToString("MM/dd/yyyy") + " " + DateTime.Now.ToString("HH:mm:ss");
|
||||
dateTimeInput1.Value = DateTime.Parse(cbdt);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
DateTime tmpdt = DateTime.Parse(cbdt);
|
||||
if (tmpdt.Date == DateTime.Today) // Date has before been set.
|
||||
{
|
||||
TimeSpan start = TimeSpan.Parse("00:00:00");
|
||||
|
||||
var time = tmpdt.TimeOfDay;
|
||||
if (start < time) // If time is greater than 12:00:00 AM
|
||||
{
|
||||
cbdt = DateTime.Now.ToString("MM/dd/yyyy") + " " + tmpdt.TimeOfDay.ToString();
|
||||
dateTimeInput1.Value = DateTime.Parse(cbdt);
|
||||
return;
|
||||
}
|
||||
else // if time is 12:00:00 AM
|
||||
{
|
||||
cbdt = DateTime.Now.ToString("MM/dd/yyyy") + " " + " 00:00:00";
|
||||
dateTimeInput1.Value = DateTime.Parse(cbdt);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cbdt = tmpdt.ToString();
|
||||
dateTimeInput1.Value = DateTime.Parse(cbdt);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy 00:00:00");// ("MM/dd/yyyy HH:mm:ss");
|
||||
MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss");// ("MM/dd/yyyy HH:mm:ss");
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user