Beispiel #1
0
        public Cauthu[] GetPlayerr(string name)
        {
            var db     = new QLCTEntities1();
            var player = db.Cauthus.Where(item => item.TenCauThu.Equals(name)).ToArray();

            return(player);
        }
Beispiel #2
0
        public Cauthu GetPlayer(int id)
        {
            var db     = new QLCTEntities1();
            var player = db.Cauthus.Find(id);

            return(player);
        }
Beispiel #3
0
        public List <Cauthu> Getplayers()
        {
            var           db      = new QLCTEntities1();
            List <Cauthu> players = db.Cauthus.ToList();

            return(players);
        }
Beispiel #4
0
        public void DeletePlayer(int id)
        {
            var db     = new QLCTEntities1();
            var player = db.Cauthus.Find(id);

            db.Cauthus.Remove(player);
            db.SaveChanges();
        }
Beispiel #5
0
        public void EditPlayer(int id, string TenCauThu, string Gioitinh, DateTime NgaySinh, string Nickname, string Quequan, string ChieuCao, string Vitri, string Soao, string clb)
        {
            var db            = new QLCTEntities1();
            var currentPlayer = db.Cauthus.Find(id);

            currentPlayer.TenCauThu = TenCauThu;
            currentPlayer.Gioi_Tinh = Gioitinh;
            currentPlayer.NgaySinh  = NgaySinh;
            currentPlayer.Nickname  = Nickname;
            currentPlayer.Quequan   = Quequan;
            currentPlayer.Chieucao  = ChieuCao;
            currentPlayer.Vitri     = Vitri;
            currentPlayer.Soao      = Soao;
            currentPlayer.clb       = clb;

            db.Entry(currentPlayer).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
        }
Beispiel #6
0
        public void AddPlayer(string TenCauThu, string Gioitinh, DateTime NgaySinh, string Nickname, string Quequan, string ChieuCao, string Vitri, string Soao, string clb)
        {
            var db     = new QLCTEntities1();
            var player = new Cauthu();

            player.TenCauThu = TenCauThu;
            player.Gioi_Tinh = Gioitinh;
            player.NgaySinh  = NgaySinh;
            player.Nickname  = Nickname;
            player.Quequan   = Quequan;
            player.Chieucao  = ChieuCao;
            player.Vitri     = Vitri;
            player.Soao      = Soao;
            player.clb       = clb;

            db.Cauthus.Add(player);
            db.SaveChanges();
        }
Beispiel #7
0
        public Login[] Getlogin()
        {
            var db = new QLCTEntities1();

            return(db.Logins.ToArray());
        }