Ejemplo n.º 1
0
        private void frmSanPham_Load(object sender, EventArgs e)
        {
            dtvSanPham.ReadOnly = true;

            cmbQuayHang.DataSource    = QuayHangCtrlTr.GetListQuayHang();
            cmbQuayHang.DisplayMember = "TenQuay";
            cmbQuayHang.ValueMember   = "MaQuay";

            dt = SanPhamCtrlTr.GetListSanPham();
            dtvSanPham.DataSource = dt;
        }
Ejemplo n.º 2
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            this.txtTenSP.Enabled    = true;
            this.txtGiaBan.Enabled   = true;
            this.txtGiaNhap.Enabled  = true;
            this.cmbDVT.Enabled      = true;
            this.cmbQuayHang.Enabled = true;
            this.txtHangSX.Enabled   = true;
            this.btnLuu.Visible      = true;
            this.btnHuy.Visible      = true;
            this.btnThem.Visible     = false;
            this.btnSua.Visible      = false;
            this.btnXoa.Visible      = false;
            this.btnThoat.Visible    = false;
            m_chucnang = "them";
            DataTable dtpn = new DataTable();

            dtpn = SanPhamCtrlTr.GetListSanPham();
            string s = "";

            if (dtpn.Rows.Count <= 0)
            {
                s = "0";
            }
            else
            {
                s = "HBL";
                s = (int.Parse(dtpn.Rows[dtpn.Rows.Count - 1][0].ToString().Trim()) + 1).ToString();
            }
            lalMaSP.Text = s;

            txtTenSP.Text  = "";
            txtHangSX.Text = "";
            cmbDVT.Text    = "";
            cmbQuayHang.ResetText();
            txtGiaNhap.Text  = "VNĐ";
            txtGiaBan.Text   = "VNĐ";
            nudSoLuong.Value = 0;
        }
Ejemplo n.º 3
0
 private void frmThongKeSoLuongHang_Load(object sender, EventArgs e)
 {
     dt = SanPhamCtrlTr.GetListSanPham();
     dtvSanPham.DataSource = dt;
 }