Пример #1
0
        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 frmBillDetail_Load(object sender, EventArgs e)
        {
            CenterToScreen();
            bBD = new bBillDetail();
            bB  = new bBill();

            dgvBillDetail.DataSource = bBD.getAllBillDetail(int.Parse(billID));
            loadDataToTextbox();
            FormatDataGridview();
        }
Пример #3
0
        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);
        }
Пример #4
0
        private void frmDrugSell_Load(object sender, EventArgs e)
        {
            bMed = new bMedecine();
            bCus = new bCustomer();
            bB   = new bBill();
            bBD  = new bBillDetail();

            medecineID   = "";
            medecineName = "";

            //Load danh sách
            dgvMedList.DataSource = bMed.getAllMedecine();
            FormatDataGridviewMed();
            dgvCusList.DataSource = bCus.getAllCustomer();
            FormatDataGridviewCus();

            //Sử dụng AutoComplete
            txtSearch.AutoCompleteMode      = AutoCompleteMode.Suggest;
            txtSearch.AutoCompleteSource    = AutoCompleteSource.CustomSource;
            txtSearchCus.AutoCompleteMode   = AutoCompleteMode.Suggest;
            txtSearchCus.AutoCompleteSource = AutoCompleteSource.CustomSource;

            foreach (eMedicine med in bMed.getAllMedecine())
            {
                txtSearch.AutoCompleteCustomSource.Add(med.MedicineName);
            }
            foreach (eCustomer cus in bCus.getAllCustomer())
            {
                txtSearchCus.AutoCompleteCustomSource.Add(cus.CustomerName);
            }

            //Định dạng form
            setOnOffEditTextbox(0);
            btnSave.Enabled = false;
            lblNotify.Text  = "";
            InsertColumnsListView();
            txtTotalMoney.ReadOnly  = true;
            txtTotalMoney.BackColor = System.Drawing.SystemColors.Window;
            btnCancelBill.Enabled   = false;
            btnPay.Enabled          = false;

            dgvMedList.ReadOnly = true;
            dgvCusList.ReadOnly = true;
        }