Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBadawy committed May 11, 2024
1 parent 102edc9 commit f5d9d46
Show file tree
Hide file tree
Showing 47 changed files with 1,663 additions and 338 deletions.
Binary file modified Website/Backend/MyApi/.vs/MyApi/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Website/Backend/MyApi/.vs/MyApi/v17/.suo
Binary file not shown.

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions Website/Backend/MyApi/Core/Migrations/20240511214548_init11.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Core.Migrations
{
public partial class init11 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "SubTitle",
table: "Cources",
type: "nvarchar(max)",
nullable: true);
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SubTitle",
table: "Cources");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.IsRequired()
.HasColumnType("nvarchar(max)");

b.Property<string>("SubTitle")
.HasColumnType("nvarchar(max)");

b.Property<string>("Title")
.IsRequired()
.HasColumnType("nvarchar(max)");
Expand Down
Binary file modified Website/Backend/MyApi/Core/bin/Debug/net6.0/Core.dll
Binary file not shown.
Binary file modified Website/Backend/MyApi/Core/bin/Debug/net6.0/Core.pdb
Binary file not shown.
1 change: 1 addition & 0 deletions Website/Backend/MyApi/Core/entities/Cource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class Cource:BaseEntity
public int Id { get; set; }
public string ImageUrl { get; set; }
public string Title { get; set; }
public string ?SubTitle { get; set; }
public string Description { get; set; }
public string LogoUrl { get; set; }
public int type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6b87d4d91a45bb22c4a3585620edf0302d8ea41d
a2e6ae1ed0ad454072d2432befef1e14ea93dbef
Binary file modified Website/Backend/MyApi/Core/obj/Debug/net6.0/Core.dll
Binary file not shown.
Binary file modified Website/Backend/MyApi/Core/obj/Debug/net6.0/Core.pdb
Binary file not shown.
Binary file modified Website/Backend/MyApi/Core/obj/Debug/net6.0/ref/Core.dll
Binary file not shown.
Binary file modified Website/Backend/MyApi/Core/obj/Debug/net6.0/refint/Core.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ public IActionResult GetNotifications()
if (user == null)
return Unauthorized();

