├── SchoolManagementApi
├── appsettings.Development.json
├── Model
│ ├── UpdateFeeStatusModel.cs
│ ├── Subject.cs
│ ├── AssignmentSubmissionViewModel.cs
│ ├── Users.cs
│ ├── Event.cs
│ ├── Timetable.cs
│ ├── AssignmentSubmission.cs
│ ├── StudentRequest.cs
│ ├── Assignments.cs
│ ├── AssignmentViewModel.cs
│ ├── AddLibrarian.cs
│ ├── Attendance.cs
│ ├── AddStudent.cs
│ ├── AddTeacher.cs
│ └── TeacherLeaveRequest.cs
├── WeatherForecast.cs
├── appsettings.json
├── Migrations
│ ├── 20240912103618_te.cs
│ ├── 20240912104745_tes.cs
│ ├── 20240913113556_subject.cs
│ ├── 20240915090050_freesstat.cs
│ ├── 20240915072817_frees.cs
│ ├── 20240914112150_times.cs
│ ├── 20240915085424_freesstatus.cs
│ ├── 20240913113735_subjects.cs
│ ├── 20240914183219_change.cs
│ ├── 20240913094726_event.cs
│ ├── 20240915151718_Attandance.cs
│ ├── 20240914085900_timetable.cs
│ ├── 20240912105033_t.cs
│ ├── 20240914111838_time.cs
│ ├── 20240915140007_assigment.cs
│ ├── 20240912103618_te.Designer.cs
│ ├── 20240912104745_tes.Designer.cs
│ ├── 20240912105033_t.Designer.cs
│ ├── 20240913094726_event.Designer.cs
│ ├── 20240913113556_subject.Designer.cs
│ ├── 20240913113735_subjects.Designer.cs
│ ├── 20240914112150_times.Designer.cs
│ ├── 20240914183219_change.Designer.cs
│ ├── 20240914111838_time.Designer.cs
│ ├── 20240915072817_frees.Designer.cs
│ ├── 20240914085900_timetable.Designer.cs
│ ├── 20240915090050_freesstat.Designer.cs
│ └── 20240915085424_freesstatus.Designer.cs
├── SchoolManagementApi.csproj
├── Program.cs
├── Properties
│ └── launchSettings.json
├── Context
│ └── ApplicationDbContext.cs
└── Controllers
│ ├── WeatherForecastController.cs
│ ├── StudentController.cs
│ ├── TeacherController.cs
│ └── AdminController.cs
├── SchoolManagementApi.sln
├── .gitattributes
└── .gitignore
/SchoolManagementApi/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/UpdateFeeStatusModel.cs:
--------------------------------------------------------------------------------
1 | namespace SchoolManagementApi.Model
2 | {
3 | public class UpdateFeeStatusModel
4 | {
5 | public string FeesStatus { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/Subject.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace SchoolManagementApi.Model
4 | {
5 | public class Subject
6 | {
7 | [Key]
8 | public int SubjectId { get; set; }
9 |
10 | public string SubjectName { get; set; }
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SchoolManagementApi/WeatherForecast.cs:
--------------------------------------------------------------------------------
1 | namespace SchoolManagementApi
2 | {
3 | public class WeatherForecast
4 | {
5 | public DateTime Date { get; set; }
6 |
7 | public int TemperatureC { get; set; }
8 |
9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
10 |
11 | public string? Summary { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SchoolManagementApi/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "ConnectionStrings": {
9 | "dbconn": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=SchoolManagement;Integrated Security=True;Encrypt=True"
10 | },
11 | "AllowedHosts": "*"
12 | }
13 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/AssignmentSubmissionViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace SchoolManagementApi.Model
4 | {
5 | public class AssignmentSubmissionViewModel
6 | {
7 | [Key]
8 | public int AssignmentId { get; set; }
9 | public int StudentId { get; set; }
10 | public string FileUpload { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/Users.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace SchoolManagement.Model
4 | {
5 | public class Users
6 | {
7 | [Key]
8 | public int UserId { get; set; }
9 | public string UserName { get; set; }
10 |
11 | public string Password { get; set; }
12 |
13 | public string Urole { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/Event.cs:
--------------------------------------------------------------------------------
1 | namespace SchoolManagementApi.Model
2 | {
3 | public class Event
4 | {
5 | public int Id { get; set; }
6 | public string Title { get; set; }
7 | public string Description { get; set; }
8 | public DateTime StartDate { get; set; }
9 | public DateTime EndDate { get; set; }
10 | public bool IsAcademic { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/Timetable.cs:
--------------------------------------------------------------------------------
1 | namespace SchoolManagementApi.Model
2 | {
3 | public class Timetable
4 | {
5 | public int Id { get; set; }
6 | public string Standard { get; set; }
7 | public string Day { get; set; }
8 | public DateTime StartTime { get; set; }
9 | public DateTime EndTime { get; set; }
10 | public string Subject { get; set; }
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/AssignmentSubmission.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace SchoolManagementApi.Model
4 | {
5 | public class AssignmentSubmission
6 | {
7 | [Key]
8 | public int SubmissionId { get; set; }
9 | public int AssignmentId { get; set; }
10 | public int StudentId { get; set; }
11 | public DateTime SubmissionDate { get; set; }
12 | public string FileUpload { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/StudentRequest.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace SchoolManagementApi.Model
4 | {
5 | public class StudentRequest
6 | {
7 | [Key]
8 | public int studentRequestId { get; set; }
9 |
10 | public string StudentName { get; set; }
11 |
12 | public string StudentEmail { get; set; }
13 | public long Contect { get; set; }
14 |
15 | public string standard { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/Assignments.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace SchoolManagementApi.Model
4 | {
5 | public class Assignments
6 | {
7 | [Key]
8 | public int AssignmentId { get; set; }
9 | public int TeacherId { get; set; }
10 | public string Standard { get; set; }
11 | public string Title { get; set; }
12 | public string Description { get; set; }
13 | public DateTime DueDate { get; set; }
14 | public string FileUpload { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240912103618_te.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | #nullable disable
4 |
5 | namespace SchoolManagementApi.Migrations
6 | {
7 | ///
8 | public partial class te : Migration
9 | {
10 | ///
11 | protected override void Up(MigrationBuilder migrationBuilder)
12 | {
13 |
14 | }
15 |
16 | ///
17 | protected override void Down(MigrationBuilder migrationBuilder)
18 | {
19 |
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240912104745_tes.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | #nullable disable
4 |
5 | namespace SchoolManagementApi.Migrations
6 | {
7 | ///
8 | public partial class tes : Migration
9 | {
10 | ///
11 | protected override void Up(MigrationBuilder migrationBuilder)
12 | {
13 |
14 | }
15 |
16 | ///
17 | protected override void Down(MigrationBuilder migrationBuilder)
18 | {
19 |
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/AssignmentViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace SchoolManagementApi.Model
4 | {
5 | public class AssignmentViewModel
6 | {
7 | [Key]
8 | public int AssignmentId { get; set; }
9 | public int TeacherId { get; set; }
10 | public string Standard { get; set; }
11 | public string Title { get; set; }
12 | public string Description { get; set; }
13 | public DateTime DueDate { get; set; }
14 | public string FileUpload { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240913113556_subject.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | #nullable disable
4 |
5 | namespace SchoolManagementApi.Migrations
6 | {
7 | ///
8 | public partial class subject : Migration
9 | {
10 | ///
11 | protected override void Up(MigrationBuilder migrationBuilder)
12 | {
13 |
14 | }
15 |
16 | ///
17 | protected override void Down(MigrationBuilder migrationBuilder)
18 | {
19 |
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/AddLibrarian.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace SchoolManagement.Model
4 | {
5 | public class AddLibrarian
6 | {
7 | [Key]
8 | public int LibararianId { get; set; }
9 |
10 | public string LibrarianUser { get; set; }
11 |
12 | public string Librarianpass { get; set; }
13 |
14 | public string LibrarianName { get; set; }
15 |
16 | public string Email { get; set; }
17 |
18 | public long Contact { get; set; }
19 |
20 | public string Joindate { get; set; }
21 | public double Salary { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/Attendance.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace SchoolManagementApi.Model
4 | {
5 | public class Attendance
6 | {
7 | [Key]
8 | //[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
9 | public int AttendanceId { get; set; }
10 | public int StudentId { get; set; }
11 | [Required]
12 | public string FullName { get; set; }
13 | [Required]
14 | public string Standard { get; set; }
15 | [Required]
16 | public string Date { get; set; }
17 | [Required]
18 | public bool IsPresent { get; set; }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/AddStudent.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace SchoolManagement.Model
4 | {
5 | public class AddStudent
6 | {
7 | [Key]
8 | public int StudentId { get; set; }
9 | public string StudentUser { get; set; }
10 |
11 | public string Studentpass { get; set; }
12 |
13 | public string fullname { get; set; }
14 |
15 | public string Email { get; set; }
16 |
17 | public long Contect { get; set; }
18 |
19 | public string Standard { get; set; }
20 |
21 | public string AddMisstiondate { get; set; }
22 |
23 | public double Fees { get; set; }
24 | public string FeesStatus { get; set; }
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/SchoolManagementApi/SchoolManagementApi.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 | all
13 | runtime; build; native; contentfiles; analyzers; buildtransitive
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/AddTeacher.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace SchoolManagementApi.Model
4 | {
5 | public class AddTeacher
6 | {
7 | [Key]
8 | public int TeacherId { get; set; }
9 |
10 | public string TeacherUser { get; set; }
11 |
12 | public string Teacherpass { get; set; }
13 |
14 | public string TecherName { get; set; }
15 |
16 | public string Subject { get; set; }
17 |
18 | public string Standard { get;set; }
19 |
20 | public string TeacherEmail { get; set; }
21 |
22 | public long Contact { get; set; }
23 |
24 | public string qualification{ get; set; }
25 |
26 | public string Joindate { get; set; }
27 | public double Salary { get; set; }
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Model/TeacherLeaveRequest.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace SchoolManagementApi.Model
4 | {
5 | public class TeacherLeaveRequest
6 | {
7 | [Key]
8 | //[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
9 | public int LeaveRequestId { get; set; }
10 |
11 | [Required]
12 |
13 | public string UserName { get; set; }
14 | public string Standard { get; set; }
15 |
16 | [Required]
17 | public string StartDate { get; set; }
18 |
19 | [Required]
20 | public string EndDate { get; set; }
21 |
22 | [Required]
23 | public string? Subject { get; set; }
24 |
25 | [Required]
26 | public string? Reason { get; set; }
27 |
28 | [StringLength(50)]
29 | public string? Status { get; set; }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore;
2 | using SchoolManagementApi.Context;
3 |
4 | var builder = WebApplication.CreateBuilder(args);
5 |
6 | // Add services to the container.
7 |
8 | builder.Services.AddControllers();
9 | // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
10 | builder.Services.AddEndpointsApiExplorer();
11 | builder.Services.AddSwaggerGen();
12 | builder.Services.AddDbContext(options => options.UseSqlServer(
13 | builder.Configuration.GetConnectionString("dbconn")));
14 |
15 | var app = builder.Build();
16 |
17 | // Configure the HTTP request pipeline.
18 | if (app.Environment.IsDevelopment())
19 | {
20 | app.UseSwagger();
21 | app.UseSwaggerUI();
22 | }
23 |
24 | app.UseHttpsRedirection();
25 |
26 | app.UseAuthorization();
27 |
28 | app.MapControllers();
29 |
30 | app.Run();
31 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240915090050_freesstat.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | #nullable disable
4 |
5 | namespace SchoolManagementApi.Migrations
6 | {
7 | ///
8 | public partial class freesstat : Migration
9 | {
10 | ///
11 | protected override void Up(MigrationBuilder migrationBuilder)
12 | {
13 | migrationBuilder.RenameColumn(
14 | name: "FessStatus",
15 | table: "Student",
16 | newName: "FeesStatus");
17 | }
18 |
19 | ///
20 | protected override void Down(MigrationBuilder migrationBuilder)
21 | {
22 | migrationBuilder.RenameColumn(
23 | name: "FeesStatus",
24 | table: "Student",
25 | newName: "FessStatus");
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240915072817_frees.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | #nullable disable
4 |
5 | namespace SchoolManagementApi.Migrations
6 | {
7 | ///
8 | public partial class frees : Migration
9 | {
10 | ///
11 | protected override void Up(MigrationBuilder migrationBuilder)
12 | {
13 | migrationBuilder.AddColumn(
14 | name: "Fees",
15 | table: "Student",
16 | type: "float",
17 | nullable: false,
18 | defaultValue: 0.0);
19 | }
20 |
21 | ///
22 | protected override void Down(MigrationBuilder migrationBuilder)
23 | {
24 | migrationBuilder.DropColumn(
25 | name: "Fees",
26 | table: "Student");
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240914112150_times.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | #nullable disable
4 |
5 | namespace SchoolManagementApi.Migrations
6 | {
7 | ///
8 | public partial class times : Migration
9 | {
10 | ///
11 | protected override void Up(MigrationBuilder migrationBuilder)
12 | {
13 | migrationBuilder.DropColumn(
14 | name: "TeacherId",
15 | table: "Timetables");
16 | }
17 |
18 | ///
19 | protected override void Down(MigrationBuilder migrationBuilder)
20 | {
21 | migrationBuilder.AddColumn(
22 | name: "TeacherId",
23 | table: "Timetables",
24 | type: "nvarchar(max)",
25 | nullable: false,
26 | defaultValue: "");
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240915085424_freesstatus.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | #nullable disable
4 |
5 | namespace SchoolManagementApi.Migrations
6 | {
7 | ///
8 | public partial class freesstatus : Migration
9 | {
10 | ///
11 | protected override void Up(MigrationBuilder migrationBuilder)
12 | {
13 | migrationBuilder.AddColumn(
14 | name: "FessStatus",
15 | table: "Student",
16 | type: "nvarchar(max)",
17 | nullable: false,
18 | defaultValue: "");
19 | }
20 |
21 | ///
22 | protected override void Down(MigrationBuilder migrationBuilder)
23 | {
24 | migrationBuilder.DropColumn(
25 | name: "FessStatus",
26 | table: "Student");
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/launchsettings.json",
3 | "iisSettings": {
4 | "windowsAuthentication": false,
5 | "anonymousAuthentication": true,
6 | "iisExpress": {
7 | "applicationUrl": "http://localhost:9783",
8 | "sslPort": 44379
9 | }
10 | },
11 | "profiles": {
12 | "SchoolManagementApi": {
13 | "commandName": "Project",
14 | "dotnetRunMessages": true,
15 | "launchBrowser": true,
16 | "launchUrl": "swagger",
17 | "applicationUrl": "https://localhost:7265;http://localhost:5086",
18 | "environmentVariables": {
19 | "ASPNETCORE_ENVIRONMENT": "Development"
20 | }
21 | },
22 | "IIS Express": {
23 | "commandName": "IISExpress",
24 | "launchBrowser": true,
25 | "launchUrl": "swagger",
26 | "environmentVariables": {
27 | "ASPNETCORE_ENVIRONMENT": "Development"
28 | }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Context/ApplicationDbContext.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore;
2 | using SchoolManagement.Model;
3 | using SchoolManagementApi.Model;
4 | using System.Collections.Generic;
5 |
6 | namespace SchoolManagementApi.Context
7 | {
8 | public class ApplicationDbContext : DbContext
9 | {
10 | public ApplicationDbContext(DbContextOptions options) : base(options) { }
11 |
12 | public DbSet studentRequests { get; set; }
13 |
14 | public DbSet Student { get; set; }
15 |
16 | public DbSet Users { get; set; }
17 | public DbSet Teachers { get; set; }
18 | public DbSet Librarian { get; set; }
19 | public DbSet TeacherLeaves { get; set; }
20 | public DbSet Event { get; set; }
21 | public DbSet Subject { get; set; }
22 | public DbSet Timetables { get; set; }
23 | public DbSet assignments { get; set; }
24 | public DbSet assignmentSubmissions { get; set; }
25 | public DbSet Attendances { get; set; }
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Controllers/WeatherForecastController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 |
3 | namespace SchoolManagementApi.Controllers
4 | {
5 | [ApiController]
6 | [Route("[controller]")]
7 | public class WeatherForecastController : ControllerBase
8 | {
9 | private static readonly string[] Summaries = new[]
10 | {
11 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
12 | };
13 |
14 | private readonly ILogger _logger;
15 |
16 | public WeatherForecastController(ILogger logger)
17 | {
18 | _logger = logger;
19 | }
20 |
21 | [HttpGet(Name = "GetWeatherForecast")]
22 | public IEnumerable Get()
23 | {
24 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast
25 | {
26 | Date = DateTime.Now.AddDays(index),
27 | TemperatureC = Random.Shared.Next(-20, 55),
28 | Summary = Summaries[Random.Shared.Next(Summaries.Length)]
29 | })
30 | .ToArray();
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240913113735_subjects.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | #nullable disable
4 |
5 | namespace SchoolManagementApi.Migrations
6 | {
7 | ///
8 | public partial class subjects : Migration
9 | {
10 | ///
11 | protected override void Up(MigrationBuilder migrationBuilder)
12 | {
13 | migrationBuilder.CreateTable(
14 | name: "Subject",
15 | columns: table => new
16 | {
17 | SubjectId = table.Column(type: "int", nullable: false)
18 | .Annotation("SqlServer:Identity", "1, 1"),
19 | SubjectName = table.Column(type: "nvarchar(max)", nullable: false)
20 | },
21 | constraints: table =>
22 | {
23 | table.PrimaryKey("PK_Subject", x => x.SubjectId);
24 | });
25 | }
26 |
27 | ///
28 | protected override void Down(MigrationBuilder migrationBuilder)
29 | {
30 | migrationBuilder.DropTable(
31 | name: "Subject");
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/SchoolManagementApi.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35219.272
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchoolManagementApi", "SchoolManagementApi\SchoolManagementApi.csproj", "{4D14BE10-7C62-4AFD-AFC1-A1678AF4BF12}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {4D14BE10-7C62-4AFD-AFC1-A1678AF4BF12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {4D14BE10-7C62-4AFD-AFC1-A1678AF4BF12}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {4D14BE10-7C62-4AFD-AFC1-A1678AF4BF12}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {4D14BE10-7C62-4AFD-AFC1-A1678AF4BF12}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {C465F360-80BD-4E58-89B7-63EAA9250F4D}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240914183219_change.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | #nullable disable
4 |
5 | namespace SchoolManagementApi.Migrations
6 | {
7 | ///
8 | public partial class change : Migration
9 | {
10 | ///
11 | protected override void Up(MigrationBuilder migrationBuilder)
12 | {
13 | migrationBuilder.DropColumn(
14 | name: "TeacherId",
15 | table: "TeacherLeaves");
16 |
17 | migrationBuilder.AddColumn(
18 | name: "Standard",
19 | table: "TeacherLeaves",
20 | type: "nvarchar(max)",
21 | nullable: false,
22 | defaultValue: "");
23 | }
24 |
25 | ///
26 | protected override void Down(MigrationBuilder migrationBuilder)
27 | {
28 | migrationBuilder.DropColumn(
29 | name: "Standard",
30 | table: "TeacherLeaves");
31 |
32 | migrationBuilder.AddColumn(
33 | name: "TeacherId",
34 | table: "TeacherLeaves",
35 | type: "int",
36 | nullable: false,
37 | defaultValue: 0);
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Controllers/StudentController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Http;
2 | using Microsoft.AspNetCore.Mvc;
3 | using Microsoft.EntityFrameworkCore;
4 | using SchoolManagement.Model;
5 | using SchoolManagementApi.Context;
6 | using SchoolManagementApi.Model;
7 |
8 | namespace SchoolManagementApi.Controllers
9 | {
10 | [Route("api/[controller]")]
11 | [ApiController]
12 | public class StudentController : ControllerBase
13 | {
14 | private readonly ApplicationDbContext db;
15 | public StudentController(ApplicationDbContext db)
16 | {
17 | this.db = db;
18 | }
19 |
20 | [Route("Profile/{Username}")]
21 | [HttpGet]
22 | public IActionResult StudentProfile(string Username)
23 | {
24 | var data = db.Student.FromSqlRaw($"exec StudentProfile '{Username}'").AsEnumerable().SingleOrDefault();
25 | return Ok(data);
26 | }
27 |
28 |
29 |
30 | [Route("UpdateFeesStatus/{studentUser}")]
31 | [HttpPut]
32 | public IActionResult UpdateFeesStatus(string studentUser )
33 | {
34 | db.Database.ExecuteSqlRaw($"Exec UpdateFees '{studentUser}'");
35 | // Check if the studentUser and feesStatus are not null or empty
36 | return Ok();
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240913094726_event.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.EntityFrameworkCore.Migrations;
3 |
4 | #nullable disable
5 |
6 | namespace SchoolManagementApi.Migrations
7 | {
8 | ///
9 | public partial class @event : Migration
10 | {
11 | ///
12 | protected override void Up(MigrationBuilder migrationBuilder)
13 | {
14 | migrationBuilder.CreateTable(
15 | name: "Event",
16 | columns: table => new
17 | {
18 | Id = table.Column(type: "int", nullable: false)
19 | .Annotation("SqlServer:Identity", "1, 1"),
20 | Title = table.Column(type: "nvarchar(max)", nullable: false),
21 | Description = table.Column(type: "nvarchar(max)", nullable: false),
22 | StartDate = table.Column(type: "datetime2", nullable: false),
23 | EndDate = table.Column(type: "datetime2", nullable: false),
24 | IsAcademic = table.Column(type: "bit", nullable: false)
25 | },
26 | constraints: table =>
27 | {
28 | table.PrimaryKey("PK_Event", x => x.Id);
29 | });
30 | }
31 |
32 | ///
33 | protected override void Down(MigrationBuilder migrationBuilder)
34 | {
35 | migrationBuilder.DropTable(
36 | name: "Event");
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240915151718_Attandance.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | #nullable disable
4 |
5 | namespace SchoolManagementApi.Migrations
6 | {
7 | ///
8 | public partial class Attandance : Migration
9 | {
10 | ///
11 | protected override void Up(MigrationBuilder migrationBuilder)
12 | {
13 | migrationBuilder.CreateTable(
14 | name: "Attendances",
15 | columns: table => new
16 | {
17 | AttendanceId = table.Column(type: "int", nullable: false)
18 | .Annotation("SqlServer:Identity", "1, 1"),
19 | StudentId = table.Column(type: "int", nullable: false),
20 | FullName = table.Column(type: "nvarchar(max)", nullable: false),
21 | Standard = table.Column(type: "nvarchar(max)", nullable: false),
22 | Date = table.Column(type: "nvarchar(max)", nullable: false),
23 | IsPresent = table.Column(type: "bit", nullable: false)
24 | },
25 | constraints: table =>
26 | {
27 | table.PrimaryKey("PK_Attendances", x => x.AttendanceId);
28 | });
29 | }
30 |
31 | ///
32 | protected override void Down(MigrationBuilder migrationBuilder)
33 | {
34 | migrationBuilder.DropTable(
35 | name: "Attendances");
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240914085900_timetable.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | #nullable disable
4 |
5 | namespace SchoolManagementApi.Migrations
6 | {
7 | ///
8 | public partial class timetable : Migration
9 | {
10 | ///
11 | protected override void Up(MigrationBuilder migrationBuilder)
12 | {
13 | migrationBuilder.CreateTable(
14 | name: "Timetables",
15 | columns: table => new
16 | {
17 | Id = table.Column(type: "int", nullable: false)
18 | .Annotation("SqlServer:Identity", "1, 1"),
19 | Standard = table.Column(type: "nvarchar(max)", nullable: false),
20 | Day = table.Column(type: "nvarchar(max)", nullable: false),
21 | StartTime = table.Column(type: "nvarchar(max)", nullable: false),
22 | EndTime = table.Column(type: "nvarchar(max)", nullable: false),
23 | Subject = table.Column(type: "nvarchar(max)", nullable: false),
24 | TeacherId = table.Column(type: "nvarchar(max)", nullable: false)
25 | },
26 | constraints: table =>
27 | {
28 | table.PrimaryKey("PK_Timetables", x => x.Id);
29 | });
30 | }
31 |
32 | ///
33 | protected override void Down(MigrationBuilder migrationBuilder)
34 | {
35 | migrationBuilder.DropTable(
36 | name: "Timetables");
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240912105033_t.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | #nullable disable
4 |
5 | namespace SchoolManagementApi.Migrations
6 | {
7 | ///
8 | public partial class t : Migration
9 | {
10 | ///
11 | protected override void Up(MigrationBuilder migrationBuilder)
12 | {
13 | migrationBuilder.CreateTable(
14 | name: "TeacherLeaves",
15 | columns: table => new
16 | {
17 | LeaveRequestId = table.Column(type: "int", nullable: false)
18 | .Annotation("SqlServer:Identity", "1, 1"),
19 | TeacherId = table.Column(type: "int", nullable: false),
20 | UserName = table.Column(type: "nvarchar(max)", nullable: false),
21 | StartDate = table.Column(type: "nvarchar(max)", nullable: false),
22 | EndDate = table.Column(type: "nvarchar(max)", nullable: false),
23 | Subject = table.Column(type: "nvarchar(max)", nullable: false),
24 | Reason = table.Column(type: "nvarchar(max)", nullable: false),
25 | Status = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true)
26 | },
27 | constraints: table =>
28 | {
29 | table.PrimaryKey("PK_TeacherLeaves", x => x.LeaveRequestId);
30 | });
31 | }
32 |
33 | ///
34 | protected override void Down(MigrationBuilder migrationBuilder)
35 | {
36 | migrationBuilder.DropTable(
37 | name: "TeacherLeaves");
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240914111838_time.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.EntityFrameworkCore.Migrations;
3 |
4 | #nullable disable
5 |
6 | namespace SchoolManagementApi.Migrations
7 | {
8 | ///
9 | public partial class time : Migration
10 | {
11 | ///
12 | protected override void Up(MigrationBuilder migrationBuilder)
13 | {
14 | migrationBuilder.AlterColumn(
15 | name: "StartTime",
16 | table: "Timetables",
17 | type: "datetime2",
18 | nullable: false,
19 | oldClrType: typeof(string),
20 | oldType: "nvarchar(max)");
21 |
22 | migrationBuilder.AlterColumn(
23 | name: "EndTime",
24 | table: "Timetables",
25 | type: "datetime2",
26 | nullable: false,
27 | oldClrType: typeof(string),
28 | oldType: "nvarchar(max)");
29 | }
30 |
31 | ///
32 | protected override void Down(MigrationBuilder migrationBuilder)
33 | {
34 | migrationBuilder.AlterColumn(
35 | name: "StartTime",
36 | table: "Timetables",
37 | type: "nvarchar(max)",
38 | nullable: false,
39 | oldClrType: typeof(DateTime),
40 | oldType: "datetime2");
41 |
42 | migrationBuilder.AlterColumn(
43 | name: "EndTime",
44 | table: "Timetables",
45 | type: "nvarchar(max)",
46 | nullable: false,
47 | oldClrType: typeof(DateTime),
48 | oldType: "datetime2");
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240915140007_assigment.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.EntityFrameworkCore.Migrations;
3 |
4 | #nullable disable
5 |
6 | namespace SchoolManagementApi.Migrations
7 | {
8 | ///
9 | public partial class assigment : Migration
10 | {
11 | ///
12 | protected override void Up(MigrationBuilder migrationBuilder)
13 | {
14 | migrationBuilder.CreateTable(
15 | name: "assignments",
16 | columns: table => new
17 | {
18 | AssignmentId = table.Column(type: "int", nullable: false)
19 | .Annotation("SqlServer:Identity", "1, 1"),
20 | TeacherId = table.Column(type: "int", nullable: false),
21 | Standard = table.Column(type: "nvarchar(max)", nullable: false),
22 | Title = table.Column(type: "nvarchar(max)", nullable: false),
23 | Description = table.Column(type: "nvarchar(max)", nullable: false),
24 | DueDate = table.Column(type: "datetime2", nullable: false),
25 | FileUpload = table.Column(type: "nvarchar(max)", nullable: false)
26 | },
27 | constraints: table =>
28 | {
29 | table.PrimaryKey("PK_assignments", x => x.AssignmentId);
30 | });
31 |
32 | migrationBuilder.CreateTable(
33 | name: "assignmentSubmissions",
34 | columns: table => new
35 | {
36 | SubmissionId = table.Column(type: "int", nullable: false)
37 | .Annotation("SqlServer:Identity", "1, 1"),
38 | AssignmentId = table.Column(type: "int", nullable: false),
39 | StudentId = table.Column(type: "int", nullable: false),
40 | SubmissionDate = table.Column(type: "datetime2", nullable: false),
41 | FileUpload = table.Column(type: "nvarchar(max)", nullable: false)
42 | },
43 | constraints: table =>
44 | {
45 | table.PrimaryKey("PK_assignmentSubmissions", x => x.SubmissionId);
46 | });
47 | }
48 |
49 | ///
50 | protected override void Down(MigrationBuilder migrationBuilder)
51 | {
52 | migrationBuilder.DropTable(
53 | name: "assignments");
54 |
55 | migrationBuilder.DropTable(
56 | name: "assignmentSubmissions");
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Controllers/TeacherController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Http;
2 | using Microsoft.AspNetCore.Mvc;
3 | using Microsoft.EntityFrameworkCore;
4 | using SchoolManagement.Model;
5 | using SchoolManagementApi.Context;
6 | using SchoolManagementApi.Model;
7 |
8 | namespace SchoolManagementApi.Controllers
9 | {
10 | [Route("api/[controller]")]
11 | [ApiController]
12 | public class TeacherController : ControllerBase
13 | {
14 | private readonly ApplicationDbContext db;
15 | public TeacherController(ApplicationDbContext db)
16 | {
17 | this.db = db;
18 | }
19 |
20 | [Route("TeacherProfile/{Username}")]
21 | [HttpGet]
22 | public IActionResult TeacherProfile(string Username)
23 | {
24 | var data = db.Teachers.FromSqlRaw($"exec TeacherProfile '{Username}'").AsEnumerable().SingleOrDefault();
25 |
26 | return Ok(data);
27 | }
28 |
29 | [Route("RequestLeave")]
30 | [HttpPost]
31 | public IActionResult TeacherRequestLeave(TeacherLeaveRequest e)
32 | {
33 | e.Status = "Pending";
34 | db.TeacherLeaves.Add(e);
35 | db.SaveChanges();
36 | return Ok("We will get in touch with you soon!");
37 | }
38 |
39 | [Route("GetAttendance/{Standard}")]
40 | [HttpGet]
41 | public async Task>> GetAttendances(string Standard)
42 | {
43 |
44 | return await db.Set().FromSqlRaw($"EXEC GetAllAttendances '{Standard}'").ToListAsync();
45 | }
46 |
47 | [Route("AssignAttendance")]
48 | [HttpPost]
49 | public IActionResult AddAttendance(List attendanceList)
50 | {
51 | if (attendanceList == null || !attendanceList.Any())
52 | {
53 | return BadRequest("No attendance data received.");
54 | }
55 |
56 | try
57 | {
58 |
59 | db.Attendances.AddRange(attendanceList);
60 | db.SaveChanges();
61 | return Ok("Attendance added successfully");
62 | }
63 | catch (Exception ex)
64 | {
65 | return StatusCode(500, "An error occurred: " + ex.Message);
66 | }
67 | }
68 |
69 | [HttpGet("GetStudentById/{id}")]
70 | public IActionResult GetStudentById(int id)
71 | {
72 |
73 | var student = db.Student.Where(s => s.StudentId == id).AsEnumerable().SingleOrDefault();
74 |
75 | if (student == null)
76 | {
77 | return NotFound(new { message = "Student not found." });
78 | }
79 |
80 | return Ok(student);
81 | }
82 |
83 |
84 | //[HttpPost("UploadFile")]
85 | //public async Task UploadFile(IFormFile file)
86 | //{
87 | // if (file == null || file.Length == 0)
88 | // return BadRequest("No file selected.");
89 |
90 | // var allowedExtensions = new[] { ".jpg", ".jpeg", ".png", ".pdf", ".doc", ".docx" };
91 | // if (!allowedExtensions.Contains(Path.GetExtension(file.FileName).ToLower()))
92 | // return BadRequest("Invalid file format.");
93 |
94 | // if (file.Length > 10 * 1024 * 1024) // 10 MB limit
95 | // return BadRequest("File size exceeds the maximum limit.");
96 |
97 | // var uniqueFileName = Guid.NewGuid().ToString() + Path.GetExtension(file.FileName);
98 | // var filePath = Path.Combine(_uploadPath, uniqueFileName);
99 | // Directory.CreateDirectory(_uploadPath); // Ensure the upload directory exists
100 |
101 | // using (var stream = new FileStream(filePath, FileMode.Create))
102 | // {
103 | // await file.CopyToAsync(stream);
104 | // }
105 |
106 | // return Ok(new { fileName = uniqueFileName });
107 | //}
108 | //[HttpPost("AddAssignment")]
109 | //public async Task AddAssignment([FromBody] AssignmentViewModel model)
110 | //{
111 | // if (!ModelState.IsValid)
112 | // return BadRequest(ModelState);
113 |
114 | // var assignment = new Assignments()
115 | // {
116 | // TeacherId = model.TeacherId,
117 | // Standard = model.Standard,
118 | // Title = model.Title,
119 | // Description = model.Description,
120 | // DueDate = model.DueDate,
121 | // FileUpload = model.FileUpload
122 | // };
123 |
124 | // db.assignments.Add(assignment);
125 | // await db.SaveChangesAsync();
126 |
127 | // return Ok("Assignment added successfully");
128 | //}
129 |
130 | //[HttpGet("GetAssignments")]
131 | //public async Task GetAssignments(string standard)
132 | //{
133 | // var assignments = await db.assignments
134 | // .Where(a => a.Standard == standard)
135 | // .ToListAsync();
136 |
137 | // return Ok(assignments);
138 | //}
139 |
140 | //[HttpPost("SubmitAssignment")]
141 | //public async Task SubmitAssignment([FromBody] AssignmentSubmissionViewModel model)
142 | //{
143 | // if (!ModelState.IsValid)
144 | // return BadRequest(ModelState);
145 |
146 | // var submission = new AssignmentSubmission
147 | // {
148 | // AssignmentId = model.AssignmentId,
149 | // StudentId = model.StudentId,
150 | // SubmissionDate = DateTime.Now,
151 | // FileUpload = model.FileUpload
152 | // };
153 |
154 | // db.assignmentSubmissions.Add(submission);
155 | // await db.SaveChangesAsync();
156 |
157 | // return Ok("Assignment submitted successfully");
158 | //}
159 |
160 | //[HttpGet("GetSubmissions/{assignmentId}")]
161 | //public async Task GetSubmissions(int assignmentId)
162 | //{
163 | // var submissions = await db.assignmentSubmissions
164 | // .Where(s => s.AssignmentId == assignmentId)
165 | // .ToListAsync();
166 |
167 | // return Ok(submissions);
168 | //}
169 |
170 |
171 | }
172 | }
173 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Oo]ut/
33 | [Ll]og/
34 | [Ll]ogs/
35 |
36 | # Visual Studio 2015/2017 cache/options directory
37 | .vs/
38 | # Uncomment if you have tasks that create the project's static files in wwwroot
39 | #wwwroot/
40 |
41 | # Visual Studio 2017 auto generated files
42 | Generated\ Files/
43 |
44 | # MSTest test Results
45 | [Tt]est[Rr]esult*/
46 | [Bb]uild[Ll]og.*
47 |
48 | # NUnit
49 | *.VisualState.xml
50 | TestResult.xml
51 | nunit-*.xml
52 |
53 | # Build Results of an ATL Project
54 | [Dd]ebugPS/
55 | [Rr]eleasePS/
56 | dlldata.c
57 |
58 | # Benchmark Results
59 | BenchmarkDotNet.Artifacts/
60 |
61 | # .NET Core
62 | project.lock.json
63 | project.fragment.lock.json
64 | artifacts/
65 |
66 | # ASP.NET Scaffolding
67 | ScaffoldingReadMe.txt
68 |
69 | # StyleCop
70 | StyleCopReport.xml
71 |
72 | # Files built by Visual Studio
73 | *_i.c
74 | *_p.c
75 | *_h.h
76 | *.ilk
77 | *.meta
78 | *.obj
79 | *.iobj
80 | *.pch
81 | *.pdb
82 | *.ipdb
83 | *.pgc
84 | *.pgd
85 | *.rsp
86 | *.sbr
87 | *.tlb
88 | *.tli
89 | *.tlh
90 | *.tmp
91 | *.tmp_proj
92 | *_wpftmp.csproj
93 | *.log
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio LightSwitch build output
298 | **/*.HTMLClient/GeneratedArtifacts
299 | **/*.DesktopClient/GeneratedArtifacts
300 | **/*.DesktopClient/ModelManifest.xml
301 | **/*.Server/GeneratedArtifacts
302 | **/*.Server/ModelManifest.xml
303 | _Pvt_Extensions
304 |
305 | # Paket dependency manager
306 | .paket/paket.exe
307 | paket-files/
308 |
309 | # FAKE - F# Make
310 | .fake/
311 |
312 | # CodeRush personal settings
313 | .cr/personal
314 |
315 | # Python Tools for Visual Studio (PTVS)
316 | __pycache__/
317 | *.pyc
318 |
319 | # Cake - Uncomment if you are using it
320 | # tools/**
321 | # !tools/packages.config
322 |
323 | # Tabs Studio
324 | *.tss
325 |
326 | # Telerik's JustMock configuration file
327 | *.jmconfig
328 |
329 | # BizTalk build output
330 | *.btp.cs
331 | *.btm.cs
332 | *.odx.cs
333 | *.xsd.cs
334 |
335 | # OpenCover UI analysis results
336 | OpenCover/
337 |
338 | # Azure Stream Analytics local run output
339 | ASALocalRun/
340 |
341 | # MSBuild Binary and Structured Log
342 | *.binlog
343 |
344 | # NVidia Nsight GPU debugger configuration file
345 | *.nvuser
346 |
347 | # MFractors (Xamarin productivity tool) working folder
348 | .mfractor/
349 |
350 | # Local History for Visual Studio
351 | .localhistory/
352 |
353 | # BeatPulse healthcheck temp database
354 | healthchecksdb
355 |
356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
357 | MigrationBackup/
358 |
359 | # Ionide (cross platform F# VS Code tools) working folder
360 | .ionide/
361 |
362 | # Fody - auto-generated XML schema
363 | FodyWeavers.xsd
--------------------------------------------------------------------------------
/SchoolManagementApi/Controllers/AdminController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Http;
2 | using Microsoft.AspNetCore.Mvc;
3 | using Microsoft.EntityFrameworkCore;
4 | using Microsoft.Extensions.Logging;
5 | using SchoolManagement.Model;
6 | using SchoolManagementApi.Context;
7 |
8 | using SchoolManagementApi.Model;
9 | using System.Xml;
10 |
11 | namespace SchoolManagementApi.Controllers
12 | {
13 | [Route("api/[controller]")]
14 | [ApiController]
15 | public class AdminController : ControllerBase
16 | {
17 | private readonly ApplicationDbContext db;
18 | public AdminController(ApplicationDbContext db)
19 | {
20 | this.db = db;
21 | }
22 |
23 | [Route("GetStudentRequest")]
24 | [HttpGet]
25 | public IActionResult GetStudentRequest()
26 | {
27 | var data = db.studentRequests.ToList();
28 | return Ok(data);
29 | }
30 |
31 | [Route("StudentRequestDelete/{id}")]
32 | [HttpDelete]
33 | public IActionResult StudentRequestDelete(int id)
34 | {
35 |
36 | var data = db.studentRequests.Find(id);
37 |
38 | if (data != null)
39 | {
40 |
41 | db.studentRequests.Remove(data);
42 | db.SaveChanges();
43 | return Ok("Request deleted successfully");
44 | }
45 | return Ok("student request no found ");
46 |
47 |
48 |
49 | }
50 |
51 |
52 | [Route("AddStudent")]
53 | [HttpPost]
54 | public IActionResult AddStudent(AddStudent a)
55 | {
56 | a.AddMisstiondate = DateTime.Now.ToString();
57 | a.FeesStatus = "Pending";
58 | db.Database.ExecuteSqlRaw($"EXEC ADDSTUDENT '{a.StudentUser}','{a.Studentpass}','{a.fullname}','{a.Email}','{a.Contect}','{a.Standard}','{a.AddMisstiondate}','{a.Fees}','{a.FeesStatus}'");
59 | var urole = "Student";
60 |
61 | db.Database.ExecuteSqlRaw($"Exec AddUser '{a.StudentUser}','{a.Studentpass}','{urole}'");
62 | return Ok("Student Added successfully..!!!");
63 | }
64 |
65 |
66 | [Route("AddTeacher")]
67 | [HttpPost]
68 | public IActionResult AddTeacher(AddTeacher t)
69 | {
70 | t.Joindate = DateTime.Now.ToString();
71 | db.Database.ExecuteSqlRaw($"exec AddTeachers '{t.TeacherUser}','{t.Teacherpass}','{t.TecherName}','{t.Subject}','{t.Standard}','{t.TeacherEmail}','{t.Contact}','{t.qualification}','{t.Joindate}','{t.Salary}'");
72 | var urole = "Teacher";
73 | db.Database.ExecuteSqlRaw($"Exec AddUser '{t.TeacherUser}','{t.Teacherpass}','{urole}'");
74 | db.Database.ExecuteSqlRaw($"Exec AddSubject '{t.Subject}'");
75 | return Ok("Teacher Added successfully");
76 |
77 | }
78 |
79 | //[Route("GetLeaveRequest")]
80 | //[HttpGet]
81 | //public IActionResult GetLeaveRequest()
82 | //{
83 | // var data = db.TeacherLeaveRequest.ToList();
84 | // return Ok(data);
85 | //}
86 |
87 | [Route("Addlabrarian")]
88 | [HttpPost]
89 | public IActionResult Addlabrarian(AddLibrarian l)
90 | {
91 | l.Joindate = DateTime.Now.ToString();
92 | db.Database.ExecuteSqlRaw($"Exec AddLibrarian '{l.LibrarianUser}','{l.Librarianpass}','{l.LibrarianName}','{l.Email}','{l.Contact}','{l.Joindate}','{l.Salary}'");
93 | var urole = "labrarian";
94 | db.Database.ExecuteSqlRaw($"Exec AddUser '{l.LibrarianUser}','{l.Librarianpass}','{urole}'");
95 | return Ok("Labrarian added successfully ");
96 | }
97 |
98 | [Route("SignIn")]
99 | [HttpPost]
100 | public IActionResult SignIn(Users u)
101 | {
102 | var data = db.Users.FromSqlRaw($"AuthUser '{u.UserName}','{u.Password}'").AsEnumerable().FirstOrDefault();
103 |
104 | if (data != null)
105 | {
106 | return Ok(data);
107 | }
108 | else
109 | {
110 | return Unauthorized("Invalid username or password");
111 | }
112 | }
113 |
114 | [Route("GetLeaveRequest")]
115 | [HttpGet]
116 | public IActionResult GetLeaveRequest()
117 | {
118 | var data = db.TeacherLeaves.ToList();
119 | return Ok(data);
120 | }
121 |
122 | [Route("PostLeaveRequest/{Id}")]
123 | [HttpDelete]
124 | public IActionResult PostLeaveRequest(int Id)
125 | {
126 |
127 |
128 | db.Database.ExecuteSqlRaw($"Exec deleteTeacherLeave '{Id}'");
129 | return Ok("Teacher LeaveRequest Deleted ");
130 |
131 | }
132 |
133 | [Route("GetEvents")]
134 | [HttpGet]
135 | public async Task GetEvents()
136 | {
137 | var events = await db.Event.ToListAsync();
138 | return Ok(events);
139 | }
140 | [Route("CreateEvent")]
141 | [HttpPost]
142 | public async Task createEvents(Event events)
143 | {
144 | db.Event.Add(events);
145 | await db.SaveChangesAsync();
146 | return CreatedAtAction(nameof(GetEvents), new { id = events.Id }, events);
147 | }
148 | [Route("GetEventsById/{id}")]
149 | [HttpGet]
150 | public async Task GetEventsById(int id)
151 | {
152 | var eventItem = await db.Event.FindAsync(id);
153 | if (eventItem == null)
154 | {
155 | return NotFound();
156 | }
157 | return Ok(eventItem);
158 | }
159 | [Route("updateEvent/{id}")]
160 | [HttpPut]
161 | public async Task updateEvent(int id, Event eventItem)
162 | {
163 | if (id != eventItem.Id)
164 | {
165 | return BadRequest();
166 | }
167 | db.Entry(eventItem).State = EntityState.Modified;
168 | await db.SaveChangesAsync();
169 | return NoContent();
170 | }
171 | [Route("DeleteEvent/{id}")]
172 | [HttpDelete]
173 | public async Task DeleteEvent(int id)
174 | {
175 | var events = await db.Event.FindAsync(id);
176 | if (events == null)
177 | {
178 | return NotFound();
179 | }
180 | db.Event.Remove(events);
181 | await db.SaveChangesAsync();
182 | return NoContent();
183 | }
184 |
185 |
186 |
187 | [Route("AddTimeTable")]
188 | [HttpPost]
189 |
190 | public IActionResult AddTime(Timetable tt)
191 | {
192 | db.Timetables.Add(tt);
193 | db.SaveChanges();
194 | return Ok("TimeTable Added Successfully");
195 | }
196 |
197 | [Route("GetTimeTable")]
198 | [HttpGet]
199 | public IActionResult GetTime()
200 | {
201 | var curricula = db.Timetables.ToList();
202 | return Ok(curricula);
203 | }
204 |
205 |
206 | [Route("FetchSubject")]
207 | [HttpGet]
208 | public IActionResult FetchSubject()
209 | {
210 | var data = db.Subject.FromSqlRaw("exec fetchsubject").ToList();
211 | return Ok(data);
212 | }
213 |
214 | [Route("FetchClass")]
215 | [HttpGet]
216 | public IActionResult FetchClass()
217 | {
218 | var data = db.Teachers.FromSqlRaw("exec fetchClass").ToList();
219 | return Ok(data);
220 | }
221 |
222 |
223 |
224 | [Route("FeesPay/{StudentUse}")]
225 | [HttpGet]
226 | public IActionResult FeesPay(string StudentUse)
227 | {
228 | var data = db.Student.FromSqlRaw($"exec fetchFees '{StudentUse}'");
229 | return Ok(data);
230 |
231 | }
232 |
233 |
234 |
235 |
236 | [Route("LandingPage")]
237 | [HttpPost]
238 | public IActionResult LandingPage(StudentRequest e)
239 | {
240 | db.studentRequests.Add(e);
241 | db.SaveChanges();
242 | return Ok("We will get in touch with you soon!");
243 | }
244 | }
245 | }
246 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240912103618_te.Designer.cs:
--------------------------------------------------------------------------------
1 | //
2 | using Microsoft.EntityFrameworkCore;
3 | using Microsoft.EntityFrameworkCore.Infrastructure;
4 | using Microsoft.EntityFrameworkCore.Metadata;
5 | using Microsoft.EntityFrameworkCore.Migrations;
6 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
7 | using SchoolManagementApi.Context;
8 |
9 | #nullable disable
10 |
11 | namespace SchoolManagementApi.Migrations
12 | {
13 | [DbContext(typeof(ApplicationDbContext))]
14 | [Migration("20240912103618_te")]
15 | partial class te
16 | {
17 | ///
18 | protected override void BuildTargetModel(ModelBuilder modelBuilder)
19 | {
20 | #pragma warning disable 612, 618
21 | modelBuilder
22 | .HasAnnotation("ProductVersion", "7.0.0")
23 | .HasAnnotation("Relational:MaxIdentifierLength", 128);
24 |
25 | SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
26 |
27 | modelBuilder.Entity("SchoolManagement.Model.AddLibrarian", b =>
28 | {
29 | b.Property("LibararianId")
30 | .ValueGeneratedOnAdd()
31 | .HasColumnType("int");
32 |
33 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("LibararianId"));
34 |
35 | b.Property("Contact")
36 | .HasColumnType("bigint");
37 |
38 | b.Property("Email")
39 | .IsRequired()
40 | .HasColumnType("nvarchar(max)");
41 |
42 | b.Property("Joindate")
43 | .IsRequired()
44 | .HasColumnType("nvarchar(max)");
45 |
46 | b.Property("LibrarianName")
47 | .IsRequired()
48 | .HasColumnType("nvarchar(max)");
49 |
50 | b.Property("LibrarianUser")
51 | .IsRequired()
52 | .HasColumnType("nvarchar(max)");
53 |
54 | b.Property("Librarianpass")
55 | .IsRequired()
56 | .HasColumnType("nvarchar(max)");
57 |
58 | b.Property("Salary")
59 | .HasColumnType("float");
60 |
61 | b.HasKey("LibararianId");
62 |
63 | b.ToTable("Librarian");
64 | });
65 |
66 | modelBuilder.Entity("SchoolManagement.Model.AddStudent", b =>
67 | {
68 | b.Property("StudentId")
69 | .ValueGeneratedOnAdd()
70 | .HasColumnType("int");
71 |
72 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("StudentId"));
73 |
74 | b.Property("AddMisstiondate")
75 | .IsRequired()
76 | .HasColumnType("nvarchar(max)");
77 |
78 | b.Property("Contect")
79 | .HasColumnType("bigint");
80 |
81 | b.Property("Email")
82 | .IsRequired()
83 | .HasColumnType("nvarchar(max)");
84 |
85 | b.Property("Standard")
86 | .IsRequired()
87 | .HasColumnType("nvarchar(max)");
88 |
89 | b.Property("StudentUser")
90 | .IsRequired()
91 | .HasColumnType("nvarchar(max)");
92 |
93 | b.Property("Studentpass")
94 | .IsRequired()
95 | .HasColumnType("nvarchar(max)");
96 |
97 | b.Property("fullname")
98 | .IsRequired()
99 | .HasColumnType("nvarchar(max)");
100 |
101 | b.HasKey("StudentId");
102 |
103 | b.ToTable("Student");
104 | });
105 |
106 | modelBuilder.Entity("SchoolManagement.Model.Users", b =>
107 | {
108 | b.Property("UserId")
109 | .ValueGeneratedOnAdd()
110 | .HasColumnType("int");
111 |
112 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("UserId"));
113 |
114 | b.Property("Password")
115 | .IsRequired()
116 | .HasColumnType("nvarchar(max)");
117 |
118 | b.Property("Urole")
119 | .IsRequired()
120 | .HasColumnType("nvarchar(max)");
121 |
122 | b.Property("UserName")
123 | .IsRequired()
124 | .HasColumnType("nvarchar(max)");
125 |
126 | b.HasKey("UserId");
127 |
128 | b.ToTable("Users");
129 | });
130 |
131 | modelBuilder.Entity("SchoolManagementApi.Model.AddTeacher", b =>
132 | {
133 | b.Property("TeacherId")
134 | .ValueGeneratedOnAdd()
135 | .HasColumnType("int");
136 |
137 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("TeacherId"));
138 |
139 | b.Property("Contact")
140 | .HasColumnType("bigint");
141 |
142 | b.Property("Joindate")
143 | .IsRequired()
144 | .HasColumnType("nvarchar(max)");
145 |
146 | b.Property("Salary")
147 | .HasColumnType("float");
148 |
149 | b.Property("Standard")
150 | .IsRequired()
151 | .HasColumnType("nvarchar(max)");
152 |
153 | b.Property("Subject")
154 | .IsRequired()
155 | .HasColumnType("nvarchar(max)");
156 |
157 | b.Property("TeacherEmail")
158 | .IsRequired()
159 | .HasColumnType("nvarchar(max)");
160 |
161 | b.Property("TeacherUser")
162 | .IsRequired()
163 | .HasColumnType("nvarchar(max)");
164 |
165 | b.Property("Teacherpass")
166 | .IsRequired()
167 | .HasColumnType("nvarchar(max)");
168 |
169 | b.Property("TecherName")
170 | .IsRequired()
171 | .HasColumnType("nvarchar(max)");
172 |
173 | b.Property("qualification")
174 | .IsRequired()
175 | .HasColumnType("nvarchar(max)");
176 |
177 | b.HasKey("TeacherId");
178 |
179 | b.ToTable("Teachers");
180 | });
181 |
182 | modelBuilder.Entity("SchoolManagementApi.Model.StudentRequest", b =>
183 | {
184 | b.Property("studentRequestId")
185 | .ValueGeneratedOnAdd()
186 | .HasColumnType("int");
187 |
188 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("studentRequestId"));
189 |
190 | b.Property("Contect")
191 | .HasColumnType("bigint");
192 |
193 | b.Property("StudentEmail")
194 | .IsRequired()
195 | .HasColumnType("nvarchar(max)");
196 |
197 | b.Property("StudentName")
198 | .IsRequired()
199 | .HasColumnType("nvarchar(max)");
200 |
201 | b.Property("standard")
202 | .IsRequired()
203 | .HasColumnType("nvarchar(max)");
204 |
205 | b.HasKey("studentRequestId");
206 |
207 | b.ToTable("studentRequests");
208 | });
209 | #pragma warning restore 612, 618
210 | }
211 | }
212 | }
213 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240912104745_tes.Designer.cs:
--------------------------------------------------------------------------------
1 | //
2 | using Microsoft.EntityFrameworkCore;
3 | using Microsoft.EntityFrameworkCore.Infrastructure;
4 | using Microsoft.EntityFrameworkCore.Metadata;
5 | using Microsoft.EntityFrameworkCore.Migrations;
6 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
7 | using SchoolManagementApi.Context;
8 |
9 | #nullable disable
10 |
11 | namespace SchoolManagementApi.Migrations
12 | {
13 | [DbContext(typeof(ApplicationDbContext))]
14 | [Migration("20240912104745_tes")]
15 | partial class tes
16 | {
17 | ///
18 | protected override void BuildTargetModel(ModelBuilder modelBuilder)
19 | {
20 | #pragma warning disable 612, 618
21 | modelBuilder
22 | .HasAnnotation("ProductVersion", "7.0.0")
23 | .HasAnnotation("Relational:MaxIdentifierLength", 128);
24 |
25 | SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
26 |
27 | modelBuilder.Entity("SchoolManagement.Model.AddLibrarian", b =>
28 | {
29 | b.Property("LibararianId")
30 | .ValueGeneratedOnAdd()
31 | .HasColumnType("int");
32 |
33 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("LibararianId"));
34 |
35 | b.Property("Contact")
36 | .HasColumnType("bigint");
37 |
38 | b.Property("Email")
39 | .IsRequired()
40 | .HasColumnType("nvarchar(max)");
41 |
42 | b.Property("Joindate")
43 | .IsRequired()
44 | .HasColumnType("nvarchar(max)");
45 |
46 | b.Property("LibrarianName")
47 | .IsRequired()
48 | .HasColumnType("nvarchar(max)");
49 |
50 | b.Property("LibrarianUser")
51 | .IsRequired()
52 | .HasColumnType("nvarchar(max)");
53 |
54 | b.Property("Librarianpass")
55 | .IsRequired()
56 | .HasColumnType("nvarchar(max)");
57 |
58 | b.Property("Salary")
59 | .HasColumnType("float");
60 |
61 | b.HasKey("LibararianId");
62 |
63 | b.ToTable("Librarian");
64 | });
65 |
66 | modelBuilder.Entity("SchoolManagement.Model.AddStudent", b =>
67 | {
68 | b.Property("StudentId")
69 | .ValueGeneratedOnAdd()
70 | .HasColumnType("int");
71 |
72 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("StudentId"));
73 |
74 | b.Property("AddMisstiondate")
75 | .IsRequired()
76 | .HasColumnType("nvarchar(max)");
77 |
78 | b.Property("Contect")
79 | .HasColumnType("bigint");
80 |
81 | b.Property("Email")
82 | .IsRequired()
83 | .HasColumnType("nvarchar(max)");
84 |
85 | b.Property("Standard")
86 | .IsRequired()
87 | .HasColumnType("nvarchar(max)");
88 |
89 | b.Property("StudentUser")
90 | .IsRequired()
91 | .HasColumnType("nvarchar(max)");
92 |
93 | b.Property("Studentpass")
94 | .IsRequired()
95 | .HasColumnType("nvarchar(max)");
96 |
97 | b.Property("fullname")
98 | .IsRequired()
99 | .HasColumnType("nvarchar(max)");
100 |
101 | b.HasKey("StudentId");
102 |
103 | b.ToTable("Student");
104 | });
105 |
106 | modelBuilder.Entity("SchoolManagement.Model.Users", b =>
107 | {
108 | b.Property("UserId")
109 | .ValueGeneratedOnAdd()
110 | .HasColumnType("int");
111 |
112 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("UserId"));
113 |
114 | b.Property("Password")
115 | .IsRequired()
116 | .HasColumnType("nvarchar(max)");
117 |
118 | b.Property("Urole")
119 | .IsRequired()
120 | .HasColumnType("nvarchar(max)");
121 |
122 | b.Property("UserName")
123 | .IsRequired()
124 | .HasColumnType("nvarchar(max)");
125 |
126 | b.HasKey("UserId");
127 |
128 | b.ToTable("Users");
129 | });
130 |
131 | modelBuilder.Entity("SchoolManagementApi.Model.AddTeacher", b =>
132 | {
133 | b.Property("TeacherId")
134 | .ValueGeneratedOnAdd()
135 | .HasColumnType("int");
136 |
137 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("TeacherId"));
138 |
139 | b.Property("Contact")
140 | .HasColumnType("bigint");
141 |
142 | b.Property("Joindate")
143 | .IsRequired()
144 | .HasColumnType("nvarchar(max)");
145 |
146 | b.Property("Salary")
147 | .HasColumnType("float");
148 |
149 | b.Property("Standard")
150 | .IsRequired()
151 | .HasColumnType("nvarchar(max)");
152 |
153 | b.Property("Subject")
154 | .IsRequired()
155 | .HasColumnType("nvarchar(max)");
156 |
157 | b.Property("TeacherEmail")
158 | .IsRequired()
159 | .HasColumnType("nvarchar(max)");
160 |
161 | b.Property("TeacherUser")
162 | .IsRequired()
163 | .HasColumnType("nvarchar(max)");
164 |
165 | b.Property("Teacherpass")
166 | .IsRequired()
167 | .HasColumnType("nvarchar(max)");
168 |
169 | b.Property("TecherName")
170 | .IsRequired()
171 | .HasColumnType("nvarchar(max)");
172 |
173 | b.Property("qualification")
174 | .IsRequired()
175 | .HasColumnType("nvarchar(max)");
176 |
177 | b.HasKey("TeacherId");
178 |
179 | b.ToTable("Teachers");
180 | });
181 |
182 | modelBuilder.Entity("SchoolManagementApi.Model.StudentRequest", b =>
183 | {
184 | b.Property("studentRequestId")
185 | .ValueGeneratedOnAdd()
186 | .HasColumnType("int");
187 |
188 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("studentRequestId"));
189 |
190 | b.Property("Contect")
191 | .HasColumnType("bigint");
192 |
193 | b.Property("StudentEmail")
194 | .IsRequired()
195 | .HasColumnType("nvarchar(max)");
196 |
197 | b.Property("StudentName")
198 | .IsRequired()
199 | .HasColumnType("nvarchar(max)");
200 |
201 | b.Property("standard")
202 | .IsRequired()
203 | .HasColumnType("nvarchar(max)");
204 |
205 | b.HasKey("studentRequestId");
206 |
207 | b.ToTable("studentRequests");
208 | });
209 | #pragma warning restore 612, 618
210 | }
211 | }
212 | }
213 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240912105033_t.Designer.cs:
--------------------------------------------------------------------------------
1 | //
2 | using Microsoft.EntityFrameworkCore;
3 | using Microsoft.EntityFrameworkCore.Infrastructure;
4 | using Microsoft.EntityFrameworkCore.Metadata;
5 | using Microsoft.EntityFrameworkCore.Migrations;
6 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
7 | using SchoolManagementApi.Context;
8 |
9 | #nullable disable
10 |
11 | namespace SchoolManagementApi.Migrations
12 | {
13 | [DbContext(typeof(ApplicationDbContext))]
14 | [Migration("20240912105033_t")]
15 | partial class t
16 | {
17 | ///
18 | protected override void BuildTargetModel(ModelBuilder modelBuilder)
19 | {
20 | #pragma warning disable 612, 618
21 | modelBuilder
22 | .HasAnnotation("ProductVersion", "7.0.0")
23 | .HasAnnotation("Relational:MaxIdentifierLength", 128);
24 |
25 | SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
26 |
27 | modelBuilder.Entity("SchoolManagement.Model.AddLibrarian", b =>
28 | {
29 | b.Property("LibararianId")
30 | .ValueGeneratedOnAdd()
31 | .HasColumnType("int");
32 |
33 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("LibararianId"));
34 |
35 | b.Property("Contact")
36 | .HasColumnType("bigint");
37 |
38 | b.Property("Email")
39 | .IsRequired()
40 | .HasColumnType("nvarchar(max)");
41 |
42 | b.Property("Joindate")
43 | .IsRequired()
44 | .HasColumnType("nvarchar(max)");
45 |
46 | b.Property("LibrarianName")
47 | .IsRequired()
48 | .HasColumnType("nvarchar(max)");
49 |
50 | b.Property("LibrarianUser")
51 | .IsRequired()
52 | .HasColumnType("nvarchar(max)");
53 |
54 | b.Property("Librarianpass")
55 | .IsRequired()
56 | .HasColumnType("nvarchar(max)");
57 |
58 | b.Property("Salary")
59 | .HasColumnType("float");
60 |
61 | b.HasKey("LibararianId");
62 |
63 | b.ToTable("Librarian");
64 | });
65 |
66 | modelBuilder.Entity("SchoolManagement.Model.AddStudent", b =>
67 | {
68 | b.Property("StudentId")
69 | .ValueGeneratedOnAdd()
70 | .HasColumnType("int");
71 |
72 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("StudentId"));
73 |
74 | b.Property("AddMisstiondate")
75 | .IsRequired()
76 | .HasColumnType("nvarchar(max)");
77 |
78 | b.Property("Contect")
79 | .HasColumnType("bigint");
80 |
81 | b.Property("Email")
82 | .IsRequired()
83 | .HasColumnType("nvarchar(max)");
84 |
85 | b.Property("Standard")
86 | .IsRequired()
87 | .HasColumnType("nvarchar(max)");
88 |
89 | b.Property("StudentUser")
90 | .IsRequired()
91 | .HasColumnType("nvarchar(max)");
92 |
93 | b.Property("Studentpass")
94 | .IsRequired()
95 | .HasColumnType("nvarchar(max)");
96 |
97 | b.Property("fullname")
98 | .IsRequired()
99 | .HasColumnType("nvarchar(max)");
100 |
101 | b.HasKey("StudentId");
102 |
103 | b.ToTable("Student");
104 | });
105 |
106 | modelBuilder.Entity("SchoolManagement.Model.Users", b =>
107 | {
108 | b.Property("UserId")
109 | .ValueGeneratedOnAdd()
110 | .HasColumnType("int");
111 |
112 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("UserId"));
113 |
114 | b.Property("Password")
115 | .IsRequired()
116 | .HasColumnType("nvarchar(max)");
117 |
118 | b.Property("Urole")
119 | .IsRequired()
120 | .HasColumnType("nvarchar(max)");
121 |
122 | b.Property("UserName")
123 | .IsRequired()
124 | .HasColumnType("nvarchar(max)");
125 |
126 | b.HasKey("UserId");
127 |
128 | b.ToTable("Users");
129 | });
130 |
131 | modelBuilder.Entity("SchoolManagementApi.Model.AddTeacher", b =>
132 | {
133 | b.Property("TeacherId")
134 | .ValueGeneratedOnAdd()
135 | .HasColumnType("int");
136 |
137 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("TeacherId"));
138 |
139 | b.Property("Contact")
140 | .HasColumnType("bigint");
141 |
142 | b.Property("Joindate")
143 | .IsRequired()
144 | .HasColumnType("nvarchar(max)");
145 |
146 | b.Property("Salary")
147 | .HasColumnType("float");
148 |
149 | b.Property("Standard")
150 | .IsRequired()
151 | .HasColumnType("nvarchar(max)");
152 |
153 | b.Property("Subject")
154 | .IsRequired()
155 | .HasColumnType("nvarchar(max)");
156 |
157 | b.Property("TeacherEmail")
158 | .IsRequired()
159 | .HasColumnType("nvarchar(max)");
160 |
161 | b.Property("TeacherUser")
162 | .IsRequired()
163 | .HasColumnType("nvarchar(max)");
164 |
165 | b.Property("Teacherpass")
166 | .IsRequired()
167 | .HasColumnType("nvarchar(max)");
168 |
169 | b.Property("TecherName")
170 | .IsRequired()
171 | .HasColumnType("nvarchar(max)");
172 |
173 | b.Property("qualification")
174 | .IsRequired()
175 | .HasColumnType("nvarchar(max)");
176 |
177 | b.HasKey("TeacherId");
178 |
179 | b.ToTable("Teachers");
180 | });
181 |
182 | modelBuilder.Entity("SchoolManagementApi.Model.StudentRequest", b =>
183 | {
184 | b.Property("studentRequestId")
185 | .ValueGeneratedOnAdd()
186 | .HasColumnType("int");
187 |
188 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("studentRequestId"));
189 |
190 | b.Property("Contect")
191 | .HasColumnType("bigint");
192 |
193 | b.Property("StudentEmail")
194 | .IsRequired()
195 | .HasColumnType("nvarchar(max)");
196 |
197 | b.Property("StudentName")
198 | .IsRequired()
199 | .HasColumnType("nvarchar(max)");
200 |
201 | b.Property("standard")
202 | .IsRequired()
203 | .HasColumnType("nvarchar(max)");
204 |
205 | b.HasKey("studentRequestId");
206 |
207 | b.ToTable("studentRequests");
208 | });
209 |
210 | modelBuilder.Entity("SchoolManagementApi.Model.TeacherLeaveRequest", b =>
211 | {
212 | b.Property("LeaveRequestId")
213 | .ValueGeneratedOnAdd()
214 | .HasColumnType("int");
215 |
216 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("LeaveRequestId"));
217 |
218 | b.Property("EndDate")
219 | .IsRequired()
220 | .HasColumnType("nvarchar(max)");
221 |
222 | b.Property("Reason")
223 | .IsRequired()
224 | .HasColumnType("nvarchar(max)");
225 |
226 | b.Property("StartDate")
227 | .IsRequired()
228 | .HasColumnType("nvarchar(max)");
229 |
230 | b.Property("Status")
231 | .HasMaxLength(50)
232 | .HasColumnType("nvarchar(50)");
233 |
234 | b.Property("Subject")
235 | .IsRequired()
236 | .HasColumnType("nvarchar(max)");
237 |
238 | b.Property("TeacherId")
239 | .HasColumnType("int");
240 |
241 | b.Property("UserName")
242 | .IsRequired()
243 | .HasColumnType("nvarchar(max)");
244 |
245 | b.HasKey("LeaveRequestId");
246 |
247 | b.ToTable("TeacherLeaves");
248 | });
249 | #pragma warning restore 612, 618
250 | }
251 | }
252 | }
253 |
--------------------------------------------------------------------------------
/SchoolManagementApi/Migrations/20240913094726_event.Designer.cs:
--------------------------------------------------------------------------------
1 | //
2 | using System;
3 | using Microsoft.EntityFrameworkCore;
4 | using Microsoft.EntityFrameworkCore.Infrastructure;
5 | using Microsoft.EntityFrameworkCore.Metadata;
6 | using Microsoft.EntityFrameworkCore.Migrations;
7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
8 | using SchoolManagementApi.Context;
9 |
10 | #nullable disable
11 |
12 | namespace SchoolManagementApi.Migrations
13 | {
14 | [DbContext(typeof(ApplicationDbContext))]
15 | [Migration("20240913094726_event")]
16 | partial class @event
17 | {
18 | ///
19 | protected override void BuildTargetModel(ModelBuilder modelBuilder)
20 | {
21 | #pragma warning disable 612, 618
22 | modelBuilder
23 | .HasAnnotation("ProductVersion", "7.0.0")
24 | .HasAnnotation("Relational:MaxIdentifierLength", 128);
25 |
26 | SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
27 |
28 | modelBuilder.Entity("SchoolManagement.Model.AddLibrarian", b =>
29 | {
30 | b.Property("LibararianId")
31 | .ValueGeneratedOnAdd()
32 | .HasColumnType("int");
33 |
34 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("LibararianId"));
35 |
36 | b.Property("Contact")
37 | .HasColumnType("bigint");
38 |
39 | b.Property("Email")
40 | .IsRequired()
41 | .HasColumnType("nvarchar(max)");
42 |
43 | b.Property("Joindate")
44 | .IsRequired()
45 | .HasColumnType("nvarchar(max)");
46 |
47 | b.Property("LibrarianName")
48 | .IsRequired()
49 | .HasColumnType("nvarchar(max)");
50 |
51 | b.Property("LibrarianUser")
52 | .IsRequired()
53 | .HasColumnType("nvarchar(max)");
54 |
55 | b.Property("Librarianpass")
56 | .IsRequired()
57 | .HasColumnType("nvarchar(max)");
58 |
59 | b.Property("Salary")
60 | .HasColumnType("float");
61 |
62 | b.HasKey("LibararianId");
63 |
64 | b.ToTable("Librarian");
65 | });
66 |
67 | modelBuilder.Entity("SchoolManagement.Model.AddStudent", b =>
68 | {
69 | b.Property("StudentId")
70 | .ValueGeneratedOnAdd()
71 | .HasColumnType("int");
72 |
73 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("StudentId"));
74 |
75 | b.Property("AddMisstiondate")
76 | .IsRequired()
77 | .HasColumnType("nvarchar(max)");
78 |
79 | b.Property("Contect")
80 | .HasColumnType("bigint");
81 |
82 | b.Property("Email")
83 | .IsRequired()
84 | .HasColumnType("nvarchar(max)");
85 |
86 | b.Property("Standard")
87 | .IsRequired()
88 | .HasColumnType("nvarchar(max)");
89 |
90 | b.Property("StudentUser")
91 | .IsRequired()
92 | .HasColumnType("nvarchar(max)");
93 |
94 | b.Property("Studentpass")
95 | .IsRequired()
96 | .HasColumnType("nvarchar(max)");
97 |
98 | b.Property("fullname")
99 | .IsRequired()
100 | .HasColumnType("nvarchar(max)");
101 |
102 | b.HasKey("StudentId");
103 |
104 | b.ToTable("Student");
105 | });
106 |
107 | modelBuilder.Entity("SchoolManagement.Model.Users", b =>
108 | {
109 | b.Property("UserId")
110 | .ValueGeneratedOnAdd()
111 | .HasColumnType("int");
112 |
113 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("UserId"));
114 |
115 | b.Property("Password")
116 | .IsRequired()
117 | .HasColumnType("nvarchar(max)");
118 |
119 | b.Property("Urole")
120 | .IsRequired()
121 | .HasColumnType("nvarchar(max)");
122 |
123 | b.Property("UserName")
124 | .IsRequired()
125 | .HasColumnType("nvarchar(max)");
126 |
127 | b.HasKey("UserId");
128 |
129 | b.ToTable("Users");
130 | });
131 |
132 | modelBuilder.Entity("SchoolManagementApi.Model.AddTeacher", b =>
133 | {
134 | b.Property("TeacherId")
135 | .ValueGeneratedOnAdd()
136 | .HasColumnType("int");
137 |
138 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("TeacherId"));
139 |
140 | b.Property("Contact")
141 | .HasColumnType("bigint");
142 |
143 | b.Property("Joindate")
144 | .IsRequired()
145 | .HasColumnType("nvarchar(max)");
146 |
147 | b.Property("Salary")
148 | .HasColumnType("float");
149 |
150 | b.Property("Standard")
151 | .IsRequired()
152 | .HasColumnType("nvarchar(max)");
153 |
154 | b.Property("Subject")
155 | .IsRequired()
156 | .HasColumnType("nvarchar(max)");
157 |
158 | b.Property("TeacherEmail")
159 | .IsRequired()
160 | .HasColumnType("nvarchar(max)");
161 |
162 | b.Property("TeacherUser")
163 | .IsRequired()
164 | .HasColumnType("nvarchar(max)");
165 |
166 | b.Property("Teacherpass")
167 | .IsRequired()
168 | .HasColumnType("nvarchar(max)");
169 |
170 | b.Property("TecherName")
171 | .IsRequired()
172 | .HasColumnType("nvarchar(max)");
173 |
174 | b.Property("qualification")
175 | .IsRequired()
176 | .HasColumnType("nvarchar(max)");
177 |
178 | b.HasKey("TeacherId");
179 |
180 | b.ToTable("Teachers");
181 | });
182 |
183 | modelBuilder.Entity("SchoolManagementApi.Model.Event", b =>
184 | {
185 | b.Property("Id")
186 | .ValueGeneratedOnAdd()
187 | .HasColumnType("int");
188 |
189 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
190 |
191 | b.Property("Description")
192 | .IsRequired()
193 | .HasColumnType("nvarchar(max)");
194 |
195 | b.Property("EndDate")
196 | .HasColumnType("datetime2");
197 |
198 | b.Property("IsAcademic")
199 | .HasColumnType("bit");
200 |
201 | b.Property("StartDate")
202 | .HasColumnType("datetime2");
203 |
204 | b.Property("Title")
205 | .IsRequired()
206 | .HasColumnType("nvarchar(max)");
207 |
208 | b.HasKey("Id");
209 |
210 | b.ToTable("Event");
211 | });
212 |
213 | modelBuilder.Entity("SchoolManagementApi.Model.StudentRequest", b =>
214 | {
215 | b.Property