示例#1
0
        private void FillGrid()
        {
            DateTime from = GetDateFromControl(FromDate);
            DateTime to = GetDateFromControl(ToDate);

            List<DayBook> billing = new DayBookData().GetDayBook(from, to);

            FinanceGrid.DataSource = billing;
            FinanceGrid.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
            FinanceGrid.ClearSelection();

            FinanceGrid.Columns["DayBookId"].IsVisible = false;
            FinanceGrid.Columns["UpdatedOn"].IsVisible = false;
        }
示例#2
0
        private void btnDeleteBilling_Click(object sender, EventArgs e)
        {
            string id = txtBillingId.Text.Trim();
            if (id == "")
            {
                MessageBox.Show("Select(double click) a billing to update");
                return;
            }

            bool result = new DayBookData().DeleteDayBook(
                                            Convert.ToInt32(id));
            if (result)
            {
                MessageBox.Show("Deleted Successfully");
                FillGrid();
                RefreshTexts();
            }
            else
            {
                MessageBox.Show("Billing could not be deleted. Please contact admin.");
                return;
            }
        }
示例#3
0
        private void btnAddBilling_Click(object sender, EventArgs e)
        {
            DayBook billing = GetFormData();
            if (billing == null)
            {
                return;
            }
            bool result = new DayBookData().AddDayBook(billing);

            if (result)
            {
                MessageBox.Show("Added Successfully");
                RefreshTexts();
                FillGrid();
            }
            else
            {
                MessageBox.Show("Billing could not be added. Please contact admin.");
                return;
            }
        }