Ejemplo n.º 1
0
        public bool addDonHang(string ten, int sdt, string diachi, int soluong, float tongtien)
        {
            DonHang a = new DonHang();

            a.TenKH    = ten;
            a.SDT      = sdt;
            a.DiaChi   = diachi;
            a.SoLuong  = soluong;
            a.TongTien = tongtien;
            justshop.DonHangs.Add(a);
            justshop.SaveChanges();
            return(true);
        }
Ejemplo n.º 2
0
        public int getmadonhang()
        {
            DonHang a = (from c in justshop.DonHangs orderby c.MaDonHang descending select c).Take(1).SingleOrDefault();

            return(a.MaDonHang);
        }
Ejemplo n.º 3
0
        public string getTenkH(int id)
        {
            DonHang a = (from c in justshop.DonHangs where c.MaDonHang == id select c).SingleOrDefault();

            return(a.TenKH);
        }