private void frmIncomeStatistics_Load(object sender, EventArgs e) { dtpIS.Format = DateTimePickerFormat.Custom; dtpIS.CustomFormat = "MM/yyyy"; bB = new bBill(); bBD = new bBillDetail(); dgvBillList.DataSource = bB.getAllBill(); FormatDgvIS(); rdoMonth.Checked = true; List <eBill> ls = new List <eBill>(); //DateTime date = new DateTime(Convert.ToInt32(dtpIS.Value.Year), Convert.ToInt32(dtpIS.Value.Month), Convert.ToInt32(dtpIS.Value.Day)); //MessageBox.Show(date.ToString()); ls = bB.getAllBill(); double total = 0; foreach (eBill b in ls) { total = total + bBD.totalMoney(b.BillID); } dgvBillList.DataSource = ls; lblIncome.Text = string.Format("{0:C}", Convert.ToDecimal(total.ToString())); lblsl.Text = dgvBillList.RowCount.ToString(); }
private void btnSave_Click(object sender, EventArgs e) { eCustomer cus = new eCustomer(); cus.CustomerID = txtBillID.Text; cus.CustomerName = txtOrderDate.Text; cus.Address = txtCusID.Text; cus.Phone = txtEmID.Text; //bB.updateCustomer(cus); btnSave.Enabled = false; btnSave.Text = "Lưu"; btnSave.BackColor = Color.Gainsboro; btnUpdate.Text = "Sửa"; btnUpdate.BackColor = Color.Gainsboro; label2.Text = ""; setOnOffEditTextbox(0); MessageBox.Show("Cập nhập hóa đơn thành công !", "Cập nhập", MessageBoxButtons.OK, MessageBoxIcon.Information); dgvBillList.DataSource = bB.getAllBill(); }
private void frmBillManager_Load(object sender, EventArgs e) { //Set giao diện lúc load bB = new bBill(); btnSave.Enabled = false; label2.Text = ""; //Load dữ liệu datagridview dgvBillList.DataSource = bB.getAllBill(); FormatDataGridview(); setOnOffEditTextbox(0); }