var notifications = unit.UserNotification.GetAll().Where(e => e.ReceiverUserName == userName);
var notifications = unit.Notification.GetByUserName(userName).
Select(x => new
{
NotificationId = x.Id,
NotificationDescription = x.Notification.description,
NotificationCreationDate = x.Notification.CreationDate,
IsRead = x.IsRead,
NotificationPublisher = x.ReceiverUserName

}) ;
return Ok(notifications);

}
Expand Down
2 changes: 1 addition & 1 deletion Website/Backend/MyApi/MyApi/Controllers/TaskController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public IActionResult Create([FromForm] TaskDTO taskDTO)
{
publiserUsername = userName,
CreationDate = System.DateTime.Now,
description = $"{US.User.FirstName} has added a new Task in Group {US.Cource.Title}",
description = $"{US.User.FirstName} has added a new announcement in {US.Cource.Title} cource",
};
unitOfCode.Notification.add(notification);
var UserNotifications=unitOfCode.UserGroup.GetAll().Where(x => x.CourceId == taskDTO.CourceId && x.Username!=userName).Select(x => new UserNotification()
Expand Down
2 changes: 1 addition & 1 deletion Website/Backend/MyApi/MyApi/Controllers/TopicController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public IActionResult AddMaterial([FromForm] NewMaterialDTO newMaterialDTO)
{
CreationDate = DateTime.Now,
publiserUsername = username,
description=$"{US.User.FirstName} has added a new material in {topic.Title} in {topic.Cource.Title}"
description = $"{US.User.FirstName} has added a new announcement in {US.Cource.Title} cource"
};
unit.Notification.add(notification);
var UN = unit.UserGroup.GetAll().Where(x => x.CourceId == US.CourceId && x.Username != username).Select(x => new UserNotification()
Expand Down
10 changes: 5 additions & 5 deletions Website/Backend/MyApi/MyApi/DTO/Mapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public static Cource CourceDTO2Cource(CourceDTO courceDTO)
{
var cource = new Cource();
cource.Id = courceDTO.Id;
cource.Title = courceDTO.Title +'@'+courceDTO.SubTitle;
cource.Title = courceDTO.Title ;
cource.SubTitle = courceDTO.SubTitle;
cource.Description = courceDTO.Description;
cource.ImageUrl = DocumentServices.Uploadfile(courceDTO.Image);
cource.LogoUrl = DocumentServices.Uploadfile(courceDTO.Logo);
Expand All @@ -51,10 +52,9 @@ public static CourceInfoDTO Cource2CourceInfoDTO(Cource cource)
{
var CourceInfo = new CourceInfoDTO();
CourceInfo.Id = cource.Id;
var titles = cource.Title.Split('@');
titles.Append("");
CourceInfo.Title = titles[0];
CourceInfo.SubTitle = titles[1];

CourceInfo.Title = cource.Title;
CourceInfo.SubTitle = cource.SubTitle;
CourceInfo.Description = cource.Description;
CourceInfo.Image = cource.ImageUrl;
CourceInfo.Logo = cource.LogoUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace MyApi.Model.Interfaces
{
public interface INotification: IGeneric<Notification>
{
public List<UserNotification> GetByUserName(string username);

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Core.Context;
using Microsoft.EntityFrameworkCore;
using MyApi.Model.Interfaces;

namespace MyApi.Model.Repositories
Expand All @@ -12,6 +13,10 @@ public Notification(Connector context) : base(context)
this.context = context;
}


public List<Core.entities.UserNotification> GetByUserName(string username)
{
var notes = context.UserNotifications.Where(e => e.ReceiverUserName==username).Include(e => e.ReceiverUser).Include(e => e.Notification).ToList();
return notes;
}
}
}
Binary file modified Website/Backend/MyApi/MyApi/bin/Debug/net6.0/Core.dll
Binary file not shown.
Binary file modified Website/Backend/MyApi/MyApi/bin/Debug/net6.0/Core.pdb
Binary file not shown.
Binary file modified Website/Backend/MyApi/MyApi/bin/Debug/net6.0/MyApi.dll
Binary file not shown.
Binary file modified Website/Backend/MyApi/MyApi/bin/Debug/net6.0/MyApi.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"ContentRoots":["E:\\Computer science\\Level 3 - second term\\Software development\\Dof3aa\\Website\\Backend\\MyApi\\MyApi\\wwwroot\\"],"Root":{"Children":{"97086ca2-90d3-489e-bfb9-c9f88ae0a8c27f822556-498d-4bc3-9d6b-0f17a1d490fd.jfif":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"97086ca2-90d3-489e-bfb9-c9f88ae0a8c27f822556-498d-4bc3-9d6b-0f17a1d490fd.jfif"},"Patterns":null},"html":{"Children":{"login.html":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"html/login.html"},"Patterns":null}},"Asset":null,"Patterns":null}},"Asset":null,"Patterns":[{"ContentRootIndex":0,"Pattern":"**","Depth":0}]}}
{"ContentRoots":["E:\\Computer science\\Level 3 - second term\\Software development\\Dof3aa\\Website\\Backend\\MyApi\\MyApi\\wwwroot\\"],"Root":{"Children":{"39b70c38-8976-4666-b557-3433b72bf08cbanner (3).png":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"39b70c38-8976-4666-b557-3433b72bf08cbanner (3).png"},"Patterns":null},"69c50645-f95a-474c-af33-97e2efd7a250image.png":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"69c50645-f95a-474c-af33-97e2efd7a250image.png"},"Patterns":null},"6d168654-8dc8-4686-a599-beb3a937097ebanner (4).png":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"6d168654-8dc8-4686-a599-beb3a937097ebanner (4).png"},"Patterns":null},"74f02c35-a135-47b7-977c-bcf2b08e11f8banner (1).png":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"74f02c35-a135-47b7-977c-bcf2b08e11f8banner (1).png"},"Patterns":null},"76cc31f9-bc3e-4903-891b-93011ecf3a91404.png":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"76cc31f9-bc3e-4903-891b-93011ecf3a91404.png"},"Patterns":null},"97086ca2-90d3-489e-bfb9-c9f88ae0a8c27f822556-498d-4bc3-9d6b-0f17a1d490fd.jfif":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"97086ca2-90d3-489e-bfb9-c9f88ae0a8c27f822556-498d-4bc3-9d6b-0f17a1d490fd.jfif"},"Patterns":null},"a21924b3-254b-47c1-9c48-242c3aadd445banner (2).png":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"a21924b3-254b-47c1-9c48-242c3aadd445banner (2).png"},"Patterns":null},"b43399be-a38d-42be-aa00-267c5d8d1461image.png":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"b43399be-a38d-42be-aa00-267c5d8d1461image.png"},"Patterns":null},"b72ba046-11cb-4ded-86ce-7802d848a689banner (4).png":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"b72ba046-11cb-4ded-86ce-7802d848a689banner (4).png"},"Patterns":null},"db05e6ed-62b4-4882-925e-046730ae3840banner (4).png":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"db05e6ed-62b4-4882-925e-046730ae3840banner (4).png"},"Patterns":null},"dc34f39d-2559-4f5f-a9df-f2666aa6ed9dbanner (4).png":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"dc34f39d-2559-4f5f-a9df-f2666aa6ed9dbanner (4).png"},"Patterns":null},"de607e13-abcc-4aff-9d8c-c7c61cb1e799404.png":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"de607e13-abcc-4aff-9d8c-c7c61cb1e799404.png"},"Patterns":null},"ee2b9a50-e6be-4f08-a4b9-16cdac66aa25Artboard 1.png":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"ee2b9a50-e6be-4f08-a4b9-16cdac66aa25Artboard 1.png"},"Patterns":null},"f8231187-bb12-442a-933c-771d554eadd2image.png":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"f8231187-bb12-442a-933c-771d554eadd2image.png"},"Patterns":null},"fb8af7ff-27f6-4e69-90db-ce9aa282345dbanner (4).png":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"fb8af7ff-27f6-4e69-90db-ce9aa282345dbanner (4).png"},"Patterns":null},"html":{"Children":{"login.html":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"html/login.html"},"Patterns":null}},"Asset":null,"Patterns":null}},"Asset":null,"Patterns":[{"ContentRootIndex":0,"Pattern":"**","Depth":0}]}}
Binary file not shown.
Binary file modified Website/Backend/MyApi/MyApi/obj/Debug/net6.0/MyApi.dll
Binary file not shown.
Binary file modified Website/Backend/MyApi/MyApi/obj/Debug/net6.0/MyApi.pdb
Binary file not shown.
Binary file modified Website/Backend/MyApi/MyApi/obj/Debug/net6.0/ref/MyApi.dll
Binary file not shown.
Binary file modified Website/Backend/MyApi/MyApi/obj/Debug/net6.0/refint/MyApi.dll
Binary file not shown.
Loading

0 comments on commit f5d9d46

Please sign in to comment.