Example #1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            ExpenseDetailManager newExpense = new ExpenseDetailManager();

            newExpense.TransactionID = Convert.ToInt32(lblTransactionID.Text);
            newExpense.LocationID    = Convert.ToInt32(drpLocationList.SelectedValue);
            newExpense.ClientID      = Convert.ToInt32(drpClientList.SelectedValue);
            newExpense.CategoryID    = Convert.ToInt32(drpCategoryList.SelectedValue);
            newExpense.PayTo         = txtPayTo.Text;
            newExpense.Date          = Convert.ToDateTime(dateTime.Text);
            newExpense.Amount        = Convert.ToInt32(txtAmount.Text);
            newExpense.Note          = txtNote.Text;

            bool restult = newExpense.UpdateExpense(newExpense);

            if (restult)
            {
                MessageBox.Show("Record Updated Succesfully.!");
                bindExpenseGrid();
                pnlExpenseForm.Visible = false;
                pnlExpenseGrid.Visible = true;
                btnUpdate.Visible      = false;
            }
            else
            {
                MessageBox.Show("Error.!");
            }
        }
Example #2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            ExpenseDetailManager newExpense = new ExpenseDetailManager();
            newExpense.TransactionID = Convert.ToInt32(lblTransactionID.Text);
            newExpense.LocationID = Convert.ToInt32(drpLocationList.SelectedValue);
            newExpense.ClientID = Convert.ToInt32(drpClientList.SelectedValue);
            newExpense.CategoryID = Convert.ToInt32(drpCategoryList.SelectedValue);
            newExpense.PayTo = txtPayTo.Text;
            newExpense.Date = Convert.ToDateTime(dateTime.Text);
            newExpense.Amount = Convert.ToInt32(txtAmount.Text);
            newExpense.Note = txtNote.Text;

            bool restult = newExpense.UpdateExpense(newExpense);

            if (restult)
            {
                MessageBox.Show("Record Updated Succesfully.!");
                bindExpenseGrid();
                pnlExpenseForm.Visible = false;
                pnlExpenseGrid.Visible = true;
                btnUpdate.Visible = false;

            }
            else
            {
                MessageBox.Show("Error.!");
            }
        }