Beispiel #1
0
 private void FormThemSP_Load(object sender, EventArgs e)
 {
     cbbKieuSP.DataSource    = k.LayKieuSP();
     cbbKieuSP.DisplayMember = "TenKieuSP";
     cbbKieuSP.ValueMember   = "MaKieuSP";
     cbbLoaiSP.DataSource    = lo.LayLoaiSP();
     cbbLoaiSP.DisplayMember = "TenLoaiSP";
     cbbLoaiSP.ValueMember   = "MaLoaiSP";
     if (MaSP != 0)
     {
         txtMaSP.Text            = MaSP.ToString();
         cbbKieuSP.SelectedValue = sp.Lay1LSP(MaSP).MaKieuSP;
         cbbLoaiSP.SelectedValue = sp.Lay1LSP(MaSP).MaLoaiSP;
         txtDonGiaBan.Text       = sp.Lay1LSP(MaSP).DonGiaBan.ToString();
         txtTrongLuong.Text      = sp.Lay1LSP(MaSP).TrongLuong.ToString();
     }
 }
Beispiel #2
0
 public void load()
 {
     dataGridView1.DataSource = lo.LayLoaiSP();
     dataGridView1.Columns["MaDonViTinh"].Visible         = false;
     dataGridView1.Columns["TenDonVi"].HeaderText         = "Đơn vị tính";
     dataGridView1.Columns["TenLoaiSP"].HeaderText        = "Loai sản phẩm";
     dataGridView1.Columns["PhanTramLoiNhuan"].HeaderText = "Phần trăm lợi nhuận";
     dataGridView1.Columns["MaLoaiSP"].HeaderText         = "Mã loại sản phẩm";
 }
Beispiel #3
0
 void load()
 {
     dataGridView1.DataSource = sp.LaySP();
     dataGridView1.Columns["MaLoaiSP"].Visible = false;
     dataGridView1.Columns["MaKieuSP"].Visible = false;
     cbbKieuSP.DataSource    = k.LayKieuSP();
     cbbKieuSP.DisplayMember = "TenKieuSP";
     cbbKieuSP.ValueMember   = "MaKieuSP";
     cbbLoaiSP.DataSource    = lo.LayLoaiSP();
     cbbLoaiSP.DisplayMember = "TenLoaiSP";
     cbbLoaiSP.ValueMember   = "MaLoaiSP";
     dataGridView1.Columns["TrongLuong"].HeaderText   = "Trọng lượng";
     dataGridView1.Columns["DonGiaBan"].HeaderText    = "Đơn giá bán";
     dataGridView1.Columns["SoLuongTon"].HeaderText   = "Số lượng tổn";
     dataGridView1.Columns["MaSP"].HeaderText         = "Mã sản phẩm";
     dataGridView1.Columns["TenLoaiSP"].HeaderText    = "Loại sản phẩm";
     dataGridView1.Columns["TenKieuSP"].HeaderText    = "Kiểu sản phẩm";
     dataGridView1.Columns["TenDonViTinh"].HeaderText = "Dơn vị tính";
 }
        private void btnAddLoaiSP_Click(object sender, EventArgs e)
        {
            FormThemLoaiSP them = new FormThemLoaiSP();

            them.ShowDialog();
            if (them.DialogResult == DialogResult.Cancel)
            {
                cbbLoaiSP.DataSource    = lo.LayLoaiSP();
                cbbLoaiSP.DisplayMember = "TenLoaiSP";
                cbbLoaiSP.ValueMember   = "MaLoaiSP";
            }
        }