Пример #1
0
        private void btnThanhToan_Click(object sender, EventArgs e)
        {
            if (IsInputErr()) return;

            using (QuanLyBanBUS bus = new QuanLyBanBUS())
            {
                BanHangDTO info = new BanHangDTO
                {
                    Msnv = ThuNgan.MsnvLogin,
                    MaSoBan = QuanLyBanBUS.Masoban,
                    SoHoaDon = Convert.ToInt32(txtSoHoaDon.Text),
                    GioRa = DateTime.Now,
                    GhiChu = txtGhiChu.Text,
                    KhuyenMai = nudThue.Value,
                    TongTien = int.Parse(lblTongTien.Text, NumberStyles.AllowThousands,
                            CultureInfo.CreateSpecificCulture("vi-VN")),
                    ChiTiet = bus.LoadHangHoa()
                };

                bus.BanHang(info);
            }

            using (QuanLyBanBUS bus = new QuanLyBanBUS())
                bus.ClearHangHoa();
            RefreshHangHoa();
        }
Пример #2
0
        private void btnIn_Click(object sender, EventArgs e)
        {
            if(IsInputErr()) return;

            using (QuanLyBanBUS bus = new QuanLyBanBUS())
            {
                BanHangDTO info = new BanHangDTO
                {
                    MaSoBan = QuanLyBanBUS.Masoban,
                    SoHoaDon = Convert.ToInt32(txtSoHoaDon.Text),
                    GioRa = DateTime.Now,
                    GhiChu = txtGhiChu.Text,
                    ChuaThue = int.Parse(lblExclTax.Text, NumberStyles.AllowThousands, CultureInfo.CreateSpecificCulture("vi-VN")),
                    KhuyenMai = nudThue.Value,
                    TongTien = int.Parse(lblTongTien.Text, NumberStyles.AllowThousands, CultureInfo.CreateSpecificCulture("vi-VN")),
                    ChiTiet = bus.LoadHangHoa()
                };

                new BanHangReport(info).ShowDialog();
            }
        }
Пример #3
0
        private void RefreshHangHoa()
        {
            using (QuanLyBanBUS bus = new QuanLyBanBUS())
                dataGridView1.DataSource = bus.LoadHangHoa();

            using (QuanLyBanBUS bus = new QuanLyBanBUS())
            {
                int exclTax = bus.ExclTax();
                lblExclTax.Text = exclTax.ToString("N0", CultureInfo.CreateSpecificCulture("vi-VN"));
                lblTongTien.Text = (exclTax - (exclTax * nudThue.Value * 0.01m)).ToString("N0", CultureInfo.CreateSpecificCulture("vi-VN"));
            }

            listView1.Items.OfType<ListViewItem>().Single(i => (int) i.Tag == QuanLyBanBUS.Masoban).ImageIndex = dataGridView1.Rows.Count == 0 ? 0 : 1;
        }