Пример #1
0
 private void btsua1_Click(object sender, EventArgs e)
 {
     if (!kt())
     {
         return;
     }
     try
     {
         using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
         {
             KhachHang kh = quanli.KhachHangs.FirstOrDefault(p => p.MaKH == makhachhang);
             kh.TenKH  = txttenkh.Text;
             kh.DiaChi = txtdiachi.Text;
             kh.SDT    = int.Parse(txtsdt.Text);
             kh.Email  = txtemail.Text;
             quanli.SaveChanges();
             MessageBox.Show("Đã sửa");
             kh1_Load(sender, e);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Không thể sửa, vui lòng kiểm tra lại!");
         return;
     }
 }
Пример #2
0
        private void btdangnhap_Click(object sender, EventArgs e)
        {
            using (quanlithucungEntities1 thucung = new quanlithucungEntities1())
            {
                List <KhachHang> list = thucung.KhachHangs.ToList();
                KhachHang        kh   = thucung.KhachHangs.FirstOrDefault(p => p.TenKH.Trim() == txtten.Text && p.Email.Trim() == txtemail.Text);

                if (kh != null)
                {
                    MessageBox.Show("Đăng nhập thành công.");
                    tenquaform.tenkh = txtten.Text;
                    Client f = new Client();
                    this.Hide();
                    f.ShowDialog();

                    //f.Ten = tbtk.Text;
                    //this.Hide();
                    //f.ShowDialog();
                }
                else
                {
                    MessageBox.Show("tài khoản mật khẩu không chính xác.Vui lòng nhập lại!");
                }
            }
        }
Пример #3
0
        private void themThucPham()
        {
            string tenthucpham = cbTen.Text;

            using (quanlithucungEntities1 qlthucpham = new quanlithucungEntities1())
            {
                THUCPHAM tp = qlthucpham.THUCPHAMs.FirstOrDefault(p => p.Tenthucpham.ToLower() == tenthucpham.ToLower());
                if (tp == null)
                {
                    qlthucpham.insertCTTP(mapn, int.Parse(txtSoLuong.Text), double.Parse(txtGia.Text), tenthucpham, cbLoai.SelectedValue.ToString(), null, txtdonvi.Text);
                    qlthucpham.SaveChanges();
                    MessageBox.Show("Thêm thành công!");
                }
                else
                {
                    tp.SOLUONG += int.Parse(txtSoLuong.Text);
                    CTNhapThucPham tpm = new CTNhapThucPham();
                    tpm.MaPN        = mapn;
                    tpm.MaThucPham  = tp.Mathucpham;
                    tpm.TenThucPham = tp.Tenthucpham;
                    tpm.MaLoai      = cbLoai.SelectedValue.ToString();
                    tpm.Soluong     = int.Parse(txtSoLuong.Text);
                    tpm.GiaNhap     = double.Parse(txtGia.Text);
                    tpm.DonVi       = txtdonvi.Text;
                    qlthucpham.CTNhapThucPhams.Add(tpm);
                    qlthucpham.SaveChanges();
                    MessageBox.Show("Thêm thành công!");
                }
            }
        }
Пример #4
0
        private void themPhuKien()
        {
            string tenphukien = cbTen.Text;

            using (quanlithucungEntities1 quanli = new quanlithucungEntities1()) {
                PHUKIEN pk = quanli.PHUKIENs.FirstOrDefault(p => p.Tenphukien.ToLower() == tenphukien.ToLower());
                if (pk == null)
                {
                    Console.WriteLine("aa");
                    quanli.insertCTPK(mapn, int.Parse(txtSoLuong.Text), double.Parse(txtGia.Text), tenphukien, cbLoai.SelectedValue.ToString(), null, txtdonvi.Text);

                    quanli.SaveChanges();
                    MessageBox.Show("Thêm thành công");
                }
                else
                {
                    pk.Soluong += int.Parse(txtSoLuong.Text);
                    CTNhapPhuKien pkm = new CTNhapPhuKien();
                    pkm.MaPN       = mapn;
                    pkm.MaPhuKien  = pk.Maphukien;
                    pkm.TenPhuKien = pk.Tenphukien;
                    pkm.MaLoai     = cbLoai.SelectedValue.ToString();
                    pkm.GiaNhap    = double.Parse(txtGia.Text);
                    pkm.Soluong    = int.Parse(txtSoLuong.Text);
                    pkm.Donvi      = txtdonvi.Text;
                    pkm.Anh        = pk.HinhAnh;
                    quanli.CTNhapPhuKiens.Add(pkm);
                    quanli.SaveChanges();
                    MessageBox.Show("Thêm thành công");
                }
            }
        }
Пример #5
0
 private void btnluu_Click(object sender, EventArgs e)
 {
     if (!kiemtraud())
     {
         return;
     }
     try
     {
         using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
         {
             UuDaiHD ud = quanli.UuDaiHDs.FirstOrDefault(p => p.MaUD == makm);
             ud.TenUD   = txttenud.Text;
             ud.NgayBD  = tgbdud.Value;
             ud.NgayKT  = tgktud.Value;
             ud.GiamGia = int.Parse(txtgiamgia.Text);
             quanli.SaveChanges();
             MessageBox.Show("Đã sửa");
             loaduudai();
             resetud();
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Không thể sửa, vui lòng kiểm tra lại");
         return;
     }
 }
Пример #6
0
        private void dgvChucvu_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            them.Text   = "Làm mới";
            luu.Enabled = true;


            txtmacv.Text              = dgvChucvu.CurrentRow.Cells[0].Value.ToString();
            txttencv.Text             = dgvChucvu.CurrentRow.Cells[1].Value.ToString();
            txtluong.Text             = dgvChucvu.CurrentRow.Cells[2].Value.ToString();
            ckbbanhang.Checked        = Convert.ToBoolean(dgvChucvu.CurrentRow.Cells[3].Value);
            ckbquanlynhanvien.Checked = Convert.ToBoolean(dgvChucvu.CurrentRow.Cells[4].Value);
            ckbthongke.Checked        = Convert.ToBoolean(dgvChucvu.CurrentRow.Cells[5].Value);
            cbkquanlykho.Checked      = Convert.ToBoolean(dgvChucvu.CurrentRow.Cells[6].Value);
            if (e.ColumnIndex == 7)
            {
                if (MessageBox.Show("bạn có muốn xóa phiếu nhập này không ?", "xóa", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
                    {
                        ChucVu cv = quanli.ChucVus.FirstOrDefault(p => p.MaCV == txtmacv.Text);
                        quanli.ChucVus.Remove(cv);
                        quanli.SaveChanges();
                        MessageBox.Show("Xóa thành công!");
                        FrmQuanly_Load(sender, e);
                    }
                }
            }
        }
Пример #7
0
 private void bunifuCustomDataGrid1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 6)
     {
         if (MessageBox.Show("bạn có muốn xóa phiếu nhập này không ?", "xóa", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
             {
                 string mapn = dgvPhieuNhap.CurrentRow.Cells[0].Value.ToString();
                 quanli.deletePN(mapn);
                 MessageBox.Show("đã xóa");
                 FrmPhieuNhap_Load(sender, e);
             }
         }
     }
     if (e.ColumnIndex == 5)
     {
         using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
         {
             string         mapn = dgvPhieuNhap.CurrentRow.Cells[0].Value.ToString();
             FrmCTPhieuNhap ct   = new FrmCTPhieuNhap();
             ct.mapn        = mapn;
             ct.FormClosed += thoat;
             ct.ShowDialog();
         }
     }
 }
Пример #8
0
 private void btnthem_Click(object sender, EventArgs e)
 {
     if (!kiemtraud())
     {
         return;
     }
     using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
     {
         UuDaiHD ud = quanli.UuDaiHDs.FirstOrDefault(p => p.TenUD == txttenud.Text.Trim());
         if (ud != null)
         {
             MessageBox.Show("Đã có ưu đãi" + txttenud.Text + "không thể thêm!");
             return;
         }
         try
         {
             int giamgia = int.Parse(txtgiamgia.Text);
             quanli.insertudhd(txttenud.Text, tgbdud.Value, tgktud.Value, giamgia, null);
             quanli.SaveChanges();
             MessageBox.Show("Đã thêm !!");
             loaduudai();
         }
         catch (Exception)
         {
             MessageBox.Show("Không thể thêm, vui lòng kiểm tra lại");
             return;
         }
     }
     resetud();
 }
Пример #9
0
 private void ThongTinHoaDonNhap_Load(object sender, EventArgs e)
 {
     using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
     {
         RPHoaDon  report = new RPHoaDon();
         DataTable table  = new DataTable();
         table.Columns.Add("mapn");
         table.Columns.Add("ngaylap");
         table.Columns.Add("nhanvien");
         table.Columns.Add("nhacc");
         table.Columns.Add("tensanpham");
         table.Columns.Add("soluong");
         table.Columns.Add("dongia");
         table.Columns.Add("thanhtien");
         table.Columns.Add("TongTien");
         List <reportPhieuNhap_Result> ds_hoadon = quanli.reportPhieuNhap("PN01").ToList();
         foreach (var item in ds_hoadon)
         {
             table.Rows.Add(item.mapn, item.ngaylap, item.nhanvien, item.nhacc, item.tensanpham, item.soluong, item.dongia, item.thanhtien, item.tongtien);
         }
         RPHoaDonNhap1.SetDataSource(table);
         crystalReportViewer1.ReportSource = RPHoaDonNhap1;
         crystalReportViewer1.Show();
     }
 }
Пример #10
0
 public void loaddulieu()
 {
     using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
     {
         dataGridView1.DataSource = quanli.CTNhapPhuKiens.ToList();
     }
 }
Пример #11
0
        private void btnluu_Click(object sender, EventArgs e)
        {
            if (!kiemtra())
            {
                return;
            }
            else
            {
                using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
                {
                    MD5           mh         = MD5.Create();
                    byte[]        inputBytes = System.Text.Encoding.ASCII.GetBytes(txtmkmoi.Text);
                    byte[]        hash       = mh.ComputeHash(inputBytes);
                    StringBuilder sb         = new StringBuilder();

                    for (int i = 0; i < hash.Length; i++)
                    {
                        sb.Append(hash[i].ToString("X2"));
                    }
                    string   pass = sb.ToString();
                    DangNhap lg   = quanli.DangNhaps.FirstOrDefault(p => p.UserName == user);
                    lg.PassWord = pass;
                    quanli.SaveChanges();
                    MessageBox.Show("Đổi thành công!");
                }
            }
        }
Пример #12
0
        private void loaddanhmuc()
        {
            panelDanhMuc.Controls.Clear();
            using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
            {
                List <LoaiThucPham> ds_loaitc = quanli.LoaiThucPhams.ToList();
                int i = 0;
                foreach (var item in ds_loaitc)
                {
                    BunifuThinButton2 bt = new BunifuThinButton2();
                    bt.Size            = new System.Drawing.Size(98, 45);
                    bt.TabIndex        = i;
                    bt.ActiveFillColor = System.Drawing.Color.DeepSkyBlue;
                    bt.ActiveLineColor = System.Drawing.Color.DeepSkyBlue;
                    bt.IdleForecolor   = Color.MidnightBlue;
                    bt.IdleFillColor   = Color.White;
                    bt.IdleLineColor   = System.Drawing.Color.LightSkyBlue;


                    bt.Name       = item.MaLoai;
                    bt.Click     += clickChonDanhMuc;
                    bt.ButtonText = item.TenLoai.Trim();
                    bt.TextAlign  = System.Drawing.ContentAlignment.MiddleCenter;
                    panelDanhMuc.Controls.Add(bt);
                    i++;
                }
            }

            //using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
            //{
            //    List<LoaiThuCung> ds_loaithucung = quanli.LoaiThuCungs.ToList();
            //}
        }
Пример #13
0
        private void btnDatLaiMK_Click(object sender, EventArgs e)
        {
            if (!kiemtra())
            {
                return;
            }
            using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
            {
                MD5           mh         = MD5.Create();
                byte[]        inputBytes = System.Text.Encoding.ASCII.GetBytes(txtMatKhauMoi.Text);
                byte[]        hash       = mh.ComputeHash(inputBytes);
                StringBuilder sb         = new StringBuilder();

                for (int i = 0; i < hash.Length; i++)
                {
                    sb.Append(hash[i].ToString("X2"));
                }
                string   pass = sb.ToString();
                DangNhap dn   = quanli.DangNhaps.FirstOrDefault(p => p.MaNV == manv);
                dn.PassWord = pass;
                quanli.SaveChanges();
                MessageBox.Show("Đặt lại mật khẩu thành công! Mật khẩu của bạn là: " + txtMatKhauMoi.Text);
                this.Close();
            }
        }
Пример #14
0
        void LoadDanhMuc()
        {
            panelDanhMuc.Controls.Clear();
            using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
            {
                List <LoaiPhuKien> ds_loaipk = quanli.LoaiPhuKiens.ToList();
                int i = 0;
                foreach (var item in ds_loaipk)
                {
                    BunifuThinButton2 bt = new BunifuThinButton2();
                    bt.Size            = new System.Drawing.Size(98, 45);
                    bt.TabIndex        = i;
                    bt.ActiveFillColor = System.Drawing.Color.DeepSkyBlue;
                    bt.ActiveLineColor = System.Drawing.Color.DeepSkyBlue;
                    bt.IdleFillColor   = Color.White;
                    bt.IdleForecolor   = Color.MidnightBlue;
                    bt.IdleLineColor   = System.Drawing.Color.White;
                    bt.Text            = item.TenLoai.ToUpper();
                    bt.Name            = item.MaLoai;
                    bt.Click          += clickChonDanhMuc;
                    bt.ButtonText      = item.TenLoai.Trim();
                    bt.TextAlign       = System.Drawing.ContentAlignment.MiddleCenter;
                    panelDanhMuc.Controls.Add(bt);
                    i++;
                }
            }

            using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
            {
                List <LoaiPhuKien> ds_phukien = quanli.LoaiPhuKiens.ToList();
            }
        }
Пример #15
0
 private void btnthanhtoan_Click(object sender, EventArgs e)
 {
     if (dgvDichvu.Rows.Count == 0)
     {
         MessageBox.Show("Chưa có hóa đơn để thanh toán");
         return;
     }
     try
     {
         using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
         {
             HoaDon hd = quanli.HoaDons.FirstOrDefault(p => p.MaHD == cbHoaDon.Text);
             hd.TrangThai = true;
             quanli.SaveChanges();
             MessageBox.Show("Thanh toán thành công!");
             FrmDichVu_Load(sender, e);
             cbchuathanhtoan.Text = null;
             btnthanhtoan.Enabled = false;
             btnthem.Enabled      = true;
             txttendichvu.Text    = "";
             txtdongia.Text       = "";
             return;
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Xin lỗi, không thể thanh toán");
         return;
     }
 }
Пример #16
0
        private void btnXem_Click(object sender, EventArgs e)
        {
            using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
            {
                DataTable table = new DataTable();
                table.Columns.Add("mapn");
                table.Columns.Add("ngaylap");
                table.Columns.Add("nhanvien");
                table.Columns.Add("nhacc");
                table.Columns.Add("tensanpham");
                table.Columns.Add("soluong");
                table.Columns.Add("dongia");
                table.Columns.Add("thanhtien");
                table.Columns.Add("tongtien");


                List <reportPhieuNhap_Result> ds_hoadon = quanli.reportPhieuNhap(comboBox1.SelectedValue.ToString()).ToList();
                foreach (var item in ds_hoadon)
                {
                    table.Rows.Add(item.mapn, item.ngaylap, item.nhanvien, item.nhacc, item.tensanpham, item.soluong, item.dongia, item.thanhtien, item.tongtien);
                }
                RPHoaDonNhap2.SetDataSource(table);
                crystalReportViewer1.ReportSource = RPHoaDonNhap2;
                crystalReportViewer1.Show();
            }
        }
Пример #17
0
 private void btnthanhtoan_Click(object sender, EventArgs e)
 {
     if (dgvThucPham.Rows.Count == 0)
     {
         MessageBox.Show("Chưa có hóa đơn để thanh toán");
         return;
     }
     try
     {
         using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
         {
             HoaDon hd = quanli.HoaDons.FirstOrDefault(p => p.MaHD == txtmahoadon.Text);
             hd.TrangThai = true;
             quanli.SaveChanges();
             MessageBox.Show("Thanh toán thành công!");
             Formbanhthuong_Load(sender, e);
             cbchuathanhtoan.Text = "";
             txttenthucpham.Text  = "";
             txtdongia.Text       = "";
             btnthanhtoan.Enabled = false;
             btnthem.Enabled      = true;
             return;
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Không thể thanh toán, vui lòng kiểm tra lại!");
         return;
     }
 }
Пример #18
0
        private void btnluu_Click(object sender, EventArgs e)
        {
            if (dgvDichvu.Rows.Count == 0)
            {
                MessageBox.Show("Chưa có thông tin để lưu");
                return;
            }
            using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
            {
                HoaDon hd = quanli.HoaDons.FirstOrDefault(p => p.MaHD == cbHoaDon.Text);
                if (hd == null)
                {
                    hd             = new HoaDon();
                    hd.MaHD        = cbHoaDon.Text;
                    hd.UserName    = null;
                    hd.ThoiGianLap = DateTime.Now.Date;
                    hd.TrangThai   = false;
                    quanli.HoaDons.Add(hd);
                    quanli.SaveChanges();
                }

                else
                {
                    hd.TrangThai = false;
                }
                if (txtuudai.Text != "0")
                {
                    CTUuDai ct = quanli.CTUuDais.FirstOrDefault(p => p.MaHD == cbHoaDon.Text);
                    if (ct != null)
                    {
                        MessageBox.Show("Hóa đơn này đã có ưu đãi");
                        return;
                    }
                    CTUuDai ud = new CTUuDai();
                    ud.MaHD = cbHoaDon.Text;
                    ud.MaUD = maud;
                    Console.WriteLine(maud);
                    quanli.CTUuDais.Add(ud);
                    quanli.SaveChanges();
                }
                foreach (DataGridViewRow rows in dgvDichvu.Rows)
                {
                    string madichvu = rows.Cells["madichvu"].Value.ToString();

                    int      sl = int.Parse(rows.Cells["soluong"].Value.ToString());
                    CTDichVu ct = new CTDichVu();
                    ct.MaHD = cbHoaDon.Text;
                    ct.MaDV = madichvu;
                    ct.SoDV = sl;
                    quanli.CTDichVus.Add(ct);
                    quanli.SaveChanges();
                }
                MessageBox.Show("Lưu thành công!");
                loadhdchuathanhtoan();
                btnthem.Enabled      = false;
                btnluu.Enabled       = false;
                btnthanhtoan.Enabled = true;
                return;
            }
        }
Пример #19
0
 public void loaddulieu()
 {
     using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
     {
         dgvNhapThuCung.DataSource = quanli.CTNhapThuCungs.ToList();
     }
 }
Пример #20
0
 private void Mèotaicụp_Load(object sender, EventArgs e)
 {
     using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
     {
         // label1.Text = quanli.ThuCungs.Where(p => p.MaThuCung == );
     }
 }
Пример #21
0
 public void loadnhanvien()
 {
     using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
     {
         List <NhanVien> ds_nhanvien = quanli.NhanViens.ToList();
         DataTable       table       = new DataTable();
         table.Columns.Add("MaNV");
         table.Columns.Add("tennv");
         table.Columns.Add("diachi");
         table.Columns.Add("cmnd");
         table.Columns.Add("sdt");
         table.Columns.Add("chucvu");
         table.Columns.Add("gmail");
         foreach (NhanVien item in ds_nhanvien)
         {
             string chucvu = "";
             if (item.MaCV == null)
             {
                 chucvu = "rỗng";
             }
             else
             {
                 chucvu = quanli.ChucVus.FirstOrDefault(p => p.MaCV == item.MaCV).TenCV;
             }
             table.Rows.Add(item.MaNV, item.TenNV, item.CMND, item.DiaChi, item.sodienthoai, chucvu, item.Gmail);
         }
         dgvnhanvien.AutoGenerateColumns = false;
         dgvnhanvien.DataSource          = table;
     }
 }
Пример #22
0
        public void phanquyen()
        {
            using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
            {
                string manv = quanli.DangNhaps.FirstOrDefault(p => p.UserName == user.Trim()).MaNV;
                string macv = quanli.NhanViens.FirstOrDefault(p => p.MaNV == manv).MaCV;
                ChucVu cv   = quanli.ChucVus.FirstOrDefault(p => p.MaCV == macv);
                Console.WriteLine(manv);
                Console.WriteLine(macv);
                Console.WriteLine(cv.BanHang);
                if (cv.BanHang == false)
                {
                    banhang = false;
                }
                if (cv.Thongke == false)
                {
                    thongke = false;
                }
                if (cv.Quanlykho == false)
                {
                    quanlykho = false;
                }
                if (cv.Quanlynhanvien == false)
                {
                    quanlinhanvien = false;
                }
                if (cv.BanHang == true && cv.Quanlynhanvien == true && cv.Thongke == true && cv.Quanlykho == true)
                {
                    admin = true;
                }
                //else
                //{
                //    panelMain.Controls.Clear();
                //    panelMain.Controls.Add(new FrmThuCUng());
                //    dem++;dem1++;
                //    if(dem == 0)
                //    {
                //        panelMain.Controls.Clear();
                //        panelMain.Controls.Add(new Frmthucpham());
                //    }
                //    if (dem1 == 0)
                //    {
                //        panelMain.Controls.Clear();
                //        panelMain.Controls.Add(new Frmphukien());
                //    }
                //}
                //if (cv.Thongke == false)
                //{
                //    btnThongKe.Click += new EventHandler(ttnhanvien);
                //}
                //else
                //{
                //    if (dem == 0)
                //    {

                //    }
                //}
            }
        }
Пример #23
0
 private void loadhoadon()
 {
     using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
     {
         cbHoaDon.DataSource    = quanli.HoaDons.ToList();
         cbHoaDon.DisplayMember = "MaHD";
     }
 }
Пример #24
0
 private void kh1_Load(object sender, EventArgs e)
 {
     dataGridView1.AutoGenerateColumns = false;
     using (quanlithucungEntities1 thucung = new quanlithucungEntities1())
     {
         dataGridView1.DataSource = thucung.KhachHangs.ToList();
     }
 }
Пример #25
0
 private void loadLuongThang()
 {
     using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
     {
         dgvLuong.AutoGenerateColumns = false;
         dgvLuong.DataSource          = quanli.LuongTungThangs.ToList();
     }
 }
Пример #26
0
 public void loadtp()
 {
     dgvThuongPhat.AutoGenerateColumns = false;
     using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
     {
         dgvThuongPhat.DataSource = quanli.ThuongPhats.ToList();
     }
 }
Пример #27
0
 private void loadhd()
 {
     dgvHoaDon.AutoGenerateColumns = false;
     using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
     {
         dgvHoaDon.DataSource = quanli.HoaDons.ToList();
     }
 }
Пример #28
0
 private void Formnhacungcap_Load(object sender, EventArgs e)
 {
     dgvNhacc.AutoGenerateColumns = false;
     using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
     {
         Console.WriteLine(quanli.NhaCungCaps.ToList().Count);
         dgvNhacc.DataSource = quanli.NhaCungCaps.ToList();
     }
 }
Пример #29
0
 private void guimail_Load(object sender, EventArgs e)
 {
     using (quanlithucungEntities1 thucung = new quanlithucungEntities1())
     {
         comboBox1.DisplayMember = "TenUD";
         comboBox1.ValueMember   = "MaUD";
         comboBox1.DataSource    = thucung.selectalluudai();
     }
 }
Пример #30
0
 private void loadLoaiThuCung()
 {
     using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
     {
         cbLoaiThuCung.DataSource    = quanli.LoaiThuCungs.ToList();
         cbLoaiThuCung.DisplayMember = "TenLoai";
         cbLoaiThuCung.ValueMember   = "MaLoai";
     }
 }