⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scoredataset.h

📁 Visual C++.net数据库开发经典案例
💻 H
📖 第 1 页 / 共 2 页
字号:
    
    inline ScoreDataSet::MarkTableDataTable::MarkTableDataTable(System::Data::DataTable *  table) : 
            DataTable(table->TableName) {
        if ((table->CaseSensitive != table->DataSet->CaseSensitive)) {
            this->CaseSensitive = table->CaseSensitive;
        }
        if ((table->Locale->ToString() != table->DataSet->Locale->ToString())) {
            this->Locale = table->Locale;
        }
        if ((table->Namespace != table->DataSet->Namespace)) {
            this->Namespace = table->Namespace;
        }
        this->Prefix = table->Prefix;
        this->MinimumCapacity = table->MinimumCapacity;
        this->DisplayExpression = table->DisplayExpression;
    }
    
    inline System::Int32 ScoreDataSet::MarkTableDataTable::get_Count() {
        return this->Rows->Count;
    }
    
    inline System::Data::DataColumn *  ScoreDataSet::MarkTableDataTable::get_StudentIDColumn() {
        return this->columnStudentID;
    }
    
    inline System::Data::DataColumn *  ScoreDataSet::MarkTableDataTable::get_StudentNameColumn() {
        return this->columnStudentName;
    }
    
    inline System::Data::DataColumn *  ScoreDataSet::MarkTableDataTable::get_CourseNameColumn() {
        return this->columnCourseName;
    }
    
    inline System::Data::DataColumn *  ScoreDataSet::MarkTableDataTable::get_DepartmentColumn() {
        return this->columnDepartment;
    }
    
    inline System::Data::DataColumn *  ScoreDataSet::MarkTableDataTable::get_TeacherColumn() {
        return this->columnTeacher;
    }
    
    inline System::Data::DataColumn *  ScoreDataSet::MarkTableDataTable::get_MarkColumn() {
        return this->columnMark;
    }
    
    inline System::Data::DataColumn *  ScoreDataSet::MarkTableDataTable::get_Expr1Column() {
        return this->columnExpr1;
    }
    
    inline System::Data::DataColumn *  ScoreDataSet::MarkTableDataTable::get_NumberColumn() {
        return this->columnNumber;
    }
    
    inline System::Data::DataColumn *  ScoreDataSet::MarkTableDataTable::get_CourseIDColumn() {
        return this->columnCourseID;
    }
    
    inline My::ScoreDataSet::MarkTableRow *  ScoreDataSet::MarkTableDataTable::get_Item(System::Int32 index) {
        return (__try_cast<My::ScoreDataSet::MarkTableRow *  >(this->Rows->Item[index]));
    }
    
    
    
    
    
    inline System::Void ScoreDataSet::MarkTableDataTable::AddMarkTableRow(My::ScoreDataSet::MarkTableRow *  row) {
        this->Rows->Add(row);
    };
    
    inline My::ScoreDataSet::MarkTableRow *  ScoreDataSet::MarkTableDataTable::AddMarkTableRow(System::String *  StudentID, System::String *  StudentName, System::String *  CourseName, System::String *  Department, System::String *  Teacher, System::Int32 Mark, System::String *  Expr1, System::Int32 CourseID) {
        My::ScoreDataSet::MarkTableRow *  rowMarkTableRow = (__try_cast<My::ScoreDataSet::MarkTableRow *  >(this->NewRow()));
        System::Object* __mcTemp__1[] = new System::Object*[9];
                __mcTemp__1[0] = StudentID;
                __mcTemp__1[1] = StudentName;
                __mcTemp__1[2] = CourseName;
                __mcTemp__1[3] = Department;
                __mcTemp__1[4] = Teacher;
                __mcTemp__1[5] = __box(Mark);
                __mcTemp__1[6] = Expr1;
                __mcTemp__1[7] = 0;
                __mcTemp__1[8] = __box(CourseID);
        rowMarkTableRow->ItemArray = __mcTemp__1;
        this->Rows->Add(rowMarkTableRow);
        return rowMarkTableRow;
    };
    
    inline My::ScoreDataSet::MarkTableRow *  ScoreDataSet::MarkTableDataTable::FindByExpr1NumberCourseID(System::String *  Expr1, System::Int32 Number, System::Int32 CourseID) {
        System::Object* __mcTemp__1[] = new System::Object*[3];
                __mcTemp__1[0] = Expr1;
                __mcTemp__1[1] = __box(Number);
                __mcTemp__1[2] = __box(CourseID);
        return (__try_cast<My::ScoreDataSet::MarkTableRow *  >(this->Rows->Find(__mcTemp__1)));
    };
    
    inline System::Collections::IEnumerator *  ScoreDataSet::MarkTableDataTable::GetEnumerator() {
        return this->Rows->GetEnumerator();
    };
    
    inline System::Data::DataTable *  ScoreDataSet::MarkTableDataTable::Clone() {
        My::ScoreDataSet::MarkTableDataTable *  cln = (__try_cast<My::ScoreDataSet::MarkTableDataTable *  >(__super::Clone()));
        cln->InitVars();
        return cln;
    };
    
    inline System::Data::DataTable *  ScoreDataSet::MarkTableDataTable::CreateInstance() {
        return new My::ScoreDataSet::MarkTableDataTable();
    };
    
    inline System::Void ScoreDataSet::MarkTableDataTable::InitVars() {
        this->columnStudentID = this->Columns->Item[S"StudentID"];
        this->columnStudentName = this->Columns->Item[S"StudentName"];
        this->columnCourseName = this->Columns->Item[S"CourseName"];
        this->columnDepartment = this->Columns->Item[S"Department"];
        this->columnTeacher = this->Columns->Item[S"Teacher"];
        this->columnMark = this->Columns->Item[S"Mark"];
        this->columnExpr1 = this->Columns->Item[S"Expr1"];
        this->columnNumber = this->Columns->Item[S"Number"];
        this->columnCourseID = this->Columns->Item[S"CourseID"];
    };
    
    inline System::Void ScoreDataSet::MarkTableDataTable::InitClass() {
        this->columnStudentID = new System::Data::DataColumn(S"StudentID", __typeof(System::String), 0, System::Data::MappingType::Element);
        this->Columns->Add(this->columnStudentID);
        this->columnStudentName = new System::Data::DataColumn(S"StudentName", __typeof(System::String), 0, System::Data::MappingType::Element);
        this->Columns->Add(this->columnStudentName);
        this->columnCourseName = new System::Data::DataColumn(S"CourseName", __typeof(System::String), 0, System::Data::MappingType::Element);
        this->Columns->Add(this->columnCourseName);
        this->columnDepartment = new System::Data::DataColumn(S"Department", __typeof(System::String), 0, System::Data::MappingType::Element);
        this->Columns->Add(this->columnDepartment);
        this->columnTeacher = new System::Data::DataColumn(S"Teacher", __typeof(System::String), 0, System::Data::MappingType::Element);
        this->Columns->Add(this->columnTeacher);
        this->columnMark = new System::Data::DataColumn(S"Mark", __typeof(System::Int32), 0, System::Data::MappingType::Element);
        this->Columns->Add(this->columnMark);
        this->columnExpr1 = new System::Data::DataColumn(S"Expr1", __typeof(System::String), 0, System::Data::MappingType::Element);
        this->Columns->Add(this->columnExpr1);
        this->columnNumber = new System::Data::DataColumn(S"Number", __typeof(System::Int32), 0, System::Data::MappingType::Element);
        this->Columns->Add(this->columnNumber);
        this->columnCourseID = new System::Data::DataColumn(S"CourseID", __typeof(System::Int32), 0, System::Data::MappingType::Element);
        this->Columns->Add(this->columnCourseID);
        System::Data::DataColumn* __mcTemp__1[] = new System::Data::DataColumn*[3];
                        __mcTemp__1[0] = this->columnExpr1;
                        __mcTemp__1[1] = this->columnNumber;
                        __mcTemp__1[2] = this->columnCourseID;
        this->Constraints->Add(new System::Data::UniqueConstraint(S"Constraint1", __mcTemp__1, true));
        this->columnStudentID->AllowDBNull = false;
        this->columnCourseName->AllowDBNull = false;
        this->columnMark->AllowDBNull = false;
        this->columnExpr1->AllowDBNull = false;
        this->columnNumber->AutoIncrement = true;
        this->columnNumber->AllowDBNull = false;
        this->columnNumber->ReadOnly = true;
        this->columnCourseID->AllowDBNull = false;
    };
    
    inline My::ScoreDataSet::MarkTableRow *  ScoreDataSet::MarkTableDataTable::NewMarkTableRow() {
        return (__try_cast<My::ScoreDataSet::MarkTableRow *  >(this->NewRow()));
    };
    
    inline System::Data::DataRow *  ScoreDataSet::MarkTableDataTable::NewRowFromBuilder(System::Data::DataRowBuilder *  builder) {
        return new My::ScoreDataSet::MarkTableRow(builder);
    };
    
    inline System::Type *  ScoreDataSet::MarkTableDataTable::GetRowType() {
        return __typeof(My::ScoreDataSet::MarkTableRow);
    };
    
    inline System::Void ScoreDataSet::MarkTableDataTable::OnRowChanged(System::Data::DataRowChangeEventArgs *  e) {
        __super::OnRowChanged(e);
        if ((this->MarkTableRowChanged != 0)) {
            this->MarkTableRowChanged(this, new My::ScoreDataSet::MarkTableRowChangeEvent((__try_cast<My::ScoreDataSet::MarkTableRow *  >(e->Row)), e->Action));
        }
    };
    
    inline System::Void ScoreDataSet::MarkTableDataTable::OnRowChanging(System::Data::DataRowChangeEventArgs *  e) {
        __super::OnRowChanging(e);
        if ((this->MarkTableRowChanging != 0)) {
            this->MarkTableRowChanging(this, new My::ScoreDataSet::MarkTableRowChangeEvent((__try_cast<My::ScoreDataSet::MarkTableRow *  >(e->Row)), e->Action));
        }
    };
    
    inline System::Void ScoreDataSet::MarkTableDataTable::OnRowDeleted(System::Data::DataRowChangeEventArgs *  e) {
        __super::OnRowDeleted(e);
        if ((this->MarkTableRowDeleted != 0)) {
            this->MarkTableRowDeleted(this, new My::ScoreDataSet::MarkTableRowChangeEvent((__try_cast<My::ScoreDataSet::MarkTableRow *  >(e->Row)), e->Action));
        }
    };
    
    inline System::Void ScoreDataSet::MarkTableDataTable::OnRowDeleting(System::Data::DataRowChangeEventArgs *  e) {
        __super::OnRowDeleting(e);
        if ((this->MarkTableRowDeleting != 0)) {
            this->MarkTableRowDeleting(this, new My::ScoreDataSet::MarkTableRowChangeEvent((__try_cast<My::ScoreDataSet::MarkTableRow *  >(e->Row)), e->Action));
        }
    };
    
    inline System::Void ScoreDataSet::MarkTableDataTable::RemoveMarkTableRow(My::ScoreDataSet::MarkTableRow *  row) {
        this->Rows->Remove(row);
    };
    
    
    
    inline ScoreDataSet::MarkTableRow::MarkTableRow(System::Data::DataRowBuilder *  rb) : 
            DataRow(rb) {
        this->tableMarkTable = (__try_cast<My::ScoreDataSet::MarkTableDataTable *  >(this->Table));
    }
    
    inline System::String *  ScoreDataSet::MarkTableRow::get_StudentID() {
        return (__try_cast<System::String *  >(this->Item[this->tableMarkTable->StudentIDColumn]));
    }
    inline void ScoreDataSet::MarkTableRow::set_StudentID(System::String *  value) {
        this->Item[this->tableMarkTable->StudentIDColumn] = value;
    }
    
    inline System::String *  ScoreDataSet::MarkTableRow::get_StudentName() {
        try {
            return (__try_cast<System::String *  >(this->Item[this->tableMarkTable->StudentNameColumn]));
        }
        catch (System::InvalidCastException * e) {
            throw new System::Data::StrongTypingException(S"无法获取值,因为它是 DBNull。", e);
        }
    }
    inline void ScoreDataSet::MarkTableRow::set_StudentName(System::String *  value) {
        this->Item[this->tableMarkTable->StudentNameColumn] = value;
    }
    
    inline System::String *  ScoreDataSet::MarkTableRow::get_CourseName() {
        return (__try_cast<System::String *  >(this->Item[this->tableMarkTable->CourseNameColumn]));
    }
    inline void ScoreDataSet::MarkTableRow::set_CourseName(System::String *  value) {
        this->Item[this->tableMarkTable->CourseNameColumn] = value;
    }
    
    inline System::String *  ScoreDataSet::MarkTableRow::get_Department() {
        try {
            return (__try_cast<System::String *  >(this->Item[this->tableMarkTable->DepartmentColumn]));
        }
        catch (System::InvalidCastException * e) {
            throw new System::Data::StrongTypingException(S"无法获取值,因为它是 DBNull。", e);
        }
    }
    inline void ScoreDataSet::MarkTableRow::set_Department(System::String *  value) {
        this->Item[this->tableMarkTable->DepartmentColumn] = value;
    }
    
    inline System::String *  ScoreDataSet::MarkTableRow::get_Teacher() {
        try {
            return (__try_cast<System::String *  >(this->Item[this->tableMarkTable->TeacherColumn]));
        }
        catch (System::InvalidCastException * e) {
            throw new System::Data::StrongTypingException(S"无法获取值,因为它是 DBNull。", e);
        }
    }
    inline void ScoreDataSet::MarkTableRow::set_Teacher(System::String *  value) {
        this->Item[this->tableMarkTable->TeacherColumn] = value;
    }
    
    inline System::Int32 ScoreDataSet::MarkTableRow::get_Mark() {
        return (*__try_cast<__box System::Int32 *  >(this->Item[this->tableMarkTable->MarkColumn]));
    }
    inline void ScoreDataSet::MarkTableRow::set_Mark(System::Int32 value) {
        this->Item[this->tableMarkTable->MarkColumn] = __box(value);
    }
    
    inline System::String *  ScoreDataSet::MarkTableRow::get_Expr1() {
        return (__try_cast<System::String *  >(this->Item[this->tableMarkTable->Expr1Column]));
    }
    inline void ScoreDataSet::MarkTableRow::set_Expr1(System::String *  value) {
        this->Item[this->tableMarkTable->Expr1Column] = value;
    }
    
    inline System::Int32 ScoreDataSet::MarkTableRow::get_Number() {
        return (*__try_cast<__box System::Int32 *  >(this->Item[this->tableMarkTable->NumberColumn]));
    }
    inline void ScoreDataSet::MarkTableRow::set_Number(System::Int32 value) {
        this->Item[this->tableMarkTable->NumberColumn] = __box(value);
    }
    
    inline System::Int32 ScoreDataSet::MarkTableRow::get_CourseID() {
        return (*__try_cast<__box System::Int32 *  >(this->Item[this->tableMarkTable->CourseIDColumn]));
    }
    inline void ScoreDataSet::MarkTableRow::set_CourseID(System::Int32 value) {
        this->Item[this->tableMarkTable->CourseIDColumn] = __box(value);
    }
    
    inline System::Boolean ScoreDataSet::MarkTableRow::IsStudentNameNull() {
        return this->IsNull(this->tableMarkTable->StudentNameColumn);
    };
    
    inline System::Void ScoreDataSet::MarkTableRow::SetStudentNameNull() {
        this->Item[this->tableMarkTable->StudentNameColumn] = System::Convert::DBNull;
    };
    
    inline System::Boolean ScoreDataSet::MarkTableRow::IsDepartmentNull() {
        return this->IsNull(this->tableMarkTable->DepartmentColumn);
    };
    
    inline System::Void ScoreDataSet::MarkTableRow::SetDepartmentNull() {
        this->Item[this->tableMarkTable->DepartmentColumn] = System::Convert::DBNull;
    };
    
    inline System::Boolean ScoreDataSet::MarkTableRow::IsTeacherNull() {
        return this->IsNull(this->tableMarkTable->TeacherColumn);
    };
    
    inline System::Void ScoreDataSet::MarkTableRow::SetTeacherNull() {
        this->Item[this->tableMarkTable->TeacherColumn] = System::Convert::DBNull;
    };
    
    
    
    
    inline ScoreDataSet::MarkTableRowChangeEvent::MarkTableRowChangeEvent(My::ScoreDataSet::MarkTableRow *  row, System::Data::DataRowAction action) {
        this->eventRow = row;
        this->eventAction = action;
    }
    
    inline My::ScoreDataSet::MarkTableRow *  ScoreDataSet::MarkTableRowChangeEvent::get_Row() {
        return this->eventRow;
    }
    
    inline System::Data::DataRowAction ScoreDataSet::MarkTableRowChangeEvent::get_Action() {
        return this->eventAction;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -