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

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

            bool restult = newExpense.AddExpense(newExpense);

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

            bool restult = newExpense.AddExpense(newExpense);

            if (restult)
            {
                MessageBox.Show("Record Inserted Succesfully.!");
                bindExpenseGrid();
                pnlExpenseGrid.Visible = true;
                pnlExpenseForm.Visible = false;
            }
            else
            {
                MessageBox.Show("Error.!");
            }
        }