protected void gvDeadlines_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        if (e == null)
        {
            throw new ArgumentNullException(nameof(e));
        }
        DeadlineCurrency dc         = UserDeadlines[e.RowIndex];
        DeadlineCurrency dcOriginal = new DeadlineCurrency();

        util.CopyObject(dc, dcOriginal);
        Controls_mfbTypeInDate  typeinNew      = (Controls_mfbTypeInDate)gvDeadlines.Rows[e.RowIndex].FindControl("mfbUpdateDeadlineDate");
        Controls_mfbDecimalEdit typeinNewHours = (Controls_mfbDecimalEdit)gvDeadlines.Rows[e.RowIndex].FindControl("decNewHours");

        if (dc.AircraftHours > 0)
        {
            dc.AircraftHours = dc.NewHoursBasedOnHours(typeinNewHours.Value);
        }
        else
        {
            dc.Expiration = dc.NewDueDateBasedOnDate(typeinNew.Date);
        }

        if (dc.IsValid() && dc.FCommit())
        {
            gvDeadlines.EditIndex = -1;
            ForceRefresh();

            DeadlineUpdated?.Invoke(this, new DeadlineEventArgs(dcOriginal, dc));
        }
    }
    protected void gvDeadlines_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        if (e == null)
        {
            throw new ArgumentNullException("e");
        }
        DeadlineCurrency dc         = UserDeadlines[e.RowIndex];
        DeadlineCurrency dcOriginal = new DeadlineCurrency();

        util.CopyObject(dc, dcOriginal);
        Controls_mfbTypeInDate  typeinNew      = (Controls_mfbTypeInDate)gvDeadlines.Rows[e.RowIndex].FindControl("mfbUpdateDeadlineDate");
        Controls_mfbDecimalEdit typeinNewHours = (Controls_mfbDecimalEdit)gvDeadlines.Rows[e.RowIndex].FindControl("decNewHours");

        if (dc.AircraftHours > 0)
        {
            dc.AircraftHours = dc.NewHoursBasedOnHours(typeinNewHours.Value);
        }
        else
        {
            dc.Expiration = dc.NewDueDateBasedOnDate(typeinNew.Date);
        }

        if (dc.IsValid() && dc.FCommit())
        {
            gvDeadlines.EditIndex = -1;
            ForceRefresh();

            if (dc.AircraftID > 0)
            {
                string szDiff = dc.DifferenceDescription(dcOriginal);
                if (!String.IsNullOrEmpty(szDiff))
                {
                    MaintenanceLog ml = new MaintenanceLog()
                    {
                        AircraftID = dc.AircraftID, ChangeDate = DateTime.Now, User = UserName, Description = szDiff, Comment = string.Empty
                    };
                    ml.FAddToLog();
                }
            }

            if (DeadlineUpdated != null)
            {
                DeadlineUpdated(this, new DeadlineEventArgs(dcOriginal, dc));
            }
        }
    }