Model Class: D_Department_Course.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using SnapObjects.Data;
using DWNet.Data;
using Newtonsoft.Json;
namespace Appeon.ApiDoc.Models
{
[DataWindow("d_department_course", DwStyle.Grid)]
[Table("Course", Schema = "dbo")]
[FromTable("Department", Schema = "dbo")]
[FromTable("StudentGrade", Schema = "dbo")]
#region DwSelectAttribute
[DwSelect("select Course.CourseID, Course.Title, Course.DepartmentID,Department.Name, "
+ "StudentGrade.StudentID, StudentGrade.Grade "
+ "from Course, StudentGrade, Department where Course.CourseID = StudentGrade.CourseID "
+ "and Course.DepartmentID = Department.DepartmentID")]
#endregion
[DwSort("course_departmentid A course_courseid A ")]
[DwGroupBy(1, "course_departmentid")]
[DwGroupBy(2, "course_courseid")]
public class D_Department_Course
{
[DwColumn("CourseID")]
public int Course_Courseid { get; set; }
[DwColumn("Title")]
public string Course_Title { get; set; }
[DwColumn("DepartmentID")]
public int Course_Departmentid { get; set; }
[DwColumn("Name")]
public string Department_Name { get; set; }
[DwColumn("StudentID")]
public int Studentgrade_Studentid { get; set; }
[DwColumn("Grade")]
public decimal? Studentgrade_Grade { get; set; }
}
}