Exemple #1
0
        public void LoadDataSanPham()
        {
            
            SanPhamBUS sp = new SanPhamBUS();
            dataSanPham.DataSource = sp.GetData();

        }
        private void SinhIDTuDong()
        {
            string    IDTuDong = "";
            DataTable dt       = busSP.GetData();

            if (dt.Rows.Count <= 0)
            {
                IDTuDong = "SP000001";
            }
            else
            {
                int number;
                IDTuDong = "SP";
                number   = Convert.ToInt32(dt.Rows[dt.Rows.Count - 1][0].ToString().Substring(2, 6));
                number++;
                if (number < 10)
                {
                    IDTuDong += "00000";
                }
                else if (number < 100)
                {
                    IDTuDong += "0000";
                }
                else if (number < 1000)
                {
                    IDTuDong += "000";
                }
                else if (number < 10000)
                {
                    IDTuDong += "00";
                }
                else if (number < 100000)
                {
                    IDTuDong += "0";
                }
                IDTuDong += number.ToString();
            }
            txtIDSanPham.Text = IDTuDong;
        }
Exemple #3
0
 private void HienThiSP()
 {
     dgvSP.DataSource = bus.GetData();
 }
Exemple #4
0
 private void HienThiSanPham()
 {
     cbbSanPham.Properties.DataSource    = busSP.GetData();
     cbbSanPham.Properties.ValueMember   = "IDSanPham";
     cbbSanPham.Properties.DisplayMember = "TenSanPham";
 }