Update RevDate to Today when RevNumber is changed
Handle using a TreeView that does not have a node selected
This commit is contained in:
@@ -502,7 +502,6 @@ namespace VEPROMS
|
||||
ApprovalProcedure ap = approvalProcedureBindingSource.Current as ApprovalProcedure;
|
||||
if (e.Col == 1)
|
||||
{ //revnumber
|
||||
ap.RevNumber = fgProcs[e.Row, e.Col].ToString();
|
||||
_MyApproval.Refresh();
|
||||
approvalInfoBindingSource.ResetBindings(false);
|
||||
bool ok = true;
|
||||
@@ -515,20 +514,17 @@ namespace VEPROMS
|
||||
if (e.Col == 2)
|
||||
{ //revdate
|
||||
DateTime dts = DateTime.Parse(fgProcs[e.Row, e.Col].ToString());
|
||||
Console.WriteLine("fgProcs_AfterEdit e.row={0}, fgprocs.mouserow={1}, ap.revdate={2}, dts={3}", e.Row, fgProcs.MouseRow,ap.RevDate,dts);
|
||||
//store mouse row because the popup calendar can goof up the datagrid mouse row
|
||||
int fgmr = fgProcs.MouseRow;
|
||||
if (e.Row == fgmr && ap.RevDate == dts)
|
||||
return;
|
||||
ap.RevDate = dts;
|
||||
if (chkSetAllDates.Checked)
|
||||
{
|
||||
foreach (ApprovalProcedure app in _MyApproval.MyProcedures)
|
||||
{
|
||||
app.RevDate = ap.RevDate;
|
||||
}
|
||||
Console.WriteLine("updating dates");
|
||||
approvalProcedureBindingSource.ResetBindings(false);
|
||||
// tmrRefresh.Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -616,7 +612,14 @@ namespace VEPROMS
|
||||
public string RevNumber
|
||||
{
|
||||
get { return _RevNumber; }
|
||||
set { _RevNumber = value.Trim(); }
|
||||
set
|
||||
{
|
||||
if (value.Trim() != _RevNumber)
|
||||
{
|
||||
_RevNumber = value.Trim();
|
||||
_RevDate = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
private DateTime _RevDate;
|
||||
public DateTime RevDate
|
||||
|
Reference in New Issue
Block a user