Ejemplo n.º 1
0
    private void updateLogEntry()
    {
        if (lvwMain.SelectedIndices.Count == 0)
        {
            messageBoxOK("An entry must be selected before it can be updated.");
            return;
        }

        ListViewItem item  = lvwMain.SelectedItems[0];
        clsTimeEntry entry = (clsTimeEntry)item.Tag;

        try
        {
            frmAddUpdate addUpdate = new frmAddUpdate(2, entry);
            if (addUpdate.ShowDialog() == DialogResult.OK)
            {
                refreshView();
            }
        }
        catch
        {
            throw;
        }
        finally
        {
            refreshView();
        }
    }
Ejemplo n.º 2
0
    private void btnAdd_Click(object sender, EventArgs e)
    {
        frmAddUpdate addUpdate = new frmAddUpdate(1, null);

        if (addUpdate.ShowDialog() == DialogResult.OK)
        {
            refreshView();
        }
    }
Ejemplo n.º 3
0
    private void btnAdd_Click(object sender, EventArgs e)
    {
        frmAddUpdate addUpdate = new frmAddUpdate();

        addUpdate.Mode    = "Add";
        addUpdate.ZipCode = new clsZipCode();

        if (addUpdate.ShowDialog(this) == DialogResult.OK)
        {
            loadListBox();
        }
    }
Ejemplo n.º 4
0
    private void btnUpdate_Click(object sender, EventArgs e)
    {
        if (lstZipCodes.SelectedItems.Count == 0)
        {
            return;
        }

        frmAddUpdate addUpdate = new frmAddUpdate();

        addUpdate.Mode = "Update";

        int index = lstZipCodes.SelectedIndex;

        addUpdate.ZipCode = (clsZipCode)mZipCodeResultsAL[index];

        if (addUpdate.ShowDialog(this) == DialogResult.OK)
        {
            loadListBox();
        }
    }