Exemplo n.º 1
0
        public static void Them(DonDatHang dh, List <ChiTietDH> ctdh, string username)
        {
            var db = new SmartShopConnectionDB();

            db.Insert("DonDatHang", "MaDH", dh);
            var madh = db.SingleOrDefault <DonDatHang>("SELECT TOP 1 * FROM DonDatHang WHERE Username=@0 ORDER BY MaDH DESC", username);

            foreach (var item in ctdh)
            {
                item.MaDH = madh.MaDH;
                db.Insert("ChiTietDH", "MaDH", item);
            }
        }
Exemplo n.º 2
0
        public static void PhanQuyen(string us)
        {
            var            db   = new SmartShopConnectionDB();
            var            user = db.SingleOrDefault <viewUser>("SELECT * FROM viewUser where UserName=@0", us);
            AspNetUserRole pq   = new AspNetUserRole();

            pq.RoleId = "12629e90-6c15-424b-abaa-164250682d15";
            pq.UserId = user.UserId;
            db.Insert("AspNetUserRoles", pq);
        }
Exemplo n.º 3
0
        public static void Them(Loai l)
        {
            var db = new SmartShopConnectionDB();

            db.Insert("Loai", "MaLoai", l);
        }
Exemplo n.º 4
0
        public static void Them(Comment cmt)
        {
            var db = new SmartShopConnectionDB();

            db.Insert(cmt);
        }
Exemplo n.º 5
0
        public static void Them(Product sp)
        {
            var db = new SmartShopConnectionDB();

            db.Insert("Product", "MaSP", sp);
        }
Exemplo n.º 6
0
        public static void Them(Account acc)
        {
            var db = new SmartShopConnectionDB();

            db.Insert("Accounts", "UserName", acc);
        }
Exemplo n.º 7
0
        public static void Them(ChungLoai cl)
        {
            var db = new SmartShopConnectionDB();

            db.Insert(cl);
        }
Exemplo n.º 8
0
        public static void ThemCTDH(ChiTietDH ctdh)
        {
            var db = new SmartShopConnectionDB();

            db.Insert("ChiTietDH", "MaDH", ctdh);
        }