示例#1
0
        public static void ChinhSuaTrongTai(V_TRONGTAI a_TrongTai)
        {
            TRONGTAI tt = new TRONGTAI();

            tt.MATT            = a_TrongTai.m_MaTrongTai;
            tt.HOTEN           = a_TrongTai.m_HoTen;
            tt.NGAYSINH        = a_TrongTai.m_NgaySinh;
            tt.DIACHI          = a_TrongTai.m_DiaChi;
            tt.QUOCTICH        = a_TrongTai.m_QuocTich;
            tt.SONAMKINHNGHIEM = (byte)a_TrongTai.m_SoNamKinhNghiem;
            tt.AVATAR          = a_TrongTai.m_AVT;
            tt.LOAITRONGTAI    = a_TrongTai.m_LoaiTrongTai;
            Database.DB_UPDATE.ChinhSuaTrongTai(tt);
        }
示例#2
0
        // Thêm trọng tài (hàm này sẽ được gói bên phía Views, truyền vào các tham số ở màn hình đó)
        public static bool ThemTrongTai(V_TRONGTAI a_TrongTai)
        {
            // Sau khi kiểm tra ổn thỏa trọng tài hợp lệ thì nhét vào db.
            TRONGTAI newTrongTai = new TRONGTAI
            {
                MATT            = a_TrongTai.m_MaTrongTai,
                HOTEN           = a_TrongTai.m_HoTen,
                NGAYSINH        = a_TrongTai.m_NgaySinh,
                DIACHI          = a_TrongTai.m_DiaChi,
                QUOCTICH        = a_TrongTai.m_QuocTich,
                SONAMKINHNGHIEM = (byte)a_TrongTai.m_SoNamKinhNghiem,
                LOAITRONGTAI    = a_TrongTai.m_LoaiTrongTai,
                AVATAR          = a_TrongTai.m_AVT,
            };

            // Kiểm tra và thêm vào db
            if (DB_QUERY.TimTrongTai(a_TrongTai.m_MaTrongTai) == false)
            {
                Database.DB_INSERTING.ThemTrongTai(newTrongTai);
                return(true);
            }
            return(false);
        }
示例#3
0
        public static List <V_TRONGTAI> TraCuuTT(string tenTrongTai)
        {
            List <V_TRONGTAI> v_TT     = new List <V_TRONGTAI>();
            List <TRONGTAI>   trongtai = new List <TRONGTAI>();

            trongtai = Database.DB_QUERY.TraCuuTT(tenTrongTai);


            foreach (TRONGTAI t in trongtai)
            {
                V_TRONGTAI temp = new V_TRONGTAI();
                temp.m_MaTrongTai      = t.MATT;
                temp.m_HoTen           = t.HOTEN;
                temp.m_NgaySinh        = (DateTime)t.NGAYSINH;
                temp.m_DiaChi          = t.DIACHI;
                temp.m_QuocTich        = t.QUOCTICH;
                temp.m_SoNamKinhNghiem = (byte)t.SONAMKINHNGHIEM;
                temp.m_AVT             = t.AVATAR;
                temp.m_LoaiTrongTai    = (bool)t.LOAITRONGTAI;
                v_TT.Add(temp);
            }

            return(v_TT);
        }