protected void DeleteFlight(int id)
 {
     LogbookEntryDisplay.FDeleteEntry(id, this.User);
     FlushCache();
     BindData(Data);
     RefreshNumFlights();
     ItemDeleted?.Invoke(this, new LogbookEventArgs(id));
 }
    protected void mfbFlightContextMenu_DeleteFlight(object sender, LogbookEventArgs e)
    {
        if (e == null)
        {
            throw new ArgumentNullException("e");
        }

        LogbookEntryDisplay.FDeleteEntry(e.FlightID, Page.User.Identity.Name);
        Response.Redirect(TargetPage);
    }
Пример #3
0
    protected void mfbFlightContextMenu_DeleteFlight(object sender, LogbookEventArgs e)
    {
        if (e == null)
        {
            throw new ArgumentNullException("e");
        }

        LogbookEntryDisplay.FDeleteEntry(e.FlightID, this.User);
        FlushCache();
        BindData(Data);
        RefreshNumFlights();
        if (ItemDeleted != null)
        {
            ItemDeleted(this, new LogbookEventArgs(e.FlightID));
        }
    }
Пример #4
0
    protected void gvFlightLogs_RowCommand(Object sender, CommandEventArgs e)
    {
        if (e == null)
        {
            throw new ArgumentNullException("e");
        }

        int idFlight;

        if (!int.TryParse(e.CommandArgument.ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture, out idFlight))
        {
            idFlight = LogbookEntry.idFlightNew;
        }

        if (String.Compare(e.CommandName, "_Delete", StringComparison.OrdinalIgnoreCase) == 0)
        {
            LogbookEntryDisplay.FDeleteEntry(idFlight, this.User);
            FlushCache();
            BindData(Data);
            if (ItemDeleted != null)
            {
                ItemDeleted(this, new LogbookEventArgs(idFlight));
            }
        }
        else if (String.Compare(e.CommandName, "SendFlight", StringComparison.OrdinalIgnoreCase) == 0)
        {
            hdnFlightToSend.Value   = (string)e.CommandArgument;
            txtSendFlightEmail.Text = txtSendFlightMessage.Text = string.Empty;
            modalPopupSendFlight.Show();
        }
        else if (String.Compare(e.CommandName, "CloneFlight", StringComparison.OrdinalIgnoreCase) == 0)
        {
            Response.Redirect(ClonePath(idFlight));
        }
        else if (String.Compare(e.CommandName, "ReverseFlight", StringComparison.OrdinalIgnoreCase) == 0)
        {
            Response.Redirect(ReversePath(idFlight));
        }
        else if (String.Compare(e.CommandName, "EditFlight", StringComparison.OrdinalIgnoreCase) == 0)
        {
            if (idFlight == LogbookEntry.idFlightNew)
            {
                throw new MyFlightbookValidationException("Why is there an edit option for an empty flight?");
            }
            Response.Redirect(EditPath(idFlight));
        }
    }