Compare commits

...

2 Commits

Author SHA1 Message Date
79753c33d3 Reset Migation Files 2025-03-26 11:20:48 +05:30
0ea14ff112 Push user rights branh 2025-03-25 13:01:56 +05:30
112 changed files with 3276 additions and 31185 deletions

View File

@ -4,7 +4,7 @@ using Marco.Pms.Model.Authentication;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Projects;
using MarcoBMS.Utility;
using Marco.Pms.Utility;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
@ -300,19 +300,19 @@ namespace Marco.Pms.DataAccess.Data
Id = 1,
Name = "Project",
Description = "Project Module",
Key = Guid.NewGuid().ToString()
Key = "b04da7e9-0406-409c-ac7f-b97256e6ea02"
}, new Module
{
Id = 2,
Name = "Employee",
Description = "Employee Module",
Key = Guid.NewGuid().ToString()
Key = "0971c7fb-6ce1-458a-ae3f-8d3205893637"
}, new Module
{
Id = 3,
Name = "Masters",
Description = "Masters Module",
Key = Guid.NewGuid().ToString()
Key = "504ec132-e6a9-422f-8f85-050602cfce05"
});

View File

@ -1,15 +1,10 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Activities;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Projects;
using Marco.Pms.Model.ViewModels;
using MarcoBMS.Utility;
using Marco.Pms.Utility;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using System.Text.Json;
namespace Marco.Pms.DataAccess.Initializer
{
@ -19,14 +14,14 @@ namespace Marco.Pms.DataAccess.Initializer
private readonly ApplicationDbContext _db;
private readonly UserManager<IdentityUser> _userManager;
private readonly RoleManager<IdentityRole> _roleManager;
private readonly IUnitOfWork _unitOfWork;
//private readonly IUnitOfWork _unitOfWork;
public DBInitializer(UserManager<IdentityUser> userManager, RoleManager<IdentityRole> roleManager, ApplicationDbContext db, IUnitOfWork unitOfWork)
public DBInitializer(UserManager<IdentityUser> userManager, RoleManager<IdentityRole> roleManager, ApplicationDbContext db)
{
_userManager = userManager;
_roleManager = roleManager;
_db = db;
_unitOfWork = unitOfWork;
//_unitOfWork = unitOfWork;
}
public void Initialize()

View File

@ -7,9 +7,9 @@
</PropertyGroup>
<ItemGroup>
<Compile Remove="Repository\IRepository\**" />
<EmbeddedResource Remove="Repository\IRepository\**" />
<None Remove="Repository\IRepository\**" />
<Compile Remove="Repository\**" />
<EmbeddedResource Remove="Repository\**" />
<None Remove="Repository\**" />
</ItemGroup>
<ItemGroup>
@ -19,26 +19,6 @@
<Compile Remove="Migrations\20240927100058_AddModels.Designer.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="Repository\IRepository\IApplicationUserRepository.cs" />
<Compile Include="Repository\IRepository\IApplicationRolesRepository.cs" />
<Compile Include="Repository\IRepository\IFeatureRepository.cs" />
<Compile Include="Repository\IRepository\ITaskAllocationRepository.cs" />
<Compile Include="Repository\IRepository\IAttendenceRepository.cs" />
<Compile Include="Repository\IRepository\IEmployeeRepository.cs" />
<Compile Include="Repository\IRepository\IBuildingRepository.cs" />
<Compile Include="Repository\IRepository\IFloorRepository.cs" />
<Compile Include="Repository\IRepository\IActivityMasterRepository.cs" />
<Compile Include="Repository\IRepository\IProjectAllocationRepository.cs" />
<Compile Include="Repository\IRepository\IStatusRepository.cs" />
<Compile Include="Repository\IRepository\IWorkAreaRepository.cs" />
<Compile Include="Repository\IRepository\IWorkItemMappingReposiotry.cs" />
<Compile Include="Repository\IRepository\IWorkItemRepository.cs" />
<Compile Include="Repository\IRepository\IProjectRepository.cs" />
<Compile Include="Repository\IRepository\IRepository.cs" />
<Compile Include="Repository\IRepository\IUnitOfWork.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Marco.Pms.Model\Marco.Pms.Model.csproj" />
<ProjectReference Include="..\Marco.Pms.Utility\Marco.Pms.Utility.csproj" />
@ -52,4 +32,8 @@
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,278 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class role : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Feature_Tenants_TenantId",
table: "Feature");
migrationBuilder.DropForeignKey(
name: "FK_FeaturePermission_EmployeeRoles_RoleId",
table: "FeaturePermission");
migrationBuilder.DropForeignKey(
name: "FK_FeaturePermission_Feature_FeatureId",
table: "FeaturePermission");
migrationBuilder.DropForeignKey(
name: "FK_FeaturePermission_Tenants_TenantId",
table: "FeaturePermission");
migrationBuilder.DropIndex(
name: "IX_FeaturePermission_RoleId",
table: "FeaturePermission");
migrationBuilder.DropIndex(
name: "IX_FeaturePermission_TenantId",
table: "FeaturePermission");
migrationBuilder.DropPrimaryKey(
name: "PK_Feature",
table: "Feature");
migrationBuilder.DropColumn(
name: "RoleId",
table: "FeaturePermission");
migrationBuilder.RenameTable(
name: "Feature",
newName: "Features");
migrationBuilder.RenameIndex(
name: "IX_Feature_TenantId",
table: "Features",
newName: "IX_Features_TenantId");
migrationBuilder.AddColumn<bool>(
name: "AllowCreate",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "AllowDelete",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "AllowModify",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "AllowView",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "Description",
table: "EmployeeRoles",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<Guid>(
name: "EmployeeRoleId",
table: "Features",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddPrimaryKey(
name: "PK_Features",
table: "Features",
column: "Id");
migrationBuilder.UpdateData(
table: "EmployeeRoles",
keyColumn: "Id",
keyValue: new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"),
column: "Description",
value: "");
migrationBuilder.UpdateData(
table: "EmployeeRoles",
keyColumn: "Id",
keyValue: new Guid("62e0918d-c421-11ef-9b93-0242ac110002"),
column: "Description",
value: "");
migrationBuilder.UpdateData(
table: "EmployeeRoles",
keyColumn: "Id",
keyValue: new Guid("68823f1f-c421-11ef-9b93-0242ac110002"),
column: "Description",
value: "");
migrationBuilder.UpdateData(
table: "EmployeeRoles",
keyColumn: "Id",
keyValue: new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"),
column: "Description",
value: "");
migrationBuilder.UpdateData(
table: "EmployeeRoles",
keyColumn: "Id",
keyValue: new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"),
column: "Description",
value: "");
migrationBuilder.CreateIndex(
name: "IX_Features_EmployeeRoleId",
table: "Features",
column: "EmployeeRoleId");
migrationBuilder.AddForeignKey(
name: "FK_FeaturePermission_Features_FeatureId",
table: "FeaturePermission",
column: "FeatureId",
principalTable: "Features",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Features_EmployeeRoles_EmployeeRoleId",
table: "Features",
column: "EmployeeRoleId",
principalTable: "EmployeeRoles",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Features_Tenants_TenantId",
table: "Features",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_FeaturePermission_Features_FeatureId",
table: "FeaturePermission");
migrationBuilder.DropForeignKey(
name: "FK_Features_EmployeeRoles_EmployeeRoleId",
table: "Features");
migrationBuilder.DropForeignKey(
name: "FK_Features_Tenants_TenantId",
table: "Features");
migrationBuilder.DropPrimaryKey(
name: "PK_Features",
table: "Features");
migrationBuilder.DropIndex(
name: "IX_Features_EmployeeRoleId",
table: "Features");
migrationBuilder.DropColumn(
name: "AllowCreate",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "AllowDelete",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "AllowModify",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "AllowView",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "Description",
table: "EmployeeRoles");
migrationBuilder.DropColumn(
name: "EmployeeRoleId",
table: "Features");
migrationBuilder.RenameTable(
name: "Features",
newName: "Feature");
migrationBuilder.RenameIndex(
name: "IX_Features_TenantId",
table: "Feature",
newName: "IX_Feature_TenantId");
migrationBuilder.AddColumn<Guid>(
name: "RoleId",
table: "FeaturePermission",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.AddPrimaryKey(
name: "PK_Feature",
table: "Feature",
column: "Id");
migrationBuilder.CreateIndex(
name: "IX_FeaturePermission_RoleId",
table: "FeaturePermission",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_FeaturePermission_TenantId",
table: "FeaturePermission",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_Feature_Tenants_TenantId",
table: "Feature",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_FeaturePermission_EmployeeRoles_RoleId",
table: "FeaturePermission",
column: "RoleId",
principalTable: "EmployeeRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_FeaturePermission_Feature_FeatureId",
table: "FeaturePermission",
column: "FeatureId",
principalTable: "Feature",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_FeaturePermission_Tenants_TenantId",
table: "FeaturePermission",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,416 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class addFeatures : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_FeaturePermission_Features_FeatureId",
table: "FeaturePermission");
migrationBuilder.DropForeignKey(
name: "FK_Features_Tenants_TenantId",
table: "Features");
migrationBuilder.DropPrimaryKey(
name: "PK_FeaturePermission",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "AllowCreate",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "AllowDelete",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "AllowModify",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "AllowView",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "TenantId",
table: "FeaturePermission");
migrationBuilder.RenameTable(
name: "FeaturePermission",
newName: "FeaturePermissions");
migrationBuilder.RenameColumn(
name: "TenantId",
table: "Features",
newName: "ModuleId");
migrationBuilder.RenameIndex(
name: "IX_Features_TenantId",
table: "Features",
newName: "IX_Features_ModuleId");
migrationBuilder.RenameIndex(
name: "IX_FeaturePermission_FeatureId",
table: "FeaturePermissions",
newName: "IX_FeaturePermissions_FeatureId");
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "Features",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "Description",
table: "FeaturePermissions",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Name",
table: "FeaturePermissions",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddPrimaryKey(
name: "PK_FeaturePermissions",
table: "FeaturePermissions",
column: "Id");
migrationBuilder.CreateTable(
name: "Modules",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Key = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Modules", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "Modules",
columns: new[] { "Id", "Description", "Key", "Name" },
values: new object[,]
{
{ 1, "Project Module", "9a7ed07c-f7dd-4831-bf64-d5278fa9e38c", "Project" },
{ 2, "Employee Module", "a9fb08bf-7dae-4282-9b02-f63d94d7a9dc", "Employee" },
{ 3, "Masters Module", "e6423995-d7bf-452e-8bcc-780a655b015c", "Masters" }
});
migrationBuilder.InsertData(
table: "Features",
columns: new[] { "Id", "Description", "EmployeeRoleId", "IsActive", "ModuleId", "Name" },
values: new object[,]
{
{ new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), "Assign and Update Tasks Progress", null, true, 1, "Assign and Update Tasks Progress" },
{ new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), "Attendance", null, true, 2, "Attendance" },
{ new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), "Manage Project", null, true, 1, "Manage Project" },
{ new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), "Tenant Masters", null, true, 3, "Tenant Masters" },
{ new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), "Manage Employee", null, true, 2, "Manage Employee" },
{ new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), "Manage Infra", null, true, 1, "Manage Infra" },
{ new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), "Manage Tasks", null, true, 1, "Manage Tasks" },
{ new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), "Global Masters", null, true, 3, "Global Masters" }
});
migrationBuilder.InsertData(
table: "FeaturePermissions",
columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" },
values: new object[,]
{
{ new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), "", new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), true, "Manage Task" },
{ new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "Manage Project" },
{ new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), "", new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), true, "Regularize Attendance" },
{ new Guid("588a8824-f924-4955-82d8-fc51956cf323"), "", new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), true, "Manage Masters" },
{ new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), "", new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), true, "View Masters" },
{ new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), "", new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), true, "Manage Masters" },
{ new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "View Project" },
{ new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), "", new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), true, "Perform Attendance " },
{ new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), "", new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), true, "View Task" },
{ new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Manage Employee" },
{ new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "View Employee" },
{ new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "Manage Team" },
{ new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), "", new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), true, "View Project Infra" },
{ new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), "", new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), true, "View Masters" },
{ new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Assign Task and Report Progress" },
{ new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Approve Task" },
{ new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), "", new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), true, "Manage Project Infra" },
{ new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Assign To Project" }
});
migrationBuilder.AddForeignKey(
name: "FK_FeaturePermissions_Features_FeatureId",
table: "FeaturePermissions",
column: "FeatureId",
principalTable: "Features",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Features_Modules_ModuleId",
table: "Features",
column: "ModuleId",
principalTable: "Modules",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_FeaturePermissions_Features_FeatureId",
table: "FeaturePermissions");
migrationBuilder.DropForeignKey(
name: "FK_Features_Modules_ModuleId",
table: "Features");
migrationBuilder.DropTable(
name: "Modules");
migrationBuilder.DropPrimaryKey(
name: "PK_FeaturePermissions",
table: "FeaturePermissions");
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("588a8824-f924-4955-82d8-fc51956cf323"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("a97d366a-c2bb-448d-be93-402bd2324566"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("f2aee20a-b754-4537-8166-f9507b44585b"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"));
migrationBuilder.DropColumn(
name: "IsActive",
table: "Features");
migrationBuilder.DropColumn(
name: "Description",
table: "FeaturePermissions");
migrationBuilder.DropColumn(
name: "Name",
table: "FeaturePermissions");
migrationBuilder.RenameTable(
name: "FeaturePermissions",
newName: "FeaturePermission");
migrationBuilder.RenameColumn(
name: "ModuleId",
table: "Features",
newName: "TenantId");
migrationBuilder.RenameIndex(
name: "IX_Features_ModuleId",
table: "Features",
newName: "IX_Features_TenantId");
migrationBuilder.RenameIndex(
name: "IX_FeaturePermissions_FeatureId",
table: "FeaturePermission",
newName: "IX_FeaturePermission_FeatureId");
migrationBuilder.AddColumn<bool>(
name: "AllowCreate",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "AllowDelete",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "AllowModify",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "AllowView",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>(
name: "TenantId",
table: "FeaturePermission",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddPrimaryKey(
name: "PK_FeaturePermission",
table: "FeaturePermission",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_FeaturePermission_Features_FeatureId",
table: "FeaturePermission",
column: "FeatureId",
principalTable: "Features",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Features_Tenants_TenantId",
table: "Features",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,60 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class featuremapping : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "73f5248b-c0d7-49de-a045-3617339c94cd");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "35fd0032-dfb1-44a4-931c-b9417ec406e7");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "adccb225-5824-4b96-96f8-d28143c42475");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "9a7ed07c-f7dd-4831-bf64-d5278fa9e38c");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "a9fb08bf-7dae-4282-9b02-f63d94d7a9dc");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "e6423995-d7bf-452e-8bcc-780a655b015c");
}
}
}

View File

@ -1,73 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class NoNavigationMigration : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
//migrationBuilder.AddColumn<Guid>(
// name: "RoleId",
// table: "Employees",
// type: "char(36)",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
// collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "b29e3352-d83f-42eb-9c57-6e2cbf1b7c9b");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "d522bcb3-6965-4c2f-be14-dd18b3181a34");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "77302f42-93ec-49eb-9e05-80b80939639a");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
//migrationBuilder.DropColumn(
// name: "RoleId",
// table: "Employees");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "03f97e79-e7ff-412b-91b4-19b71325f00c");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "2351d591-bdd5-4eb5-a375-125c8cfdcf29");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "bedbed6b-8ea5-4bd2-a37c-d5454d0dd280");
}
}
}

View File

@ -1,89 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class updatefeaturesmaster : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"),
column: "FeatureId",
value: new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"));
migrationBuilder.UpdateData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"),
column: "FeatureId",
value: new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"));
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "b0aa1d10-7b8a-40f1-96b3-219e8de89ccb");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "19101abd-012e-4809-b153-da6bdbca0d7a");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "0cb9a301-edf2-4a15-8eeb-5bfea0ad4d90");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"),
column: "FeatureId",
value: new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"));
migrationBuilder.UpdateData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"),
column: "FeatureId",
value: new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"));
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "b29e3352-d83f-42eb-9c57-6e2cbf1b7c9b");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "d522bcb3-6965-4c2f-be14-dd18b3181a34");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "77302f42-93ec-49eb-9e05-80b80939639a");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,65 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class mapping : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "eec3cf92-01c2-41a2-bfc1-f3c2af318848");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "6a22bf2f-e8f0-4164-aedc-307b370b4ef6");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "69a68bf1-30e7-45fc-ab75-0c11ea10bfc3");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "b0aa1d10-7b8a-40f1-96b3-219e8de89ccb");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "19101abd-012e-4809-b153-da6bdbca0d7a");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "0cb9a301-edf2-4a15-8eeb-5bfea0ad4d90");
}
}
}

View File

@ -1,139 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class RolePermissionMappings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ApplicationRoles",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Role = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ApplicationRoles", x => x.Id);
table.ForeignKey(
name: "FK_ApplicationRoles_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RolePermissionMappings",
columns: table => new
{
ApplicationRoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FeaturePermissionId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_RolePermissionMappings", x => new { x.ApplicationRoleId, x.FeaturePermissionId });
table.ForeignKey(
name: "FK_RolePermissionMappings_ApplicationRoles_ApplicationRoleId",
column: x => x.ApplicationRoleId,
principalTable: "ApplicationRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RolePermissionMappings_FeaturePermissions_FeaturePermissionId",
column: x => x.FeaturePermissionId,
principalTable: "FeaturePermissions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "ApplicationRoles",
columns: new[] { "Id", "Description", "Role", "TenantId" },
values: new object[,]
{
{ new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), "", "Admin", 1 },
{ new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), "", "Welder", 1 },
{ new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), "", "Helper", 1 },
{ new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), "", "Site Engineer", 1 },
{ new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), "", "Project Manager", 1 }
});
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "286516c2-0d55-439c-a8fa-b6858735ef65");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "6a84b9c0-1478-4d87-9ef6-34c00f0fca4a");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "c38971e1-491e-479f-9d02-54634c0b4908");
migrationBuilder.CreateIndex(
name: "IX_ApplicationRoles_TenantId",
table: "ApplicationRoles",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_RolePermissionMappings_FeaturePermissionId",
table: "RolePermissionMappings",
column: "FeaturePermissionId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RolePermissionMappings");
migrationBuilder.DropTable(
name: "ApplicationRoles");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "235d7bb6-9fae-4cdc-bc62-2426059cd49e");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "e60119bf-48b1-4534-82ae-88d23ae46f15");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "9090b0dd-7a3c-46f7-82e5-816eb6c416d2");
}
}
}

View File

@ -1,113 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class EmployeeRolesMapping : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "EmployeeRoleMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
EmployeeId = table.Column<int>(type: "int", nullable: false),
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EmployeeRoleMappings", x => x.Id);
table.ForeignKey(
name: "FK_EmployeeRoleMappings_ApplicationRoles_RoleId",
column: x => x.RoleId,
principalTable: "ApplicationRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_EmployeeRoleMappings_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_EmployeeRoleMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "05db8d60-e977-40f6-b944-8602d0d4cb98");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "456ddbbe-0963-406d-8874-589a546c3670");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "19eca67f-c3b1-4e5c-8d95-c8341cf058ae");
migrationBuilder.CreateIndex(
name: "IX_EmployeeRoleMappings_EmployeeId",
table: "EmployeeRoleMappings",
column: "EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_EmployeeRoleMappings_RoleId",
table: "EmployeeRoleMappings",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_EmployeeRoleMappings_TenantId",
table: "EmployeeRoleMappings",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "EmployeeRoleMappings");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "286516c2-0d55-439c-a8fa-b6858735ef65");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "6a84b9c0-1478-4d87-9ef6-34c00f0fca4a");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "c38971e1-491e-479f-9d02-54634c0b4908");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,136 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class addjobrole : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "RoleId",
table: "Employees");
migrationBuilder.AddColumn<int>(
name: "JobRoleId",
table: "Employees",
type: "int",
nullable: true);
migrationBuilder.CreateTable(
name: "JobRoles",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_JobRoles", x => x.Id);
table.ForeignKey(
name: "FK_JobRoles_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "ad9fb730-b80a-446c-bf49-bf41f90e0c0b");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "bc153ba8-7f38-4b91-97d5-1deb230250a9");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "44e296ca-5597-44c9-9159-b481c941f902");
migrationBuilder.CreateIndex(
name: "IX_Employees_JobRoleId",
table: "Employees",
column: "JobRoleId");
migrationBuilder.CreateIndex(
name: "IX_JobRoles_TenantId",
table: "JobRoles",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_Employees_JobRoles_JobRoleId",
table: "Employees",
column: "JobRoleId",
principalTable: "JobRoles",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Employees_JobRoles_JobRoleId",
table: "Employees");
migrationBuilder.DropTable(
name: "JobRoles");
migrationBuilder.DropIndex(
name: "IX_Employees_JobRoleId",
table: "Employees");
migrationBuilder.DropColumn(
name: "JobRoleId",
table: "Employees");
migrationBuilder.AddColumn<Guid>(
name: "RoleId",
table: "Employees",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "05db8d60-e977-40f6-b944-8602d0d4cb98");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "456ddbbe-0963-406d-8874-589a546c3670");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "19eca67f-c3b1-4e5c-8d95-c8341cf058ae");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,136 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class CreateJobRoles : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
//migrationBuilder.DropColumn(
// name: "RoleId",
// table: "Employees");
migrationBuilder.AddColumn<int>(
name: "JobRoleId",
table: "Employees",
type: "int",
nullable: true);
migrationBuilder.CreateTable(
name: "JobRoles",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_JobRoles", x => x.Id);
table.ForeignKey(
name: "FK_JobRoles_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "331a7bea-688e-4f27-8dba-697d9cd29870");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "ba873fd2-277b-4baa-88b9-22b69010ffa8");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "aa481e97-9a9b-4b1e-b9dd-0a6ce26dab47");
migrationBuilder.CreateIndex(
name: "IX_Employees_JobRoleId",
table: "Employees",
column: "JobRoleId");
migrationBuilder.CreateIndex(
name: "IX_JobRoles_TenantId",
table: "JobRoles",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_Employees_JobRoles_JobRoleId",
table: "Employees",
column: "JobRoleId",
principalTable: "JobRoles",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Employees_JobRoles_JobRoleId",
table: "Employees");
migrationBuilder.DropTable(
name: "JobRoles");
migrationBuilder.DropIndex(
name: "IX_Employees_JobRoleId",
table: "Employees");
migrationBuilder.DropColumn(
name: "JobRoleId",
table: "Employees");
migrationBuilder.AddColumn<Guid>(
name: "RoleId",
table: "Employees",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "05db8d60-e977-40f6-b944-8602d0d4cb98");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "456ddbbe-0963-406d-8874-589a546c3670");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "19eca67f-c3b1-4e5c-8d95-c8341cf058ae");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,208 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class attendancemodule : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AttendanceLogs");
migrationBuilder.CreateTable(
name: "AttendLogs",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
AttendanceId = table.Column<int>(type: "int", nullable: false),
EmployeeID = table.Column<int>(type: "int", nullable: false),
ActivityTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Activity = table.Column<int>(type: "int", nullable: false),
Photo = table.Column<byte[]>(type: "longblob", nullable: true),
Latitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Longitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedBy = table.Column<int>(type: "int", nullable: true),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AttendLogs", x => x.Id);
table.ForeignKey(
name: "FK_AttendLogs_Attendances_AttendanceId",
column: x => x.AttendanceId,
principalTable: "Attendances",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendLogs_Employees_EmployeeID",
column: x => x.EmployeeID,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendLogs_Employees_UpdatedBy",
column: x => x.UpdatedBy,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AttendLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "04db13e4-201a-44ba-9d9a-6c07f91d3cd0");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "72e2c008-c3f1-4dd8-a6ed-19c9eec3d892");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "0a8eda0f-39b8-4efe-98af-5c6f2a7cd5cf");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_AttendanceId",
table: "AttendLogs",
column: "AttendanceId");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_EmployeeID",
table: "AttendLogs",
column: "EmployeeID");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_TenantId",
table: "AttendLogs",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_UpdatedBy",
table: "AttendLogs",
column: "UpdatedBy");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AttendLogs");
migrationBuilder.CreateTable(
name: "AttendanceLogs",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
AttendanceId = table.Column<int>(type: "int", nullable: false),
EmployeeID = table.Column<int>(type: "int", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false),
UpdatedBy = table.Column<int>(type: "int", nullable: true),
Activity = table.Column<int>(type: "int", nullable: false),
ActivityTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Latitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Longitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Photo = table.Column<byte[]>(type: "longblob", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AttendanceLogs", x => x.Id);
table.ForeignKey(
name: "FK_AttendanceLogs_Attendances_AttendanceId",
column: x => x.AttendanceId,
principalTable: "Attendances",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendanceLogs_Employees_EmployeeID",
column: x => x.EmployeeID,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendanceLogs_Employees_UpdatedBy",
column: x => x.UpdatedBy,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AttendanceLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "9a70d253-1f44-411c-899a-718c344c1aea");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "aff7e2a1-8b98-49ca-a73e-b342a4d7ef90");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "dc33f0de-5730-40b0-b52b-c61ea0176c03");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_EmployeeID",
table: "AttendanceLogs",
column: "EmployeeID");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_TenantId",
table: "AttendanceLogs",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_UpdatedBy",
table: "AttendanceLogs",
column: "UpdatedBy");
}
}
}

View File

@ -1,208 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class renameattendancelogs : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AttendLogs");
migrationBuilder.CreateTable(
name: "AttendanceLogs",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
AttendanceId = table.Column<int>(type: "int", nullable: false),
EmployeeID = table.Column<int>(type: "int", nullable: false),
ActivityTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Activity = table.Column<int>(type: "int", nullable: false),
Photo = table.Column<byte[]>(type: "longblob", nullable: true),
Latitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Longitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedBy = table.Column<int>(type: "int", nullable: true),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AttendanceLogs", x => x.Id);
table.ForeignKey(
name: "FK_AttendanceLogs_Attendances_AttendanceId",
column: x => x.AttendanceId,
principalTable: "Attendances",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendanceLogs_Employees_EmployeeID",
column: x => x.EmployeeID,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendanceLogs_Employees_UpdatedBy",
column: x => x.UpdatedBy,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AttendanceLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "e20751cc-a482-499e-98de-ccc88689fcc6");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "589ba09f-e176-4c90-9502-707799d33e94");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "f1c5886a-474c-4b71-bda8-f278b78b0a4d");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_EmployeeID",
table: "AttendanceLogs",
column: "EmployeeID");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_TenantId",
table: "AttendanceLogs",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_UpdatedBy",
table: "AttendanceLogs",
column: "UpdatedBy");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AttendanceLogs");
migrationBuilder.CreateTable(
name: "AttendLogs",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
AttendanceId = table.Column<int>(type: "int", nullable: false),
EmployeeID = table.Column<int>(type: "int", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false),
UpdatedBy = table.Column<int>(type: "int", nullable: true),
Activity = table.Column<int>(type: "int", nullable: false),
ActivityTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Latitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Longitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Photo = table.Column<byte[]>(type: "longblob", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AttendLogs", x => x.Id);
table.ForeignKey(
name: "FK_AttendLogs_Attendances_AttendanceId",
column: x => x.AttendanceId,
principalTable: "Attendances",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendLogs_Employees_EmployeeID",
column: x => x.EmployeeID,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendLogs_Employees_UpdatedBy",
column: x => x.UpdatedBy,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AttendLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "04db13e4-201a-44ba-9d9a-6c07f91d3cd0");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "72e2c008-c3f1-4dd8-a6ed-19c9eec3d892");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "0a8eda0f-39b8-4efe-98af-5c6f2a7cd5cf");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_AttendanceId",
table: "AttendLogs",
column: "AttendanceId");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_EmployeeID",
table: "AttendLogs",
column: "EmployeeID");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_TenantId",
table: "AttendLogs",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_UpdatedBy",
table: "AttendLogs",
column: "UpdatedBy");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,242 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class attend : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AttendanceLogs_Attendances_AttendanceId",
table: "AttendanceLogs");
migrationBuilder.DropForeignKey(
name: "FK_Attendances_Employees_EmployeeID",
table: "Attendances");
migrationBuilder.DropForeignKey(
name: "FK_Attendances_Tenants_TenantId",
table: "Attendances");
migrationBuilder.DropPrimaryKey(
name: "PK_Attendances",
table: "Attendances");
migrationBuilder.RenameTable(
name: "Attendances",
newName: "Attendance");
migrationBuilder.RenameIndex(
name: "IX_Attendances_TenantId",
table: "Attendance",
newName: "IX_Attendance_TenantId");
migrationBuilder.RenameIndex(
name: "IX_Attendances_EmployeeID",
table: "Attendance",
newName: "IX_Attendance_EmployeeID");
migrationBuilder.AddColumn<Guid>(
name: "RoleId",
table: "Employees",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.AddPrimaryKey(
name: "PK_Attendance",
table: "Attendance",
column: "Id");
migrationBuilder.CreateTable(
name: "Attendes",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
EmployeeID = table.Column<int>(type: "int", nullable: false),
Date = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ProjectID = table.Column<int>(type: "int", nullable: false),
AttendanceDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
InTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
OutTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
IsApproved = table.Column<bool>(type: "tinyint(1)", nullable: false),
Activity = table.Column<int>(type: "int", nullable: false),
ApprovedBy = table.Column<int>(type: "int", nullable: true),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Attendes", x => x.Id);
table.ForeignKey(
name: "FK_Attendes_Employees_EmployeeID",
column: x => x.EmployeeID,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Attendes_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "c66df186-3191-4286-b5ef-c6a4adc3a65b");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "5efb0b4b-03ab-480c-a2fd-d5a8be9e5f96");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "43e0fb8a-3d42-451c-9899-24bb033b4e70");
migrationBuilder.CreateIndex(
name: "IX_Attendes_EmployeeID",
table: "Attendes",
column: "EmployeeID");
migrationBuilder.CreateIndex(
name: "IX_Attendes_TenantId",
table: "Attendes",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_Attendance_Employees_EmployeeID",
table: "Attendance",
column: "EmployeeID",
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Attendance_Tenants_TenantId",
table: "Attendance",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_AttendanceLogs_Attendance_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId",
principalTable: "Attendance",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Attendance_Employees_EmployeeID",
table: "Attendance");
migrationBuilder.DropForeignKey(
name: "FK_Attendance_Tenants_TenantId",
table: "Attendance");
migrationBuilder.DropForeignKey(
name: "FK_AttendanceLogs_Attendance_AttendanceId",
table: "AttendanceLogs");
migrationBuilder.DropTable(
name: "Attendes");
migrationBuilder.DropPrimaryKey(
name: "PK_Attendance",
table: "Attendance");
migrationBuilder.DropColumn(
name: "RoleId",
table: "Employees");
migrationBuilder.RenameTable(
name: "Attendance",
newName: "Attendances");
migrationBuilder.RenameIndex(
name: "IX_Attendance_TenantId",
table: "Attendances",
newName: "IX_Attendances_TenantId");
migrationBuilder.RenameIndex(
name: "IX_Attendance_EmployeeID",
table: "Attendances",
newName: "IX_Attendances_EmployeeID");
migrationBuilder.AddPrimaryKey(
name: "PK_Attendances",
table: "Attendances",
column: "Id");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "331a7bea-688e-4f27-8dba-697d9cd29870");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "ba873fd2-277b-4baa-88b9-22b69010ffa8");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "aa481e97-9a9b-4b1e-b9dd-0a6ce26dab47");
migrationBuilder.AddForeignKey(
name: "FK_AttendanceLogs_Attendances_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId",
principalTable: "Attendances",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Attendances_Employees_EmployeeID",
table: "Attendances",
column: "EmployeeID",
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Attendances_Tenants_TenantId",
table: "Attendances",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,117 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class attendrename : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AttendanceLogs_Attendance_AttendanceId",
table: "AttendanceLogs");
migrationBuilder.DropTable(
name: "Attendance");
migrationBuilder.AddForeignKey(
name: "FK_AttendanceLogs_Attendes_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId",
principalTable: "Attendes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AttendanceLogs_Attendes_AttendanceId",
table: "AttendanceLogs");
migrationBuilder.DropForeignKey(
name: "FK_Attendes_Employees_EmployeeID",
table: "Attendes");
migrationBuilder.DropForeignKey(
name: "FK_Attendes_Tenants_TenantId",
table: "Attendes");
migrationBuilder.DropPrimaryKey(
name: "PK_Attendes",
table: "Attendes");
migrationBuilder.RenameTable(
name: "Attendes",
newName: "Attendances");
migrationBuilder.RenameIndex(
name: "IX_Attendes_TenantId",
table: "Attendances",
newName: "IX_Attendances_TenantId");
migrationBuilder.RenameIndex(
name: "IX_Attendes_EmployeeID",
table: "Attendances",
newName: "IX_Attendances_EmployeeID");
migrationBuilder.AddPrimaryKey(
name: "PK_Attendances",
table: "Attendances",
column: "Id");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "02f1b9b7-9cc5-4822-8090-362ca9b61a8e");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "b9005cdc-0d10-4110-9e42-1d7117b68cd3");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "6df40548-5543-4066-aab4-5f340015b731");
migrationBuilder.AddForeignKey(
name: "FK_AttendanceLogs_Attendances_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId",
principalTable: "Attendances",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Attendances_Employees_EmployeeID",
table: "Attendances",
column: "EmployeeID",
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Attendances_Tenants_TenantId",
table: "Attendances",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@ -1,71 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class addIsActiveToProjectAllocation : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "ProjectAllocations",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "b04da7e9-0406-409c-ac7f-b97256e6ea02");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "0971c7fb-6ce1-458a-ae3f-8d3205893637");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "504ec132-e6a9-422f-8f85-050602cfce05");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsActive",
table: "ProjectAllocations");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "6962167a-70de-4e3d-961d-14cfe676ef22");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "d8d0ed22-ce17-4a73-b507-307c43c08b57");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "3c0463c6-2842-43ac-b7d3-ca74b26c74a6");
}
}
}

View File

@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Marco.Pms.DataAccess.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20250311072410_addIsActiveToProjectAllocation")]
partial class addIsActiveToProjectAllocation
[Migration("20250326054022_initmigration")]
partial class initmigration
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -23,7 +23,7 @@ namespace Marco.Pms.DataAccess.Migrations
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
// MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
//MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b =>
{
@ -305,6 +305,10 @@ namespace Marco.Pms.DataAccess.Migrations
b.Property<string>("Email")
.HasColumnType("longtext");
b.Property<string>("EmergencyContactPerson")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("EmergencyPhoneNumber")
.IsRequired()
.HasColumnType("longtext");
@ -317,9 +321,15 @@ namespace Marco.Pms.DataAccess.Migrations
.IsRequired()
.HasColumnType("longtext");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<int?>("JobRoleId")
.HasColumnType("int");
b.Property<DateTime?>("JoiningDate")
.HasColumnType("datetime(6)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("longtext");
@ -1196,12 +1206,12 @@ namespace Marco.Pms.DataAccess.Migrations
b.Property<int>("EmployeeId")
.HasColumnType("int");
b.Property<Guid?>("EmployeeRoleId")
.HasColumnType("char(36)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<int?>("JobRoleId")
.HasColumnType("int");
b.Property<int>("ProjectId")
.HasColumnType("int");

View File

@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class initiateapp : Migration
public partial class initmigration : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
@ -77,6 +77,25 @@ namespace Marco.Pms.DataAccess.Migrations
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Modules",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Key = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Modules", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Tenants",
columns: table => new
@ -256,6 +275,53 @@ namespace Marco.Pms.DataAccess.Migrations
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Features",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ModuleId = table.Column<int>(type: "int", nullable: false),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Features", x => x.Id);
table.ForeignKey(
name: "FK_Features_Modules_ModuleId",
column: x => x.ModuleId,
principalTable: "Modules",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ApplicationRoles",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Role = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ApplicationRoles", x => x.Id);
table.ForeignKey(
name: "FK_ApplicationRoles_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Buildings",
columns: table => new
@ -282,42 +348,22 @@ namespace Marco.Pms.DataAccess.Migrations
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "EmployeeRoles",
name: "JobRoles",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Role = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EmployeeRoles", x => x.Id);
table.ForeignKey(
name: "FK_EmployeeRoles_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Feature",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Feature", x => x.Id);
table.PrimaryKey("PK_JobRoles", x => x.Id);
table.ForeignKey(
name: "FK_Feature_Tenants_TenantId",
name: "FK_JobRoles_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
@ -371,6 +417,30 @@ namespace Marco.Pms.DataAccess.Migrations
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "FeaturePermissions",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FeatureId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FeaturePermissions", x => x.Id);
table.ForeignKey(
name: "FK_FeaturePermissions_Features_FeatureId",
column: x => x.FeatureId,
principalTable: "Features",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Floor",
columns: table => new
@ -417,6 +487,7 @@ namespace Marco.Pms.DataAccess.Migrations
Gender = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
BirthDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
JoiningDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
PeramnentAddress = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CurrentAddress = table.Column<string>(type: "longtext", nullable: false)
@ -425,6 +496,8 @@ namespace Marco.Pms.DataAccess.Migrations
.Annotation("MySql:CharSet", "utf8mb4"),
EmergencyPhoneNumber = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
EmergencyContactPerson = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
AadharNumber = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PanNumber = table.Column<string>(type: "longtext", nullable: true)
@ -433,7 +506,9 @@ namespace Marco.Pms.DataAccess.Migrations
ApplicationUserId = table.Column<string>(type: "varchar(255)", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false),
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
JobRoleId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
@ -444,11 +519,10 @@ namespace Marco.Pms.DataAccess.Migrations
principalTable: "AspNetUsers",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Employees_EmployeeRoles_RoleId",
column: x => x.RoleId,
principalTable: "EmployeeRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
name: "FK_Employees_JobRoles_JobRoleId",
column: x => x.JobRoleId,
principalTable: "JobRoles",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Employees_Tenants_TenantId",
column: x => x.TenantId,
@ -458,40 +532,6 @@ namespace Marco.Pms.DataAccess.Migrations
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "FeaturePermission",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FeatureId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FeaturePermission", x => x.Id);
table.ForeignKey(
name: "FK_FeaturePermission_EmployeeRoles_RoleId",
column: x => x.RoleId,
principalTable: "EmployeeRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_FeaturePermission_Feature_FeatureId",
column: x => x.FeatureId,
principalTable: "Feature",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_FeaturePermission_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Projects",
columns: table => new
@ -527,6 +567,31 @@ namespace Marco.Pms.DataAccess.Migrations
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RolePermissionMappings",
columns: table => new
{
ApplicationRoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FeaturePermissionId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_RolePermissionMappings", x => new { x.ApplicationRoleId, x.FeaturePermissionId });
table.ForeignKey(
name: "FK_RolePermissionMappings_ApplicationRoles_ApplicationRoleId",
column: x => x.ApplicationRoleId,
principalTable: "ApplicationRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RolePermissionMappings_FeaturePermissions_FeaturePermissionId",
column: x => x.FeaturePermissionId,
principalTable: "FeaturePermissions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "WorkAreas",
columns: table => new
@ -557,7 +622,7 @@ namespace Marco.Pms.DataAccess.Migrations
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AttendanceLogs",
name: "Attendes",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
@ -565,28 +630,61 @@ namespace Marco.Pms.DataAccess.Migrations
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
EmployeeID = table.Column<int>(type: "int", nullable: false),
CheckTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
IsCheckIn = table.Column<bool>(type: "tinyint(1)", nullable: false),
Photo = table.Column<byte[]>(type: "longblob", nullable: true),
Latitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Longitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false),
UpdatedBy = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
Date = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ProjectID = table.Column<int>(type: "int", nullable: false),
AttendanceDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
InTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
OutTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
IsApproved = table.Column<bool>(type: "tinyint(1)", nullable: false),
Activity = table.Column<int>(type: "int", nullable: false),
ApprovedBy = table.Column<int>(type: "int", nullable: true),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AttendanceLogs", x => x.Id);
table.PrimaryKey("PK_Attendes", x => x.Id);
table.ForeignKey(
name: "FK_AttendanceLogs_Employees_EmployeeID",
name: "FK_Attendes_Employees_EmployeeID",
column: x => x.EmployeeID,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendanceLogs_Tenants_TenantId",
name: "FK_Attendes_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "EmployeeRoleMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
EmployeeId = table.Column<int>(type: "int", nullable: false),
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EmployeeRoleMappings", x => x.Id);
table.ForeignKey(
name: "FK_EmployeeRoleMappings_ApplicationRoles_RoleId",
column: x => x.RoleId,
principalTable: "ApplicationRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_EmployeeRoleMappings_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_EmployeeRoleMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
@ -601,7 +699,8 @@ namespace Marco.Pms.DataAccess.Migrations
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
EmployeeId = table.Column<int>(type: "int", nullable: false),
EmployeeRoleId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
JobRoleId = table.Column<int>(type: "int", nullable: true),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
ProjectId = table.Column<int>(type: "int", nullable: false),
AllocationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ReAllocationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
@ -683,43 +782,48 @@ namespace Marco.Pms.DataAccess.Migrations
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Attendances",
name: "AttendanceLogs",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
AttendanceId = table.Column<int>(type: "int", nullable: false),
EmployeeID = table.Column<int>(type: "int", nullable: false),
Date = table.Column<DateTime>(type: "datetime(6)", nullable: false),
InTimeID = table.Column<int>(type: "int", nullable: true),
OutTimeID = table.Column<int>(type: "int", nullable: true),
IsApproved = table.Column<bool>(type: "tinyint(1)", nullable: false),
ApprovedBy = table.Column<string>(type: "longtext", nullable: true)
ActivityTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Activity = table.Column<int>(type: "int", nullable: false),
Photo = table.Column<byte[]>(type: "longblob", nullable: true),
Latitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Longitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedBy = table.Column<int>(type: "int", nullable: true),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Attendances", x => x.Id);
table.PrimaryKey("PK_AttendanceLogs", x => x.Id);
table.ForeignKey(
name: "FK_Attendances_AttendanceLogs_InTimeID",
column: x => x.InTimeID,
principalTable: "AttendanceLogs",
principalColumn: "Id");
name: "FK_AttendanceLogs_Attendes_AttendanceId",
column: x => x.AttendanceId,
principalTable: "Attendes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Attendances_AttendanceLogs_OutTimeID",
column: x => x.OutTimeID,
principalTable: "AttendanceLogs",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Attendances_Employees_EmployeeID",
name: "FK_AttendanceLogs_Employees_EmployeeID",
column: x => x.EmployeeID,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Attendances_Tenants_TenantId",
name: "FK_AttendanceLogs_Employees_UpdatedBy",
column: x => x.UpdatedBy,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AttendanceLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
@ -828,6 +932,16 @@ namespace Marco.Pms.DataAccess.Migrations
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "Modules",
columns: new[] { "Id", "Description", "Key", "Name" },
values: new object[,]
{
{ 1, "Project Module", "b04da7e9-0406-409c-ac7f-b97256e6ea02", "Project" },
{ 2, "Employee Module", "0971c7fb-6ce1-458a-ae3f-8d3205893637", "Employee" },
{ 3, "Masters Module", "504ec132-e6a9-422f-8f85-050602cfce05", "Masters" }
});
migrationBuilder.InsertData(
table: "Tenants",
columns: new[] { "Id", "ContactName", "ContactNumber", "Description", "DomainName", "Name", "OnBoardingDate" },
@ -855,15 +969,30 @@ namespace Marco.Pms.DataAccess.Migrations
});
migrationBuilder.InsertData(
table: "EmployeeRoles",
columns: new[] { "Id", "Role", "TenantId" },
table: "ApplicationRoles",
columns: new[] { "Id", "Description", "Role", "TenantId" },
values: new object[,]
{
{ new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), "Admin", 1 },
{ new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), "Welder", 1 },
{ new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), "Helper", 1 },
{ new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), "Site Engineer", 1 },
{ new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), "Project Manager", 1 }
{ new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), "", "Admin", 1 },
{ new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), "", "Welder", 1 },
{ new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), "", "Helper", 1 },
{ new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), "", "Site Engineer", 1 },
{ new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), "", "Project Manager", 1 }
});
migrationBuilder.InsertData(
table: "Features",
columns: new[] { "Id", "Description", "IsActive", "ModuleId", "Name" },
values: new object[,]
{
{ new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), "Assign and Update Tasks Progress", true, 1, "Assign and Update Tasks Progress" },
{ new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), "Attendance", true, 2, "Attendance" },
{ new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), "Manage Project", true, 1, "Manage Project" },
{ new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), "Tenant Masters", true, 3, "Tenant Masters" },
{ new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), "Manage Employee", true, 2, "Manage Employee" },
{ new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), "Manage Infra", true, 1, "Manage Infra" },
{ new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), "Manage Tasks", true, 1, "Manage Tasks" },
{ new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), "Global Masters", true, 3, "Global Masters" }
});
migrationBuilder.InsertData(
@ -877,6 +1006,31 @@ namespace Marco.Pms.DataAccess.Migrations
{ 4, "Completed", 1 }
});
migrationBuilder.InsertData(
table: "FeaturePermissions",
columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" },
values: new object[,]
{
{ new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), "", new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), true, "Manage Task" },
{ new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "Manage Project" },
{ new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), "", new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), true, "Regularize Attendance" },
{ new Guid("588a8824-f924-4955-82d8-fc51956cf323"), "", new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), true, "Manage Masters" },
{ new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), "", new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), true, "View Masters" },
{ new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), "", new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), true, "Manage Masters" },
{ new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "View Project" },
{ new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), "", new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), true, "Perform Attendance " },
{ new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), "", new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), true, "View Task" },
{ new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Manage Employee" },
{ new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "View Employee" },
{ new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "Manage Team" },
{ new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), "", new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), true, "View Project Infra" },
{ new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), "", new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), true, "View Masters" },
{ new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), "", new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), true, "Assign Task and Report Progress" },
{ new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), "", new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), true, "Approve Task" },
{ new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), "", new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), true, "Manage Project Infra" },
{ new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Assign To Project" }
});
migrationBuilder.InsertData(
table: "Projects",
columns: new[] { "Id", "ContactPerson", "EndDate", "Name", "ProjectAddress", "ProjectStatusId", "StartDate", "TenantId" },
@ -897,6 +1051,11 @@ namespace Marco.Pms.DataAccess.Migrations
table: "ActivityMasters",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ApplicationRoles_TenantId",
table: "ApplicationRoles",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_AspNetRoleClaims_RoleId",
table: "AspNetRoleClaims",
@ -934,6 +1093,11 @@ namespace Marco.Pms.DataAccess.Migrations
column: "NormalizedUserName",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_EmployeeID",
table: "AttendanceLogs",
@ -945,23 +1109,18 @@ namespace Marco.Pms.DataAccess.Migrations
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_Attendances_EmployeeID",
table: "Attendances",
name: "IX_AttendanceLogs_UpdatedBy",
table: "AttendanceLogs",
column: "UpdatedBy");
migrationBuilder.CreateIndex(
name: "IX_Attendes_EmployeeID",
table: "Attendes",
column: "EmployeeID");
migrationBuilder.CreateIndex(
name: "IX_Attendances_InTimeID",
table: "Attendances",
column: "InTimeID");
migrationBuilder.CreateIndex(
name: "IX_Attendances_OutTimeID",
table: "Attendances",
column: "OutTimeID");
migrationBuilder.CreateIndex(
name: "IX_Attendances_TenantId",
table: "Attendances",
name: "IX_Attendes_TenantId",
table: "Attendes",
column: "TenantId");
migrationBuilder.CreateIndex(
@ -970,8 +1129,18 @@ namespace Marco.Pms.DataAccess.Migrations
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_EmployeeRoles_TenantId",
table: "EmployeeRoles",
name: "IX_EmployeeRoleMappings_EmployeeId",
table: "EmployeeRoleMappings",
column: "EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_EmployeeRoleMappings_RoleId",
table: "EmployeeRoleMappings",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_EmployeeRoleMappings_TenantId",
table: "EmployeeRoleMappings",
column: "TenantId");
migrationBuilder.CreateIndex(
@ -980,9 +1149,9 @@ namespace Marco.Pms.DataAccess.Migrations
column: "ApplicationUserId");
migrationBuilder.CreateIndex(
name: "IX_Employees_RoleId",
name: "IX_Employees_JobRoleId",
table: "Employees",
column: "RoleId");
column: "JobRoleId");
migrationBuilder.CreateIndex(
name: "IX_Employees_TenantId",
@ -990,24 +1159,14 @@ namespace Marco.Pms.DataAccess.Migrations
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_Feature_TenantId",
table: "Feature",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_FeaturePermission_FeatureId",
table: "FeaturePermission",
name: "IX_FeaturePermissions_FeatureId",
table: "FeaturePermissions",
column: "FeatureId");
migrationBuilder.CreateIndex(
name: "IX_FeaturePermission_RoleId",
table: "FeaturePermission",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_FeaturePermission_TenantId",
table: "FeaturePermission",
column: "TenantId");
name: "IX_Features_ModuleId",
table: "Features",
column: "ModuleId");
migrationBuilder.CreateIndex(
name: "IX_Floor_BuildingId",
@ -1019,6 +1178,11 @@ namespace Marco.Pms.DataAccess.Migrations
table: "Floor",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_JobRoles_TenantId",
table: "JobRoles",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ProjectAllocations_EmployeeId",
table: "ProjectAllocations",
@ -1049,6 +1213,11 @@ namespace Marco.Pms.DataAccess.Migrations
table: "RefreshTokens",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_RolePermissionMappings_FeaturePermissionId",
table: "RolePermissionMappings",
column: "FeaturePermissionId");
migrationBuilder.CreateIndex(
name: "IX_StatusMasters_TenantId",
table: "StatusMasters",
@ -1144,10 +1313,10 @@ namespace Marco.Pms.DataAccess.Migrations
name: "AspNetUserTokens");
migrationBuilder.DropTable(
name: "Attendances");
name: "AttendanceLogs");
migrationBuilder.DropTable(
name: "FeaturePermission");
name: "EmployeeRoleMappings");
migrationBuilder.DropTable(
name: "ProjectAllocations");
@ -1155,6 +1324,9 @@ namespace Marco.Pms.DataAccess.Migrations
migrationBuilder.DropTable(
name: "RefreshTokens");
migrationBuilder.DropTable(
name: "RolePermissionMappings");
migrationBuilder.DropTable(
name: "WorkItemMapping");
@ -1165,17 +1337,26 @@ namespace Marco.Pms.DataAccess.Migrations
name: "AspNetRoles");
migrationBuilder.DropTable(
name: "AttendanceLogs");
name: "Attendes");
migrationBuilder.DropTable(
name: "Feature");
name: "ApplicationRoles");
migrationBuilder.DropTable(
name: "FeaturePermissions");
migrationBuilder.DropTable(
name: "WorkItems");
migrationBuilder.DropTable(
name: "Features");
migrationBuilder.DropTable(
name: "ActivityMasters");
migrationBuilder.DropTable(
name: "Modules");
migrationBuilder.DropTable(
name: "TaskAllocations");
@ -1192,7 +1373,7 @@ namespace Marco.Pms.DataAccess.Migrations
name: "AspNetUsers");
migrationBuilder.DropTable(
name: "EmployeeRoles");
name: "JobRoles");
migrationBuilder.DropTable(
name: "StatusMasters");

View File

@ -302,6 +302,10 @@ namespace Marco.Pms.DataAccess.Migrations
b.Property<string>("Email")
.HasColumnType("longtext");
b.Property<string>("EmergencyContactPerson")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("EmergencyPhoneNumber")
.IsRequired()
.HasColumnType("longtext");
@ -314,9 +318,15 @@ namespace Marco.Pms.DataAccess.Migrations
.IsRequired()
.HasColumnType("longtext");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<int?>("JobRoleId")
.HasColumnType("int");
b.Property<DateTime?>("JoiningDate")
.HasColumnType("datetime(6)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("longtext");
@ -1193,12 +1203,12 @@ namespace Marco.Pms.DataAccess.Migrations
b.Property<int>("EmployeeId")
.HasColumnType("int");
b.Property<Guid?>("EmployeeRoleId")
.HasColumnType("char(36)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<int?>("JobRoleId")
.HasColumnType("int");
b.Property<int>("ProjectId")
.HasColumnType("int");

View File

@ -1,47 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Projects;
using Microsoft.EntityFrameworkCore;
using System.Linq.Expressions;
using System.Linq;
namespace BulkyBook.DataAccess.Repository
{
public class ActivityMasterRepository : Repository<ActivityMaster>, IActivityMasterRepository
{
private readonly ApplicationDbContext _context;
public ActivityMasterRepository(ApplicationDbContext context) : base(context)
{
_context = context;
}
public void Update(ActivityMaster status)
{
_context.ActivityMasters.Update(status);
}
public Task<List<ActivityMaster>> GetAllAsync(Expression<Func<ActivityMaster, bool>>? filter = null, string? includeProperties = null)
{
IQueryable<ActivityMaster> query = _context.ActivityMasters;
if (filter != null)
{
query.Where(filter);
}
if (!string.IsNullOrEmpty(includeProperties))
{
foreach (var includeProp in includeProperties.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
query = query.Include(includeProp);
}
}
return query.ToListAsync();
// return await _context.Projects.ToListAsync(); ;
}
}
}

View File

@ -1,23 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Projects;
namespace BulkyBook.DataAccess.Repository
{
public class ApplicationRolesRepository : Repository<ApplicationRole>, IApplicationRolesRepository
{
private readonly ApplicationDbContext _db;
public ApplicationRolesRepository(ApplicationDbContext db) : base(db)
{
_db = db;
}
public void Update(ApplicationRole status)
{
_db.ApplicationRoles.Update(status);
}
}
}

View File

@ -1,21 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Entitlements;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Marco.Pms.DataAccess.Repository
{
public class ApplicationUserRepository : Repository<ApplicationUser>, IApplicationUserRepository
{
private readonly ApplicationDbContext _db;
public ApplicationUserRepository(ApplicationDbContext db) : base(db)
{
_db = db;
}
}
}

View File

@ -1,22 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.AttendanceModule;
namespace BulkyBook.DataAccess.Repository
{
public class AttendenceRepository : Repository<Attendance>, IAttendenceRepository
{
private readonly ApplicationDbContext _db;
public AttendenceRepository(ApplicationDbContext db) : base(db)
{
_db = db;
}
public void Update(Attendance attendance)
{
_db.Attendes.Update(attendance);
}
}
}

View File

@ -1,22 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Projects;
namespace BulkyBook.DataAccess.Repository
{
public class BuildingRepository : Repository<Building>, IBuildingRepository
{
private readonly ApplicationDbContext _db;
public BuildingRepository(ApplicationDbContext db) : base(db)
{
_db = db;
}
public void Update(Building building)
{
_db.Buildings.Update(building);
}
}
}

View File

@ -1,47 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Projects;
using Microsoft.EntityFrameworkCore;
using System.Linq.Expressions;
using System.Linq;
namespace BulkyBook.DataAccess.Repository
{
public class EmployeeRepository : Repository<Employee>, IEmployeeRepository
{
private readonly ApplicationDbContext _context;
public EmployeeRepository(ApplicationDbContext db) : base(db)
{
_context = db;
}
public void Update(Employee employee)
{
_context.Employees.Update(employee);
}
public Task<List<Employee>> GetAsync(Expression<Func<Employee, bool>>? filter = null, string? includeProperties = null)
{
IQueryable<Employee> query = _context.Employees;
if (filter != null)
{
query.Where(filter);
}
if (!string.IsNullOrEmpty(includeProperties))
{
foreach (var includeProp in includeProperties.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
query = query.Include(includeProp);
}
}
return query.ToListAsync();
// return await _context.Projects.ToListAsync(); ;
}
}
}

View File

@ -1,119 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Projects;
using Microsoft.EntityFrameworkCore;
using System.Linq.Expressions;
namespace BulkyBook.DataAccess.Repository
{
public class FeaturesRepository : Repository<Feature>, IFeatureRepository
{
private readonly ApplicationDbContext _context;
internal DbSet<Feature> dbSet;
public FeaturesRepository(ApplicationDbContext db): base(db)
{
_context = db;
this.dbSet = _context.Set<Feature>();
}
public void Update(Feature project)
{
_context.Features.Update(project);
}
public Task<List<Feature>> GetAllAsync(Expression<Func<Feature, bool>>? filter = null, string? includeProperties = null)
{
IQueryable<Feature> query = _context.Features;
if (filter != null)
{
query.Where(filter);
}
if (!string.IsNullOrEmpty(includeProperties))
{
foreach (var includeProp in includeProperties.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
query = query.Include(includeProp);
}
}
return query.ToListAsync();
// return await _context.Projects.ToListAsync(); ;
}
public Task<List<Feature>> GetAsync(Expression<Func<Feature, bool>>? filter = null, string? includeProperties = null)
{
IQueryable<Feature> query = _context.Features;
if (filter != null)
{
query.Where(filter);
//var projects1= query2.Where(filter).ToListAsync();
}
if (!string.IsNullOrEmpty(includeProperties))
{
foreach (var includeProp in includeProperties.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
query = query.Include(includeProp);
}
}
return query.ToListAsync();
// return await _context.Projects.ToListAsync(); ;
}
public async Task<Feature> CreateAsync(Feature projectModel)
{
try
{
await _context.Features.AddAsync(projectModel);
await _context.SaveChangesAsync();
return projectModel;
}
catch (Exception ex) { throw ex; }
}
//public async Task<Feature> UpdateAsync(int id, UpdateFeatureDto projectDto)
//{
// var projectModel = await _context.Features.FirstOrDefaultAsync(item => item.Id == id);
// if (projectModel == null)
// {
// return null;
// }
// projectModel.ContactPerson = projectDto.ContactPerson;
// projectModel.ProjectAddress = projectDto.ProjectAddress;
// projectModel.Name = projectDto.Name;
// projectModel.EndDate = projectDto.EndDate;
// projectModel.StartDate = projectDto.StartDate;
// //projectModel.TenantId = projectDto.TenantId;
// try
// {
// await _context.SaveChangesAsync();
// }catch(Exception ex )
// {
// throw ex;
// }
// return projectModel;
//}
}
}

View File

@ -1,22 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Projects;
namespace BulkyBook.DataAccess.Repository
{
public class FloorRepository : Repository<Floor>, IFloorRepository
{
private readonly ApplicationDbContext _db;
public FloorRepository(ApplicationDbContext db) : base(db)
{
_db = db;
}
public void Update(Floor floor)
{
_db.Floor.Update(floor);
}
}
}

View File

@ -1,12 +0,0 @@
using Marco.Pms.Model.Entitlements;
using System.Linq.Expressions;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IActivityMasterRepository : IRepository<ActivityMaster>
{
void Update(ActivityMaster activity);
Task<List<ActivityMaster>> GetAllAsync(Expression<Func<ActivityMaster, bool>>? filter = null, string? includeProperties = null);
}
}

View File

@ -1,10 +0,0 @@
using Marco.Pms.Model.Entitlements;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IApplicationRolesRepository : IRepository<ApplicationRole>
{
void Update(ApplicationRole role);
}
}

View File

@ -1,9 +0,0 @@
using Marco.Pms.Model.Entitlements;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IApplicationUserRepository : IRepository<ApplicationUser>
{
}
}

View File

@ -1,11 +0,0 @@
using Marco.Pms.Model.AttendanceModule;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IAttendenceRepository : IRepository<Attendance>
{
void Update(Attendance employee);
}
}

View File

@ -1,10 +0,0 @@
using Marco.Pms.Model.Projects;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IBuildingRepository : IRepository<Building>
{
void Update(Building building);
}
}

View File

@ -1,13 +0,0 @@
using Marco.Pms.Model.Employees;
using System.Linq.Expressions;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IEmployeeRepository : IRepository<Employee>
{
void Update(Employee employee);
Task<List<Employee>> GetAsync(Expression<Func<Employee, bool>>? filter = null, string? includeProperties = null);
}
}

View File

@ -1,18 +0,0 @@
using Marco.Pms.Model.Dtos.Project;
using Marco.Pms.Model.Entitlements;
using System.Linq.Expressions;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IFeatureRepository : IRepository<Feature>
{
void Update(Feature Feature);
Task<List<Feature>> GetAsync(Expression<Func<Feature, bool>>? filter = null, string? includeProperties = null);
Task<List<Feature>> GetAllAsync(Expression<Func<Feature, bool>>? filter = null, string? includeProperties = null);
Task<Feature> CreateAsync(Feature feature);
// Task<Feature> UpdateAsync(int id, UpdateFeatureDto Feature);
// Task<List<Project>> GetAsync(int id, string? includeProperties = null);
}
}

View File

@ -1,10 +0,0 @@
using Marco.Pms.Model.Projects;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IFloorRepository : IRepository<Floor>
{
void Update(Floor floor);
}
}

View File

@ -1,20 +0,0 @@
using Marco.Pms.Model.Dtos.Project;
using Marco.Pms.Model.Projects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IProjectAllocationRepository
{
void Update(ProjectAllocation project);
Task<List<ProjectAllocation>> GetAsync(Expression<Func<ProjectAllocation, bool>>? filter = null, string? includeProperties = null);
Task<List<ProjectAllocation>> GetAllAsync(Expression<Func<ProjectAllocation, bool>>? filter = null, string? includeProperties = null);
Task<ProjectAllocation> CreateAsync(ProjectAllocation project);
Task<ProjectAllocation> UpdateAsync(int id, ProjectAllocation project);
}
}

View File

@ -1,18 +0,0 @@
using Marco.Pms.Model.Dtos.Project;
using Marco.Pms.Model.Projects;
using System.Linq.Expressions;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IProjectRepository : IRepository<Project>
{
void Update(Project project);
Task<List<Project>> GetAsync(Expression<Func<Project, bool>>? filter = null, string? includeProperties = null);
Task<List<Project>> GetAllAsync(Expression<Func<Project, bool>>? filter = null, string? includeProperties = null);
Task<Project> CreateAsync(Project project);
Task<Project> UpdateAsync(int id, UpdateProjectDto project);
// Task<List<Project>> GetAsync(int id, string? includeProperties = null);
}
}

View File

@ -1,16 +0,0 @@
using System.Linq.Expressions;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IRepository<T> where T : class
{
// T - Category
IEnumerable<T> GetAll(Expression<Func<T, bool>>? filter, string? includeProperties = null);
//T GetFirstOrDefault();
T Get(Expression<Func<T, bool>> filter, string? includeProperties = null, bool tracked = false);
Task<T> GetAsync(Expression<Func<T, bool>> filter, bool tracked = false, params Expression<Func<T, object>>[] includeProperties);
void Add(T entity);
void Remove(T entity);
void RemoveRange(IEnumerable<T> entity);
}
}

View File

@ -1,11 +0,0 @@
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Projects;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IStatusRepository : IRepository<StatusMaster>
{
void Update(StatusMaster status);
}
}

View File

@ -1,11 +0,0 @@
using Marco.Pms.Model.Activities;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface ITaskAllocationRepository : IRepository<TaskAllocation>
{
void Update(TaskAllocation employeeAllocation);
}
}

View File

@ -1,28 +0,0 @@
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IUnitOfWork
{
IApplicationUserRepository ApplicationUser { get; }
IEmployeeRepository Employee { get; }
ITaskAllocationRepository EmployeeAllocation
{ get; }
IProjectRepository Project { get; }
IProjectAllocationRepository ProjectAllocation { get; }
IBuildingRepository Building { get; }
IFloorRepository Floor { get; }
IWorkAreaRepository WorkArea { get; }
IWorkItemRepository WorkItem { get; }
IWorkItemMappingReposiotry WorkItemMapping { get;}
IAttendenceRepository Attendence { get; }
IStatusRepository StatusMaster { get; }
IActivityMasterRepository ActivityMaster { get; }
IApplicationRolesRepository EmployeeRoles { get; }
IFeatureRepository Features { get; }
void Save();
}
}

View File

@ -1,10 +0,0 @@
using Marco.Pms.Model.Projects;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IWorkAreaRepository : IRepository<WorkArea>
{
void Update(WorkArea workArea);
}
}

View File

@ -1,9 +0,0 @@
using Marco.Pms.Model.Activities;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IWorkItemMappingReposiotry : IRepository<WorkItemMapping>
{
void Update(WorkItemMapping mapping);
}
}

View File

@ -1,11 +0,0 @@
using Marco.Pms.Model.Activities;
using Marco.Pms.Model.Projects;
namespace Marco.Pms.DataAccess.Repository.IRepository
{
public interface IWorkItemRepository : IRepository<WorkItem>
{
void Update(WorkItem workItem);
}
}

View File

@ -1,84 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Dtos.Project;
using Marco.Pms.Model.Projects;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Marco.Pms.DataAccess.Repository
{
public class ProjectAllocationRepository : Repository<ProjectAllocation>, IProjectAllocationRepository
{
private readonly ApplicationDbContext _context;
internal DbSet<ProjectAllocation> dbSet;
public ProjectAllocationRepository(ApplicationDbContext db) : base(db)
{
_context = db;
this.dbSet = _context.Set<ProjectAllocation>();
}
public void Update(ProjectAllocation project)
{
_context.ProjectAllocations.Update(project);
}
public async Task<ProjectAllocation> CreateAsync(ProjectAllocation project)
{
await _context.ProjectAllocations.AddAsync(project);
await _context.SaveChangesAsync();
return project;
}
public Task<List<ProjectAllocation>> GetAllAsync(Expression<Func<ProjectAllocation, bool>>? filter = null, string? includeProperties = null)
{
throw new NotImplementedException();
}
public Task<List<ProjectAllocation>> GetAsync(Expression<Func<ProjectAllocation, bool>>? filter = null, string? includeProperties = null)
{
IQueryable<ProjectAllocation> query = _context.ProjectAllocations;
if (filter != null)
{
query.Where(filter);
}
if (!string.IsNullOrEmpty(includeProperties))
{
foreach (var includeProp in includeProperties.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
query = query.Include(includeProp);
}
}
return query.ToListAsync();
}
public async Task<ProjectAllocation> UpdateAsync(int id, ProjectAllocation project)
{
var allocation = await _context.ProjectAllocations.FirstOrDefaultAsync(item => item.Id == id);
if (allocation == null)
{
return null;
}
allocation.ProjectId = project.ProjectId;
allocation.EmployeeId = project.EmployeeId;
allocation.AllocationDate = project.AllocationDate;
allocation.ReAllocationDate = project.ReAllocationDate;
allocation.TenantId = project.TenantId;
_context.ProjectAllocations.Update(allocation);
await _context.SaveChangesAsync();
return allocation;
}
}
}

View File

@ -1,146 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Dtos.Project;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Projects;
using Microsoft.EntityFrameworkCore;
using System.Linq;
using System.Linq.Expressions;
using System.Xml;
using System.Xml.Linq;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
namespace BulkyBook.DataAccess.Repository
{
public class ProjectRepository : Repository<Project>, IProjectRepository
{
private readonly ApplicationDbContext _context;
internal DbSet<Project> dbSet;
public ProjectRepository(ApplicationDbContext db) : base(db)
{
_context = db;
this.dbSet = _context.Set<Project>();
}
public void Update(Project project)
{
_context.Projects.Update(project);
}
public Task<List<Project>> GetAllAsync(Expression<Func<Project, bool>>? filter = null, string? includeProperties = null)
{
IQueryable<Project> query = _context.Projects;
if (filter != null)
{
query.Where(filter);
}
if (!string.IsNullOrEmpty(includeProperties))
{
foreach (var includeProp in includeProperties.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
query = query.Include(includeProp);
}
}
return query.ToListAsync();
// return await _context.Projects.ToListAsync(); ;
}
public Task<List<Project>> GetAsync(Expression<Func<Project, bool>>? filter = null, string? includeProperties = null)
{
IQueryable<Project> query = _context.Projects;
//IQueryable<Project> query2 = _context.Projects;
Expression<Func<Project, bool>> filter1 = x => x.Id == 2;
if (filter != null)
{
query.Where(filter);
//var projects1= query2.Where(filter).ToListAsync();
}
if (!string.IsNullOrEmpty(includeProperties))
{
foreach (var includeProp in includeProperties.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
query = query.Include(includeProp);
}
}
return query.ToListAsync();
// return await _context.Projects.ToListAsync(); ;
}
public async Task<Project> CreateAsync(Project projectModel)
{
try
{
await _context.Projects.AddAsync(projectModel);
await _context.SaveChangesAsync();
return projectModel;
}
catch (Exception ex) { throw ex; }
}
public async Task<Project> UpdateAsync(int id, UpdateProjectDto projectDto)
{
var projectModel = await _context.Projects.FirstOrDefaultAsync(item => item.Id == id);
if (projectModel == null)
{
return null;
}
projectModel.ContactPerson = projectDto.ContactPerson;
projectModel.ProjectAddress = projectDto.ProjectAddress;
projectModel.Name = projectDto.Name;
projectModel.EndDate = projectDto.EndDate;
projectModel.StartDate = projectDto.StartDate;
//projectModel.TenantId = projectDto.TenantId;
try
{
await _context.SaveChangesAsync();
}catch(Exception ex )
{
throw ex;
}
return projectModel;
}
//public Task<List<Project>> GetAsync(int id, string? includeProperties = null)
//{
// IQueryable<Project> query = _context.Projects;
// query.Where(c=>c.Id == id);
// // Task<Project> project = _context.Projects.Where(c=>c.Id == id).SingleOrDefaultAsync();
// //if (filter != null)
// //{
// // query.Where(filter);
// //}
// //if (!string.IsNullOrEmpty(includeProperties))
// //{
// // foreach (var includeProp in includeProperties.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
// // {
// // query = query.Include(includeProp);
// // }
// //}
// return query.ToListAsync();
// // return await _context.Projects.ToListAsync(); ;
//}
}
}

View File

@ -1,102 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository.IRepository;
using Microsoft.EntityFrameworkCore;
using System.Linq.Expressions;
namespace Marco.Pms.DataAccess.Repository
{
public class Repository<T> : IRepository<T> where T : class
{
private readonly ApplicationDbContext _context;
internal DbSet<T> dbSet;
public Repository(ApplicationDbContext context)
{
_context = context;
this.dbSet = _context.Set<T>();
//_db.Products.Include(u => u.Category);
}
public void Add(T entity)
{
dbSet.Add(entity);
}
public T Get(Expression<Func<T, bool>> filter, string? includeProperties = null, bool tracked = false)
{
IQueryable<T> query = dbSet;
if (tracked)
{
query = query.Where(filter);
}
else
{
query = query.AsNoTracking().Where(filter);
}
if (!string.IsNullOrEmpty(includeProperties))
{
foreach (var includeProp in includeProperties.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
query = query.Include(includeProp);
}
}
return query.FirstOrDefault();
}
public async Task<T> GetAsync(Expression<Func<T, bool>> filter, bool tracked = false, params Expression<Func<T, object>>[] includeProperties)
{
IQueryable<T> query = dbSet;
if (tracked)
{
query = query.Where(filter);
}
else
{
query = query.AsNoTracking().Where(filter);
}
if (includeProperties != null)
{
foreach (var includeProp in includeProperties)
{
query = query.Include(includeProp);
}
}
return await query.SingleOrDefaultAsync();
}
public IEnumerable<T> GetAll(Expression<Func<T, bool>>? filter = null, string? includeProperties = null)
{
IQueryable<T> query = dbSet;
if(filter != null)
{
query.Where(filter);
}
if (!string.IsNullOrEmpty(includeProperties))
{
foreach (var includeProp in includeProperties.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
query = query.Include(includeProp);
}
}
return query.ToList();
}
public void Remove(T entity)
{
dbSet.Remove(entity);
}
public void RemoveRange(IEnumerable<T> entity)
{
dbSet.RemoveRange(entity);
}
}
}

View File

@ -1,23 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Projects;
namespace BulkyBook.DataAccess.Repository
{
public class StatusRepository : Repository<StatusMaster>, IStatusRepository
{
private readonly ApplicationDbContext _db;
public StatusRepository(ApplicationDbContext db) : base(db)
{
_db = db;
}
public void Update(StatusMaster status)
{
_db.StatusMasters.Update(status);
}
}
}

View File

@ -1,21 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Activities;
namespace BulkyBook.DataAccess.Repository
{
public class TaskAllocationRepository : Repository<TaskAllocation>, ITaskAllocationRepository
{
private readonly ApplicationDbContext _db;
public TaskAllocationRepository(ApplicationDbContext db) : base(db)
{
_db = db;
}
public void Update(TaskAllocation employeeAllocation)
{
_db.TaskAllocations.Update(employeeAllocation);
}
}
}

View File

@ -1,64 +0,0 @@
using BulkyBook.DataAccess.Repository;
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository.IRepository;
namespace Marco.Pms.DataAccess.Repository
{
public class UnitOfWork : IUnitOfWork
{
private readonly ApplicationDbContext _db;
public IApplicationUserRepository ApplicationUser { get; private set; }
public IEmployeeRepository Employee { get; private set; }
public ITaskAllocationRepository EmployeeAllocation { get; private set; }
public IProjectRepository Project { get; private set; }
public IProjectAllocationRepository ProjectAllocation { get; private set; }
public IBuildingRepository Building { get; private set; }
public IFloorRepository Floor { get; private set; }
public IAttendenceRepository Attendence { get; private set; }
public IWorkAreaRepository WorkArea { get; private set; }
public IWorkItemRepository WorkItem { get; private set; }
public IWorkItemMappingReposiotry WorkItemMapping { get; private set; }
public IStatusRepository StatusMaster { get; private set; }
public IActivityMasterRepository ActivityMaster { get; private set; }
public IApplicationRolesRepository EmployeeRoles { get; private set; }
public IFeatureRepository Features { get; private set; }
public UnitOfWork(ApplicationDbContext db)
{
_db = db;
Employee = new EmployeeRepository(_db);
Project = new ProjectRepository(_db);
ProjectAllocation = new ProjectAllocationRepository(_db);
Building = new BuildingRepository(_db);
Floor = new FloorRepository(_db);
WorkArea = new WorkAreaRepository(_db);
WorkItem = new WorkItemRepository(_db);
WorkItemMapping = new WorkItemMappingReporitury(_db);
ApplicationUser = new ApplicationUserRepository(_db);
Attendence = new AttendenceRepository(_db);
EmployeeAllocation = new TaskAllocationRepository(_db);
StatusMaster = new StatusRepository(_db);
ActivityMaster = new ActivityMasterRepository(_db);
EmployeeRoles = new ApplicationRolesRepository(_db);
Features = new FeaturesRepository(_db);
}
public void Save()
{
_db.SaveChanges();
}
}
}

View File

@ -1,22 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Projects;
namespace BulkyBook.DataAccess.Repository
{
public class WorkAreaRepository : Repository<WorkArea>, IWorkAreaRepository
{
private readonly ApplicationDbContext _db;
public WorkAreaRepository(ApplicationDbContext db) : base(db)
{
_db = db;
}
public void Update(WorkArea workArea)
{
_db.WorkAreas.Update(workArea);
}
}
}

View File

@ -1,22 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Activities;
namespace BulkyBook.DataAccess.Repository
{
public class WorkItemMappingReporitury : Repository<WorkItemMapping>, IWorkItemMappingReposiotry
{
private readonly ApplicationDbContext _db;
public WorkItemMappingReporitury(ApplicationDbContext db) : base(db)
{
_db = db;
}
public void Update(WorkItemMapping workItem)
{
_db.WorkItemMapping.Update(workItem);
}
}
}

View File

@ -1,22 +0,0 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Activities;
namespace BulkyBook.DataAccess.Repository
{
public class WorkItemRepository : Repository<WorkItem>, IWorkItemRepository
{
private readonly ApplicationDbContext _db;
public WorkItemRepository(ApplicationDbContext db) : base(db)
{
_db = db;
}
public void Update(WorkItem workItem)
{
_db.WorkItems.Update(workItem);
}
}
}

View File

@ -1,7 +1,7 @@
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Projects;
using MarcoBMS.Utility;
using Marco.Pms.Utility;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;

View File

@ -30,8 +30,8 @@ namespace Marco.Pms.Model.Dtos.Employees
public string? PanNumber { get; set; }
public IFormFile? Photo { get; set; } // To store the captured photo
public List<IFormFile>? Documents { get; set; }
//public IFormFile? Photo { get; set; } // To store the captured photo
//public List<IFormFile>? Documents { get; set; }
public string JobRoleId { get; set; }

View File

@ -3,7 +3,7 @@
public class ProjectAllocationDot
{
public int EmpID { get; set; }
public Guid RoleID { get; set; }
public int JobRoleId { get; set; }
public int ProjectId { get; set; }
public bool Status { get; set; }

View File

@ -14,8 +14,5 @@ namespace Marco.Pms.Model.Dtos
[Required]
[MinLength(6)]
public string NewPassword { get; set; }
[Compare("NewPassword", ErrorMessage = "Passwords do not match.")]
public string ConfirmPassword { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace Marco.Pms.Model.Dtos.Util
{
public class EmailDot
{
public string ToEmail { get; set; }
public string FromEmail { get; set; }
public string MailBody { get; set; }
public string MailSubject { get; set; }
}
}

View File

@ -15,11 +15,15 @@ namespace Marco.Pms.Model.Employees
public string Gender { get; set; }
public DateTime? BirthDate { get; set; }
public DateTime? JoiningDate { get; set; }
public string PeramnentAddress { get; set; }
public string CurrentAddress { get; set; }
public string PhoneNumber { get; set; }
public string EmergencyPhoneNumber { get; set; }
public string EmergencyContactPerson { get; set; }
public string? AadharNumber { get; set; }
@ -34,6 +38,8 @@ namespace Marco.Pms.Model.Employees
[DisplayName("TenantId")]
public int TenantId { get; set; }
public bool IsActive { get; set; } = true;
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }

View File

@ -23,7 +23,6 @@ namespace Marco.Pms.Model.Mapper
Id = new Guid(),
Role = model.Role,
Description = model.Description,
//FeaturePermissions = model.FeaturesPermission,
TenantId = TenantId,
};
}

View File

@ -0,0 +1,35 @@
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.ViewModels.Employee;
namespace Marco.Pms.Model.Mapper
{
public static class EmployeeMapper
{
public static EmployeeVM ToEmployeeVMFromEmployee(this Employee model)
{
return new EmployeeVM
{
Id = model.Id,
FirstName = model.FirstName,
LastName = model.LastName,
MiddleName = model.MiddleName,
Email = model.Email,
CurrentAddress = model.CurrentAddress,
BirthDate = model.BirthDate,
AadharNumber = model.AadharNumber,
ApplicationUserId = model.ApplicationUserId,
EmergencyPhoneNumber = model.EmergencyPhoneNumber,
EmergencyContactPerson = model.EmergencyContactPerson,
Gender = model.Gender,
JobRole = (model.JobRole != null ? model.JobRole.Name : null),
JobRoleId = model.JobRoleId,
PanNumber = model.PanNumber,
PeramnentAddress = model.PeramnentAddress,
PhoneNumber = model.PhoneNumber,
Photo = model.Photo,
IsActive = model.IsActive,
JoiningDate = model.JoiningDate
};
}
}
}

View File

@ -34,6 +34,19 @@ namespace Marco.Pms.Model.Mapper
};
}
public static Project ToProjectFromUpdateProjectDto(this UpdateProjectDto projectModel, int TenantId)
{
return new Project
{
ContactPerson = projectModel.ContactPerson,
ProjectAddress = projectModel.ProjectAddress,
Name = projectModel.Name,
EndDate = projectModel.EndDate,
StartDate = projectModel.StartDate,
TenantId = TenantId,
ProjectStatusId = projectModel.ProjectStatusId
};
}
public static ProjectAllocation ToProjectAllocationFromProjectAllocationDto(this ProjectAllocationDot model, int TenantId)
{
@ -41,7 +54,7 @@ namespace Marco.Pms.Model.Mapper
{
AllocationDate = DateTime.Now,
EmployeeId = model.EmpID,
EmployeeRoleId = model.RoleID,
JobRoleId = model.JobRoleId,
TenantId = TenantId,
ProjectId = model.ProjectId
};

View File

@ -14,7 +14,7 @@ namespace Marco.Pms.Model.Projects
[ValidateNever]
public Employee Employee { get; set; }
public Guid? EmployeeRoleId { get; set; }
public int? JobRoleId { get; set; }
//[ForeignKey("EmployeeRoleId")]
//[ValidateNever]
//public EmployeeRole EmployeeRole { get; set; }

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Marco.Pms.Model.ViewModels.Employee
{
public class EmployeeProfile
{
public EmployeeVM EmployeeInfo { get; set; }
public string[] Projects { get; set; }
public string[] FeaturePermissions { get; set; }
}
}

View File

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Marco.Pms.Model.ViewModels.Employee
{
public class EmployeeVM
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string? MiddleName { get; set; }
public string? Email { get; set; }
public string Gender { get; set; }
public DateTime? BirthDate { get; set; }
public DateTime? JoiningDate { get; set; }
public string PeramnentAddress { get; set; }
public string CurrentAddress { get; set; }
public string PhoneNumber { get; set; }
public string EmergencyPhoneNumber { get; set; }
public string EmergencyContactPerson { get; set; }
public string? AadharNumber { get; set; }
public bool IsActive { get; set; } = true;
public string? PanNumber { get; set; }
public byte[]? Photo { get; set; } // To store the captured photo
public string? ApplicationUserId { get; set; }
public int? JobRoleId { get; set; }
public string JobRole { get; set; }
}
}

View File

@ -1,14 +1,10 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Entitlements;
using MarcoBMS.Services.Service;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace MarcoBMS.Services.Controllers
namespace ModelServices.Controllers
{
[Route("api/[controller]")]
@ -18,17 +14,13 @@ namespace MarcoBMS.Services.Controllers
{
private readonly ApplicationDbContext _context;
private ApplicationUser _applicationUser;
private readonly IEmployeeRepository _empRepo;
private readonly UserManager<IdentityUser> _userManager;
private readonly IEmailSender _emailSender;
public ActivityController(UserManager<IdentityUser> userManager, IEmailSender emailSender, IEmployeeRepository empRepo, ApplicationDbContext context)
public ActivityController(UserManager<IdentityUser> userManager, ApplicationDbContext context)
{
_context = context;
_empRepo = empRepo;
_userManager = userManager;
_emailSender = emailSender;
}
//[HttpPost("checkin")]

View File

@ -1,5 +1,4 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.AttendanceModule;
using Marco.Pms.Model.Dtos.Attendance;
using Marco.Pms.Model.Employees;
@ -7,8 +6,6 @@ using Marco.Pms.Model.Projects;
using Marco.Pms.Model.Utilities;
using Marco.Pms.Model.ViewModels.Attendance;
using MarcoBMS.Services.Helpers;
using MarcoBMS.Services.Service;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.CodeAnalysis;
using Microsoft.EntityFrameworkCore;
@ -20,34 +17,26 @@ namespace MarcoBMS.Services.Controllers
[Route("api/[controller]")]
public class AttendanceController : ControllerBase
{
private readonly IUnitOfWork _unitOfWork;
private readonly ApplicationDbContext _context;
private readonly UserManager<IdentityUser> _userManager;
private readonly IEmailSender _emailSender;
private readonly IAttendenceRepository _attendenceRepository;
private readonly EmployeeHelper _employeeHelper;
private readonly ProjectHelper _projectHelper;
private readonly ProjectsHelper _projectsHelper;
private readonly UserHelper _userHelper;
public AttendanceController(UserManager<IdentityUser> userManager, IEmailSender emailSender, IEmployeeRepository empRepo,
IUnitOfWork unitOfWork, ApplicationDbContext context, IAttendenceRepository attendenceRepository, EmployeeHelper employeeHelper, ProjectHelper projectHelper)
public AttendanceController(
ApplicationDbContext context, EmployeeHelper employeeHelper, ProjectsHelper projectsHelper, UserHelper userHelper)
{
_unitOfWork = unitOfWork;
_context = context;
_userManager = userManager;
_emailSender = emailSender;
_attendenceRepository = attendenceRepository;
_employeeHelper = employeeHelper;
_projectHelper = projectHelper;
_projectsHelper = projectsHelper;
_userHelper = userHelper;
}
private int GetTenantId()
{
var tenant = User.FindFirst("TenantId")?.Value;
return (tenant != null ? Convert.ToInt32(tenant) : 1);
return _userHelper.GetTenantId();
//var tenant = User.FindFirst("TenantId")?.Value;
//return (tenant != null ? Convert.ToInt32(tenant) : 1);
}
private int GetUserId()
{
@ -85,6 +74,73 @@ namespace MarcoBMS.Services.Controllers
}
/// <summary>
///
/// </summary>
/// <param name="projectId">ProjectID</param>
/// <param name="date">YYYY-MM-dd</param>
/// <returns></returns>
[HttpGet("project/log")]
public async Task<IActionResult> EmployeeAttendanceByDateRange([FromQuery] int projectId, [FromQuery] string? dateFrom = null, [FromQuery] string? dateTo = null)
{
int TenantId = GetUserId();
DateTime fromDate = new DateTime();
DateTime toDate = new DateTime();
if (dateFrom != null && DateTime.TryParse(dateFrom, out fromDate) == false)
{
return StatusCode(400, ApiResponse<object>.SuccessResponse(dateFrom, "Invalid Date", 400));// new { error = ex.Message });
}
if (dateTo != null && DateTime.TryParse(dateTo, out toDate) == false)
{
return StatusCode(400, ApiResponse<object>.SuccessResponse(dateTo, "Invalid Date", 400));// new { error = ex.Message });
}
if (projectId <= 0)
{
return BadRequest("Project ID is required and must be greater than zero.");
}
var result = new List<EmployeeAttendanceVM>();
Attendance attendance = null;
if (dateFrom == null) fromDate = DateTime.UtcNow.Date;
if (dateTo == null && dateFrom != null) toDate = fromDate.AddDays(-1);
List<Attendance> lstAttendance = await _context.Attendes.Where(c => c.ProjectID == projectId && c.AttendanceDate.Date <= fromDate && c.AttendanceDate.Date >= toDate && c.TenantId == TenantId).ToListAsync();
List<ProjectAllocation> projectteam = await _projectsHelper.GetTeamByProject(TenantId, projectId, true);
foreach (ProjectAllocation teamMember in projectteam)
{
var result1 = new EmployeeAttendanceVM()
{
EmployeeAvatar = null,
EmployeeId = teamMember.EmployeeId,
FirstName = teamMember.Employee.FirstName,
LastName = teamMember.Employee.LastName
};
attendance = lstAttendance.Find(x => x.EmployeeID == teamMember.EmployeeId);
if (attendance != null)
{
result1.Id = attendance.Id;
result1.CheckInTime = attendance.InTime;
result1.CheckOutTime = attendance.OutTime;
result1.Activity = attendance.Activity;
}
result.Add(result1);
}
return Ok(ApiResponse<object>.SuccessResponse(result, System.String.Format("{0} Attendance records fetched successfully", result.Count), 200));
}
/// <summary>
///
/// </summary>
@ -116,7 +172,7 @@ namespace MarcoBMS.Services.Controllers
List<Attendance> lstAttendance = await _context.Attendes.Where(c => c.ProjectID == projectId && c.AttendanceDate.Date == forDate && c.TenantId == TenantId).ToListAsync();
List<ProjectAllocation> projectteam = await _projectHelper.GetTeamByProject(TenantId, projectId, true);
List<ProjectAllocation> projectteam = await _projectsHelper.GetTeamByProject(TenantId, projectId, true);
foreach (ProjectAllocation teamMember in projectteam)
{
@ -140,6 +196,10 @@ namespace MarcoBMS.Services.Controllers
result.Add(result1);
}
result.Sort(delegate (EmployeeAttendanceVM x, EmployeeAttendanceVM y) {
return x.FirstName.CompareTo(y.FirstName);
});
return Ok(ApiResponse<object>.SuccessResponse(result, System.String.Format("{0} Attendance records fetched successfully", result.Count), 200));
}
@ -210,7 +270,7 @@ namespace MarcoBMS.Services.Controllers
attendance = new Attendance();
attendance.TenantId = TenantId;
attendance.AttendanceDate = recordAttendanceDot.Date;
// attendance.Activity = recordAttendanceDot.Action;
// attendance.Activity = recordAttendanceDot.Action;
attendance.Comment = recordAttendanceDot.Comment;
attendance.EmployeeID = recordAttendanceDot.EmployeeID;
attendance.ProjectID = recordAttendanceDot.ProjectID;

View File

@ -1,10 +1,18 @@
using Marco.Pms.Model.Authentication;
using Marco.Pms.Model.Dtos;
using Marco.Pms.Model.Dtos.Util;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Utilities;
using Marco.Pms.Model.ViewModels.Employee;
using MarcoBMS.Services.Helpers;
using MarcoBMS.Services.Service;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.Data;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System.Net;
namespace MarcoBMS.Services.Controllers
{
@ -15,12 +23,19 @@ namespace MarcoBMS.Services.Controllers
private readonly UserManager<IdentityUser> _userManager;
private readonly JwtSettings _jwtSettings;
private readonly RefreshTokenService _refreshTokenService;
string tenentId = "1";
public AuthController(UserManager<IdentityUser> userManager, JwtSettings jwtSettings, RefreshTokenService refreshTokenService)
private readonly IEmailSender _emailSender;
private readonly IConfiguration _configuration;
private readonly EmployeeHelper _employeeHelper;
//string tenentId = "1";
public AuthController(UserManager<IdentityUser> userManager, JwtSettings jwtSettings, RefreshTokenService refreshTokenService,
IEmailSender emailSender, IConfiguration configuration, EmployeeHelper employeeHelper)
{
_userManager = userManager;
_jwtSettings = jwtSettings;
_refreshTokenService = refreshTokenService;
_emailSender = emailSender;
_configuration = configuration;
_employeeHelper = employeeHelper;
}
[HttpPost("login")]
@ -35,14 +50,15 @@ namespace MarcoBMS.Services.Controllers
return Unauthorized("Invalid username or password.");
}
var token = _refreshTokenService.GenerateJwtToken(user.UserName, tenentId, _jwtSettings);
Employee emp = await _employeeHelper.GetEmployeeByApplicationUserID(user.Id);
//var refreshToken = GenerateRefreshToken();
var refreshToken = await _refreshTokenService.CreateRefreshToken(user.Id, tenentId, _jwtSettings);
var token = _refreshTokenService.GenerateJwtToken(user.UserName, emp.TenantId.ToString(), _jwtSettings);
return Ok(new { token, refreshToken });
var refreshToken = await _refreshTokenService.CreateRefreshToken(user.Id, emp.TenantId.ToString(), _jwtSettings);
return Ok(ApiResponse<object>.SuccessResponse(new { token = token, refreshToken = refreshToken }, "User logged in successfully.", 200));
}
[HttpPost("logout")]
@ -72,7 +88,7 @@ namespace MarcoBMS.Services.Controllers
}
catch (Exception ex)
{
// _logger.LogError(ex, "Error during logout");
// _logger.LogError(ex, "Error during logout");
return StatusCode(500, new { Message = "Internal server error" });
}
}
@ -106,10 +122,15 @@ namespace MarcoBMS.Services.Controllers
// Generate new JWT token and refresh token
var user = await _userManager.FindByIdAsync(refreshToken.UserId);
var newJwtToken = _refreshTokenService.GenerateJwtToken(user.UserName, tenentId, _jwtSettings);
var newRefreshToken = await _refreshTokenService.CreateRefreshToken(user.Id, tenentId, _jwtSettings);
if (user == null)
return BadRequest("Invalid request.");
return Ok(new { token = newJwtToken, refreshToken = newRefreshToken });
Employee emp = await _employeeHelper.GetEmployeeByApplicationUserID(user.Id);
var newJwtToken = _refreshTokenService.GenerateJwtToken(user.UserName, emp.TenantId.ToString(), _jwtSettings);
var newRefreshToken = await _refreshTokenService.CreateRefreshToken(user.Id, emp.TenantId.ToString(), _jwtSettings);
return Ok(ApiResponse<object>.SuccessResponse(new { token = newJwtToken, refreshToken = newRefreshToken }, "User refresh token generated successfully.", 200));
}
[HttpPost("forgot-password")]
@ -118,10 +139,72 @@ namespace MarcoBMS.Services.Controllers
var user = await _userManager.FindByEmailAsync(forgotPasswordDto.Email);
if (user == null) return NotFound("User not found.");
/* SEND USER REGISTRATION MAIL*/
var token = await _userManager.GeneratePasswordResetTokenAsync(user);
var resetLink = $"{_configuration["AppSettings:WebFrontendUrl"]}/reset-password?token={WebUtility.UrlEncode(token)}";
await _emailSender.SendResetPasswordEmail(user.Email, "", resetLink);
return Ok(ApiResponse<object>.SuccessResponse(true, "Password reset link sent.", 200));
}
[HttpPost("reset-password")]
public async Task<IActionResult> ResetPassword([FromBody] ResetPasswordDto model)
{
var user = await _userManager.FindByEmailAsync(model.Email);
if (user == null)
return BadRequest("Invalid request.");
// var isTokenValid = await _userManager.VerifyUserTokenAsync(user,UserManager<ApplicationUser>.ResetPasswordTokenPurpose, model.ResetCode);
var isTokenValid = await _userManager.VerifyUserTokenAsync(
user,
TokenOptions.DefaultProvider, // This is the token provider
UserManager<ApplicationUser>.ResetPasswordTokenPurpose,
WebUtility.UrlDecode( model.Token)
);
if (!isTokenValid)
return BadRequest("Invalid or expired token.");
var result = await _userManager.ResetPasswordAsync(user, WebUtility.UrlDecode(model.Token), model.NewPassword);
if (!result.Succeeded)
return BadRequest(result.Errors);
return Ok(ApiResponse<object>.SuccessResponse(result.Succeeded, "Password reset successfully.", 200));
}
[HttpPost("sendmail")]
public async Task<IActionResult> SendEmail([FromBody] EmailDot emailDot)
{
var user = await _userManager.FindByEmailAsync(emailDot.ToEmail);
if (user == null)
{
return BadRequest("User not found.");
}
/* New User*/
//var token = await _userManager.GeneratePasswordResetTokenAsync(user);
//var resetLink = $"{_configuration["AppSettings:WebFrontendUrl"]}/reset-password?token={WebUtility.UrlEncode(token)}";
//await _emailSender.SendResetPasswordEmailOnRegister(emailDot.ToEmail, "Vikas", resetLink);
/* Forget password*/
// var token = await _userManager.GeneratePasswordResetTokenAsync(user);
var token = await _userManager.GenerateUserTokenAsync(user, TokenOptions.DefaultProvider, "ResetPassword");
var isTokenValid = await _userManager.VerifyUserTokenAsync(user, TokenOptions.DefaultProvider, "ResetPassword", token);
var resetLink = $"{_configuration["AppSettings:WebFrontendUrl"]}/reset-password?token={WebUtility.UrlEncode(token)}";
await _emailSender.SendResetPasswordEmail(user.Email, "", resetLink);
// Send token via email (implementation omitted)
// ...
return Ok("Password reset link sent.");
}

View File

@ -1,17 +1,19 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Dtos.Employees;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Mapper;
using Marco.Pms.Model.Utilities;
using Marco.Pms.Model.ViewModels;
using Marco.Pms.Model.ViewModels.Employee;
using MarcoBMS.Services.Helpers;
using MarcoBMS.Services.Service;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System.Data;
using System.Net;
namespace MarcoBMS.Services.Controllers
{
@ -22,18 +24,23 @@ namespace MarcoBMS.Services.Controllers
public class EmployeeController : ControllerBase
{
private readonly IUnitOfWork _unitOfWork;
private readonly ApplicationDbContext _context;
private readonly UserManager<IdentityUser> _userManager;
private readonly IEmailSender _emailSender;
private readonly EmployeeHelper _employeeHelper;
private readonly UserHelper _userHelper;
private readonly IConfiguration _configuration;
public EmployeeController(UserManager<IdentityUser> userManager, IEmailSender emailSender, IEmployeeRepository empRepo, IUnitOfWork unitOfWork, ApplicationDbContext context)
public EmployeeController(UserManager<IdentityUser> userManager, IEmailSender emailSender,
ApplicationDbContext context, EmployeeHelper employeeHelper, UserHelper userHelper, IConfiguration configuration)
{
_unitOfWork = unitOfWork;
_context = context;
_userManager = userManager;
_emailSender = emailSender;
_employeeHelper = employeeHelper;
_userHelper = userHelper;
_configuration = configuration;
}
[HttpGet]
@ -99,11 +106,25 @@ namespace MarcoBMS.Services.Controllers
}
await _context.SaveChangesAsync();
}
catch (Exception ex) {
catch (Exception ex)
{
}
return Ok(ApiResponse<object>.SuccessResponse("success", "Roles modified.", 200));
}
[HttpGet]
[Route("list/{projectid?}")]
public async Task<IActionResult> GetEmployeesByProject(int? projectid)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
var result = await _employeeHelper.GetEmployeeByProjectId(GetTenantId(), projectid);
return Ok(ApiResponse<object>.SuccessResponse(result, "Filter applied.", 200));
}
[HttpGet]
[Route("search/{name}/{projectid?}")]
public async Task<IActionResult> SearchEmployee(string name, int? projectid)
@ -112,98 +133,37 @@ namespace MarcoBMS.Services.Controllers
{
return BadRequest(ModelState);
}
int TenantId = GetTenantId();
name = name.ToLower();
int tenantId = GetTenantId();
List<Employee> employees = await _unitOfWork.Employee.GetAsync(c => c.TenantId == tenantId && (c.FirstName.ToLower().StartsWith(name)
|| c.MiddleName.ToLower().StartsWith(name) || c.LastName.ToLower().StartsWith(name)));
employees = employees.Where(c => c.FirstName.ToLower().StartsWith(name)
|| c.MiddleName.ToLower().StartsWith(name) || c.LastName.ToLower().StartsWith(name)).ToList();
if (projectid != null)
{
// conditions to e checked after project assignment
}
return Ok(ApiResponse<object>.SuccessResponse(employees, "Filter applied.", 200));
var result = await _employeeHelper.SearchEmployeeByProjectId(GetTenantId(), name.ToLower(), projectid);
return Ok(ApiResponse<object>.SuccessResponse(result, "Filter applied.", 200));
}
[HttpGet]
[Route("get/{projectid?}")]
public async Task<IActionResult> GetEmployee(int? projectid)
[Route("profile/get/{employeeId}")]
public async Task<IActionResult> GetEmployeeProfileById(int employeeId)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
int TenantId = GetTenantId();
List<Employee> employees = await _unitOfWork.Employee.GetAsync(c => c.TenantId == TenantId);
Employee emp = await _employeeHelper.GetEmployeeByID(employeeId);
EmployeeVM employeeVM = EmployeeMapper.ToEmployeeVMFromEmployee(emp);
employees = employees.Where(c => c.TenantId == TenantId).ToList();
if (projectid != null)
{
// Fetch assigned project
}
return Ok(employees);
return Ok(ApiResponse<object>.SuccessResponse(employeeVM, "Employee Profile.", 200));
}
//[HttpGet]
//[Route("attendance/project/{projectid?}")]
//public async Task<IActionResult> GetAttendanceList(int? projectid)
//{
// if (!ModelState.IsValid)
// {
// return BadRequest(ModelState);
// }
// int TenantId = GetTenantId();
// DateTime today = DateTime.Today;
// var result = from employee in _context.ProjectAllocations
// join attendance in _context.Attendances
// on employee.Id equals attendance.EmployeeID into attendanceGroup
// from todayAttendance in attendanceGroup
// //.Where(a => a.InTimeLog.InTime == today)
// .DefaultIfEmpty() // LEFT JOIN
// select new
// {
// ProjectID = projectid,
// EmployeeId = employee.Id,
// FirstName = employee.Employee.FirstName,
// MiddleName = employee.Employee.MiddleName,
// LastName = employee.Employee.LastName,
// PhoneNumber = employee.Employee.PhoneNumber,
// RoleId = employee.Employee.JobRoleId,
// //InTime = todayAttendance.InTimeLog != null ? todayAttendance.InTimeLog.InTime : (DateTime?)null,
// //OutTime = todayAttendance.OutTimeLog != null ? todayAttendance.OutTimeLog.OutTime : (DateTime?)null,
// // WorkShift = todayAttendance.WorkShift,
// Latitude = todayAttendance.InTimeLog != null ? todayAttendance.InTimeLog.Latitude : null,
// Longitude = todayAttendance.InTimeLog != null ? todayAttendance.InTimeLog.Longitude : null,
// Comment = todayAttendance.Comment,
// };
// return Ok(result);
//}
private int GetTenantId()
{
var tenant = User.FindFirst("TenantId")?.Value;
return (tenant != null ? Convert.ToInt32(tenant) : 1);
return _userHelper.GetTenantId();
}
[HttpPost("manage/quick")]
public async Task<IActionResult> CreateQuickUser([FromBody] CreateQuickUserDto model)
{
return Ok("Pending implementation");
}
//[HttpPost("manage/quick")]
//public async Task<IActionResult> CreateQuickUser([FromBody] CreateQuickUserDto model)
//{
// return Ok("Pending implementation");
//}
[HttpPost("manage")]
public async Task<IActionResult> CreateUser([FromForm] CreateUserDto model)
{
@ -211,144 +171,138 @@ namespace MarcoBMS.Services.Controllers
return BadRequest("Invalid user data.");
int TenantId = GetTenantId();
string responsemessage = "";
if (model.Email != null)
{
// Check if user already exists by email
var existingUser = await _userManager.FindByEmailAsync(model.Email);
IdentityUser? existingUser = await _userHelper.GetRegisteredUser(model.Email);
if (existingUser != null)
{
// Update existing user
//existingUser.Email = model.Email; // No need to update email
//var updateResult = await _userManager.UpdateAsync(existingUser);
//if (!updateResult.Succeeded)
// return BadRequest(updateResult.Errors);
/* Identity user Exists - Create/update employee Employee */
// Update Employee record
var existingEmployee = await _context.Employees.FirstOrDefaultAsync(e => e.ApplicationUserId == existingUser.Id);
var existingEmployee = await _context.Employees.FirstOrDefaultAsync(e => e.ApplicationUserId == existingUser.Id || e.Email == model.Email || e.Id == model.Id);
if (existingEmployee != null)
{
existingEmployee.FirstName = model.FirstName;
existingEmployee.LastName = model.LastName;
existingEmployee.TenantId = TenantId;
existingEmployee.Email = model.Email;
existingEmployee.JobRoleId = Convert.ToInt32(model.JobRoleId);
existingEmployee = GetUpdateEmployeeModel(model, existingEmployee, existingUser);
_context.Employees.Update(existingEmployee);
}
else
{
// Create Employee record if missing
var newEmployee = new Employee
{
ApplicationUserId = existingUser.Id,
FirstName = model.FirstName,
LastName = model.LastName,
Email = model.Email,
TenantId = TenantId,
CurrentAddress = model.CurrentAddress,
BirthDate = Convert.ToDateTime(model.BirthDate),
EmergencyPhoneNumber = model.EmergencyPhoneNumber,
AadharNumber = model.AadharNumber,
Gender = model.Gender,
MiddleName = model.MiddleName,
PanNumber = model.PanNumber,
PeramnentAddress = model.PeramnentAddress,
PhoneNumber = model.PhoneNumber,
Photo = GetFileDetails(model.Photo).Result.FileData,
JobRoleId = Convert.ToInt32(model.JobRoleId)
};
Employee newEmployee = GetNewEmployeeModel(model, TenantId, existingUser.Id);
_context.Employees.Add(newEmployee);
}
await _context.SaveChangesAsync();
return Ok(new { message = "User updated successfully." });
responsemessage = "User updated successfully.";
}
var user = new ApplicationUser
else
{
UserName = model.Email,
Email = model.Email,
EmailConfirmed = true
};
var user = new ApplicationUser
{
UserName = model.Email,
Email = model.Email,
EmailConfirmed = true
};
// Create Identity User
var result = await _userManager.CreateAsync(user, "User@123");
if (!result.Succeeded)
return BadRequest(result.Errors);
// Create Identity User
var result = await _userManager.CreateAsync(user, "User@123");
if (!result.Succeeded)
return BadRequest(result.Errors);
// Save Employee Data
var employee = new Employee
{
FirstName = model.FirstName,
LastName = model.LastName,
Email = model.Email,
TenantId = TenantId,
CurrentAddress = model.CurrentAddress,
BirthDate = Convert.ToDateTime(model.BirthDate),
EmergencyPhoneNumber = model.EmergencyPhoneNumber,
AadharNumber = model.AadharNumber,
Gender = model.Gender,
MiddleName = model.MiddleName,
PanNumber = model.PanNumber,
PeramnentAddress = model.PeramnentAddress,
PhoneNumber = model.PhoneNumber,
Photo = GetFileDetails(model.Photo).Result.FileData,
JobRoleId = Convert.ToInt32(model.JobRoleId)
};
_context.Employees.Add(employee);
await _context.SaveChangesAsync();
Employee newEmployee = GetNewEmployeeModel(model, TenantId, user.Id);
_context.Employees.Add(newEmployee);
var token = await _userManager.GeneratePasswordResetTokenAsync(user);
var resetLink = Url.Action("ResetPassword", "Account", new { token, email = user.Email }, Request.Scheme);
await _context.SaveChangesAsync();
// Send Email
await _emailSender.SendEmailAsync(user.Email, "Set Password", $"Click here to set your password: {resetLink}");
/* SEND USER REGISTRATION MAIL*/
var token = await _userManager.GeneratePasswordResetTokenAsync(user);
var resetLink = $"{_configuration["AppSettings:WebFrontendUrl"]}/reset-password?token={WebUtility.UrlEncode(token)}";
await _emailSender.SendResetPasswordEmailOnRegister(user.Email, newEmployee.FirstName, resetLink);
responsemessage = "User created successfully. PAssword reset link is sent to registered email";
}
}
else
{
var existingEmployee = await _context.Employees.FirstOrDefaultAsync(e => e.Id == model.Id);
if (existingEmployee != null)
{
existingEmployee.FirstName = model.FirstName;
existingEmployee.LastName = model.LastName;
existingEmployee.TenantId = TenantId;
existingEmployee = GetUpdateEmployeeModel(model, existingEmployee);
_context.Employees.Update(existingEmployee);
responsemessage = "User updated successfully.";
}
else
{
// Create Employee record if missing
var newEmployee = new Employee
{
ApplicationUserId = null,
FirstName = model.FirstName,
LastName = model.LastName,
TenantId = TenantId,
CurrentAddress = model.CurrentAddress,
BirthDate = Convert.ToDateTime(model.BirthDate),
EmergencyPhoneNumber = model.EmergencyPhoneNumber,
AadharNumber = model.AadharNumber,
Gender = model.Gender,
MiddleName = model.MiddleName,
PanNumber = model.PanNumber,
PeramnentAddress = model.PeramnentAddress,
PhoneNumber = model.PhoneNumber,
Photo = GetFileDetails(model.Photo).Result.FileData
Employee newEmployee = GetNewEmployeeModel(model, TenantId, null);
};
_context.Employees.Add(newEmployee);
}
await _context.SaveChangesAsync();
responsemessage = "User created successfully.";
}
// Generate Password Reset Link
return Ok(new { message = responsemessage });
}
private static Employee GetNewEmployeeModel(CreateUserDto model, int TenantId, string? ApplicationUserId)
{
var newEmployee = new Employee
{
ApplicationUserId = ApplicationUserId,
FirstName = model.FirstName,
LastName = model.LastName,
Email = model.Email,
TenantId = TenantId,
CurrentAddress = model.CurrentAddress,
BirthDate = Convert.ToDateTime(model.BirthDate),
EmergencyPhoneNumber = model.EmergencyPhoneNumber,
EmergencyContactPerson = model.EmergencyContactPerson,
AadharNumber = model.AadharNumber,
Gender = model.Gender,
MiddleName = model.MiddleName,
PanNumber = model.PanNumber,
PeramnentAddress = model.PeramnentAddress,
PhoneNumber = model.PhoneNumber,
Photo = null, // GetFileDetails(model.Photo).Result.FileData,
JobRoleId = Convert.ToInt32(model.JobRoleId),
JoiningDate = Convert.ToDateTime(model.JoiningDate),
return Ok(new { message = "User created successfully. Password reset link sent." });
};
return newEmployee;
}
private static Employee GetUpdateEmployeeModel(CreateUserDto model, Employee existingEmployee, IdentityUser? existingIdentityUser = null)
{
if (existingEmployee.ApplicationUserId == null && existingIdentityUser != null)
{
existingEmployee.ApplicationUserId = existingIdentityUser.Id;
}
existingEmployee.FirstName = model.FirstName;
existingEmployee.LastName = model.LastName;
existingEmployee.CurrentAddress = model.CurrentAddress;
existingEmployee.BirthDate = Convert.ToDateTime(model.BirthDate);
existingEmployee.JoiningDate = Convert.ToDateTime(model.JoiningDate);
existingEmployee.EmergencyPhoneNumber = model.EmergencyPhoneNumber;
existingEmployee.EmergencyContactPerson = model.EmergencyContactPerson;
existingEmployee.AadharNumber = model.AadharNumber;
existingEmployee.Gender = model.Gender;
existingEmployee.MiddleName = model.MiddleName;
existingEmployee.PanNumber = model.PanNumber;
existingEmployee.PeramnentAddress = model.PeramnentAddress;
existingEmployee.PhoneNumber = model.PhoneNumber;
existingEmployee.Photo = null; // GetFileDetails(model.Photo).Result.FileData,
existingEmployee.JobRoleId = Convert.ToInt32(model.JobRoleId);
return existingEmployee;
}
private static async Task<FileDetails> GetFileDetails(IFormFile file)

View File

@ -40,16 +40,16 @@ namespace MarcoBMS.Services.Controllers
return imageName;
}
[HttpPost("manage1")]
public async Task<IActionResult> CreateUser_1([FromForm] CreateUserDto model)
{
if (model == null)
return BadRequest("Invalid user data.");
//[HttpPost("manage1")]
//public async Task<IActionResult> CreateUser_1([FromForm] CreateUserDto model)
//{
// if (model == null)
// return BadRequest("Invalid user data.");
await GetFileDetails(model.Photo);
// await GetFileDetails(model.Photo);
return Ok(new { message = "User created successfully. Password reset link sent." });
}
// return Ok(new { message = "User created successfully. Password reset link sent." });
//}
private static async Task<FileDetails> GetFileDetails(IFormFile file)
{

View File

@ -1,6 +1,4 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Activities;
using Marco.Pms.Model.Dtos.Project;
using Marco.Pms.Model.Employees;
@ -9,6 +7,8 @@ using Marco.Pms.Model.Mapper;
using Marco.Pms.Model.Projects;
using Marco.Pms.Model.Utilities;
using Marco.Pms.Model.ViewModels;
using Marco.Pms.Model.ViewModels.Employee;
using MarcoBMS.Services.Helpers;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
@ -21,19 +21,21 @@ namespace MarcoBMS.Services.Controllers
[Authorize]
public class ProjectController : ControllerBase
{
private readonly IUnitOfWork _unitOfWork;
//private readonly IUnitOfWork _unitOfWork;
private readonly ApplicationDbContext _context;
private ApplicationUser _applicationUser;
private readonly IProjectRepository _projectrepo;
// private readonly IProjectRepository _projectrepo;
private readonly UserManager<IdentityUser> _userManager;
private readonly UserHelper _userHelper;
public ProjectController(UserManager<IdentityUser> userManager, IProjectRepository projectrepo, IUnitOfWork unitOfWork, ApplicationDbContext context)
public ProjectController(UserManager<IdentityUser> userManager, ApplicationDbContext context, UserHelper userHelper)
{
_unitOfWork = unitOfWork;
//_unitOfWork = unitOfWork;
_context = context;
_projectrepo = projectrepo;
//_projectrepo = projectrepo;
_userManager = userManager;
_userHelper = userHelper;
}
[HttpGet("list")]
public async Task<IActionResult> GetAll()
@ -42,8 +44,7 @@ namespace MarcoBMS.Services.Controllers
{
return BadRequest(ModelState);
}
List<Project> project = await _projectrepo.GetAllAsync();
// var commentDto = comments.Select(x => x.ToCommentDto());
List<Project> project = await _context.Projects.Where(c=>c.TenantId == _userHelper.GetTenantId()).ToListAsync();
return Ok(project);
}
@ -56,9 +57,7 @@ namespace MarcoBMS.Services.Controllers
return BadRequest(ModelState);
}
var project = _projectrepo.Get(c => c.Id == id); //_context.Stock.FindAsync(id);
// List<Project> project = await _projectrepo.GetAsync(id);
var project = await _context.Projects.Where(c => c.TenantId == _userHelper.GetTenantId() && c.Id == id).SingleOrDefaultAsync();
return Ok(project);
}
@ -73,19 +72,17 @@ namespace MarcoBMS.Services.Controllers
return BadRequest(ModelState);
}
var projects = await _projectrepo.GetAsync((c => c.Id == id), includeProperties: "ProjectStatus,Tenant"); //_context.Stock.FindAsync(id);
var project = await _context.Projects.Where(c => c.TenantId == _userHelper.GetTenantId() && c.Id == id).Include(c=> c.ProjectStatus).SingleOrDefaultAsync(); // includeProperties: "ProjectStatus,Tenant"); //_context.Stock.FindAsync(id);
if (projects == null)
if (project == null)
{
//vm.project = new Project();
//vm.buildings = new List<Building>();
//vm.floors = new List<Floor>();
//vm.workAreas = new List<WorkArea>();
return Ok(new ProjectVM());
}
else
{
var project = projects.Where(c => c.Id == id).SingleOrDefault();
ProjectDetailsVM vm = GetProjectViewModel(id, project);
//var project = projects.Where(c => c.Id == id).SingleOrDefault();
ProjectDetailsVM vm = await GetProjectViewModel(id, project);
ProjectVM projectVM = new ProjectVM();
projectVM.Id = vm.project.Id;
@ -132,25 +129,26 @@ namespace MarcoBMS.Services.Controllers
return Ok(projectVM);
}
return Ok(new ProjectVM());
}
private ProjectDetailsVM GetProjectViewModel(int? id, Project project)
private async Task<ProjectDetailsVM> GetProjectViewModel(int? id, Project project)
{
ProjectDetailsVM vm = new ProjectDetailsVM();
// List<Building> buildings = _unitOfWork.Building.GetAll(c => c.ProjectId == id).ToList();
List<Building> buildings = _context.Buildings.Where(c => c.ProjectId == id).ToList();
List<Building> buildings = await _context.Buildings.Where(c => c.ProjectId == id).ToListAsync();
List<int> idList = buildings.Select(o => o.Id).ToList();
// List<Floor> floors = _unitOfWork.Floor.GetAll(c => idList.Contains(c.Id)).ToList();
List<Floor> floors = _context.Floor.Where(c => idList.Contains(c.BuildingId)).ToList();
List<Floor> floors = await _context.Floor.Where(c => idList.Contains(c.BuildingId)).ToListAsync();
idList = floors.Select(o => o.Id).ToList();
//List<WorkArea> workAreas = _unitOfWork.WorkArea.GetAll(c => idList.Contains(c.Id), includeProperties: "WorkItems,WorkItems.ActivityMaster").ToList();
List<WorkArea> workAreas = _context.WorkAreas.Where(c => idList.Contains(c.FloorId)).ToList();
List<WorkArea> workAreas = await _context.WorkAreas.Where(c => idList.Contains(c.FloorId)).ToListAsync();
idList = floors.Select(o => o.Id).ToList();
List<WorkItem> workItems = _unitOfWork.WorkItem.GetAll(c => idList.Contains(c.WorkAreaId), includeProperties: "ActivityMaster").ToList();
List<WorkItem> workItems = await _context.WorkItems.Where(c => idList.Contains(c.WorkAreaId)).Include(c=>c.ActivityMaster).ToListAsync();
// List <WorkItem> workItems = _unitOfWork.WorkItem.GetAll(c => idList.Contains(c.WorkAreaId), includeProperties: "ActivityMaster").ToList();
vm.project = project;
vm.buildings = buildings;
@ -163,8 +161,9 @@ namespace MarcoBMS.Services.Controllers
private int GetTenantId()
{
var tenant = User.FindFirst("TenantId")?.Value;
return (tenant != null ? Convert.ToInt32(tenant) : 1);
return _userHelper.GetTenantId();
//var tenant = User.FindFirst("TenantId")?.Value;
//return (tenant != null ? Convert.ToInt32(tenant) : 1);
}
[HttpPost]
@ -176,26 +175,13 @@ namespace MarcoBMS.Services.Controllers
}
int TenantId = GetTenantId();
var projectModel = projectDto.ToProjectFromCreateProjectDto(TenantId);
var project = projectDto.ToProjectFromCreateProjectDto(TenantId);
var result = await _projectrepo.CreateAsync(projectModel);
_context.Projects.Add(project);
return Ok(result);
await _context.SaveChangesAsync();
}
[HttpGet("get-allocation/{projectId:int}")]
public async Task<IActionResult> GetAllocation([FromRoute] int projectId)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
List<ProjectAllocation> allocations = await _unitOfWork.ProjectAllocation.GetAsync(c => c.ProjectId == projectId);
allocations = allocations.Where(c => c.ProjectId == projectId).ToList();
return Ok(allocations);
return Ok(ApiResponse<object>.SuccessResponse(project.ToProjectDto(), "Success.", 200));
}
[HttpPut]
@ -210,13 +196,14 @@ namespace MarcoBMS.Services.Controllers
{
int TenantId = GetTenantId();
updateProjectDto.TenantId = TenantId;
var projectModel = await _projectrepo.UpdateAsync(id, updateProjectDto);
if (projectModel == null)
{
return NotFound("Project not found");
}
return Ok(projectModel.ToProjectDto());
Project project = updateProjectDto.ToProjectFromUpdateProjectDto(TenantId);
_context.Projects.Update(project);
await _context.SaveChangesAsync();
return Ok(ApiResponse<object>.SuccessResponse(project.ToProjectDto(), "Success.", 200));
}
catch (Exception ex)
{
@ -225,49 +212,96 @@ namespace MarcoBMS.Services.Controllers
}
[HttpPost("assign-employee")]
public async Task<IActionResult> AssignEmployee(int? allocationid, int employeeId, int projectId)
//[HttpPost("assign-employee")]
//public async Task<IActionResult> AssignEmployee(int? allocationid, int employeeId, int projectId)
//{
// var employee = await _context.Employees.FindAsync(employeeId);
// var project = _projectrepo.Get(c => c.Id == projectId);
// if (employee == null || project == null)
// {
// return NotFound();
// }
// // Logic to add the product to a new table (e.g., selected products)
// if (allocationid == null)
// {
// // Add allocation
// ProjectAllocation allocation = new ProjectAllocation()
// {
// EmployeeId = employeeId,
// ProjectId = project.Id,
// AllocationDate = DateTime.UtcNow,
// //EmployeeRole = employee.Rol
// TenantId = project.TenantId
// };
// _unitOfWork.ProjectAllocation.CreateAsync(allocation);
// }
// else
// {
// //remove allocation
// var allocation = await _context.ProjectAllocations.FindAsync(allocationid);
// if (allocation != null)
// {
// allocation.ReAllocationDate = DateTime.UtcNow;
// _unitOfWork.ProjectAllocation.UpdateAsync(allocation.Id, allocation);
// }
// else
// {
// return NotFound();
// }
// }
// return Ok();
//}
[HttpGet]
[Route("employees/get/{projectid?}/{includeInactive?}")]
public async Task<IActionResult> GetEmployeeByProjectID(int? projectid, bool? includeInactive = false)
{
var employee = await _context.Employees.FindAsync(employeeId);
var project = _projectrepo.Get(c => c.Id == projectId);
if (employee == null || project == null)
if (!ModelState.IsValid)
{
return NotFound();
return BadRequest(ModelState);
}
int TenantId = GetTenantId();
// Logic to add the product to a new table (e.g., selected products)
if (allocationid == null)
if (projectid != null)
{
// Add allocation
ProjectAllocation allocation = new ProjectAllocation()
{
EmployeeId = employeeId,
ProjectId = project.Id,
AllocationDate = DateTime.UtcNow,
//EmployeeRole = employee.Rol
TenantId = project.TenantId
};
// Fetch assigned project
List<Employee> result = new List<Employee>();
_unitOfWork.ProjectAllocation.CreateAsync(allocation);
if ((bool)includeInactive)
{
result = await (from rpm in _context.Employees.Include(c => c.JobRole)
join fp in _context.ProjectAllocations.Where(c => c.TenantId == TenantId && c.ProjectId == projectid)
on rpm.Id equals fp.EmployeeId
select rpm).ToListAsync();
}else
{
result = await (from rpm in _context.Employees.Include(c => c.JobRole)
join fp in _context.ProjectAllocations.Where(c => c.TenantId == TenantId && c.ProjectId == projectid && c.IsActive == true)
on rpm.Id equals fp.EmployeeId
select rpm).ToListAsync();
}
List<EmployeeVM> resultVM = new List<EmployeeVM>();
foreach (Employee employee in result)
{
EmployeeVM vm = employee.ToEmployeeVMFromEmployee();
resultVM.Add(vm);
}
return Ok(ApiResponse<object>.SuccessResponse(resultVM, "Success.", 200));
}
else
{
//remove allocation
var allocation = await _context.ProjectAllocations.FindAsync(allocationid);
if (allocation != null)
{
allocation.ReAllocationDate = DateTime.UtcNow;
_unitOfWork.ProjectAllocation.UpdateAsync(allocation.Id, allocation);
}
else
{
return NotFound();
}
return Ok(ApiResponse<object>.ErrorResponse("Invalid Input Parameter", 422));
}
return Ok();
}
[HttpGet]
@ -280,25 +314,25 @@ namespace MarcoBMS.Services.Controllers
}
int TenantId = GetTenantId();
var employees = await _context.ProjectAllocations.Where(c => c.TenantId == TenantId && c.ProjectId == projectId ).Include(e => e.Employee).Select(e=> new
var employees = await _context.ProjectAllocations.Where(c => c.TenantId == TenantId && c.ProjectId == projectId).Include(e => e.Employee).Include(e => e.Employee.JobRole).Select(e => new
{
ID = e.Id,
EmployeeId = e.EmployeeId,
ProjectId = e.ProjectId,
RoleID = e.EmployeeRoleId,
AllocationDate = e.AllocationDate,
ReAllocationDate = e.ReAllocationDate,
FirstName = e.Employee.FirstName,
LastName = e.Employee.LastName,
MiddleName = e.Employee.MiddleName,
IsActive = e.IsActive
IsActive = e.IsActive,
JobRoleId = (e.JobRoleId != null ? e.JobRoleId : e.Employee.JobRoleId)
}).ToListAsync();
return Ok(ApiResponse<object>.SuccessResponse(employees, "Success.", 200));
}
[HttpPost("allocation")]
[HttpPost("allocation")]
public async Task<IActionResult> ManageAllocation(List<ProjectAllocationDot> projectAllocationDot)
{
if (projectAllocationDot != null)
@ -310,7 +344,7 @@ namespace MarcoBMS.Services.Controllers
try
{
ProjectAllocation projectAllocation = item.ToProjectAllocationFromProjectAllocationDto(TenentID);
ProjectAllocation projectAllocationFromDb =await _context.ProjectAllocations.Where(c => c.EmployeeId == projectAllocation.EmployeeId
ProjectAllocation projectAllocationFromDb = await _context.ProjectAllocations.Where(c => c.EmployeeId == projectAllocation.EmployeeId
&& c.ProjectId == projectAllocation.ProjectId
&& c.ReAllocationDate == null
&& c.TenantId == TenentID).SingleOrDefaultAsync();
@ -321,11 +355,10 @@ namespace MarcoBMS.Services.Controllers
if (item.Status)
{
projectAllocationFromDb.EmployeeRoleId = projectAllocation.EmployeeRoleId; ;
projectAllocationFromDb.JobRoleId = projectAllocation.JobRoleId; ;
projectAllocationFromDb.IsActive = true;
_context.Entry(projectAllocationFromDb).Property(e => e.EmployeeRoleId).IsModified = true;
_context.Entry(projectAllocationFromDb).Property(e => e.JobRoleId).IsModified = true;
_context.Entry(projectAllocationFromDb).Property(e => e.IsActive).IsModified = true;
}
else
{
@ -333,7 +366,6 @@ namespace MarcoBMS.Services.Controllers
projectAllocationFromDb.IsActive = false;
_context.Entry(projectAllocationFromDb).Property(e => e.ReAllocationDate).IsModified = true;
_context.Entry(projectAllocationFromDb).Property(e => e.IsActive).IsModified = true;
}
await _context.SaveChangesAsync();
@ -371,20 +403,15 @@ namespace MarcoBMS.Services.Controllers
if (item.Id > 0)
{
//update
_unitOfWork.WorkItem.Update(workItem);
_context.WorkItems.Update(workItem);
await _context.SaveChangesAsync();
}
else
{
//create
_unitOfWork.WorkItem.Add(workItem);
_context.WorkItems.Add(workItem);
await _context.SaveChangesAsync();
}
_unitOfWork.Save();
}
return Ok(ApiResponse<object>.SuccessResponse(null, "Data saved successfully.", 200));
@ -410,15 +437,15 @@ namespace MarcoBMS.Services.Controllers
if (item.Building.Id == 0)
{
//create
_unitOfWork.Building.Add(building);
_context.Buildings.Add(building);
await _context.SaveChangesAsync();
}
else
{
//update
_unitOfWork.Building.Update(building);
_context.Buildings.Update(building);
await _context.SaveChangesAsync();
}
_unitOfWork.Save();
}
if (item.Floor != null)
{
@ -428,16 +455,15 @@ namespace MarcoBMS.Services.Controllers
if (item.Floor.Id == 0)
{
//create
_unitOfWork.Floor.Add(floor);
_context.Floor.Add(floor);
await _context.SaveChangesAsync();
}
else
{
//update
_unitOfWork.Floor.Update(floor);
_context.Floor.Update(floor);
await _context.SaveChangesAsync();
}
_unitOfWork.Save();
}
if (item.WorkArea != null)
{
@ -447,15 +473,15 @@ namespace MarcoBMS.Services.Controllers
if (item.WorkArea.Id == 0)
{
//create
_unitOfWork.WorkArea.Add(workArea);
_context.WorkAreas.Add(workArea);
await _context.SaveChangesAsync();
}
else
{
//update
_unitOfWork.WorkArea.Update(workArea);
_context.WorkAreas.Update(workArea);
await _context.SaveChangesAsync();
}
_unitOfWork.Save();
}
}
}

View File

@ -1,9 +1,11 @@
using Marco.Pms.DataAccess.Data;
using Azure;
using Marco.Pms.DataAccess.Data;
using Marco.Pms.Model.Dtos.Roles;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Mapper;
using Marco.Pms.Model.Utilities;
using Marco.Pms.Model.ViewModels;
using MarcoBMS.Services.Helpers;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
@ -18,13 +20,16 @@ namespace MarcoBMS.Services.Controllers
public class RolesController : ControllerBase
{
private readonly ApplicationDbContext _context;
private readonly RolesHelper _rolesHelper;
private readonly UserManager<IdentityUser> _userManager;
public RolesController(UserManager<IdentityUser> userManager, ApplicationDbContext context)
public RolesController(UserManager<IdentityUser> userManager, ApplicationDbContext context, RolesHelper rolesHelper)
{
_context = context;
_userManager = userManager;
_rolesHelper = rolesHelper;
}
@ -154,8 +159,7 @@ namespace MarcoBMS.Services.Controllers
}
return Ok(applicationRoles);
return Ok(ApiResponse<object>.SuccessResponse(applicationRoles, "Roles list fetched successfully.", 200));
}
@ -214,21 +218,34 @@ namespace MarcoBMS.Services.Controllers
return NotFound("Project not found");
}
bool modified = false;
foreach (var permission in updateRoleDto.FeaturesPermission)
{
var item = new RolePermissionMappings() { ApplicationRoleId = role.Id, FeaturePermissionId = permission.Id };
bool assigned = _context.RolePermissionMappings.Any(c => c.ApplicationRoleId == role.Id && c.FeaturePermissionId == permission.Id);
if (permission.IsEnabled && !assigned)
_context.RolePermissionMappings.Add(item);
else
if (permission.IsEnabled == false && assigned == true)
{
_context.RolePermissionMappings.Remove(item);
modified = true;
}
else if (permission.IsEnabled && !assigned)
{
_context.RolePermissionMappings.Add(item);
modified = true;
}
}
return Ok(role.ToRoleVMFromApplicationRole());
if (modified)
await _context.SaveChangesAsync();
ApplicationRolesVM response = role.ToRoleVMFromApplicationRole();
List<FeaturePermission> permissions = await _rolesHelper.GetFeaturePermissionByRoleID(response.Id);
response.FeaturePermission = permissions.Select(c => c.ToFeaturePermissionVMFromFeaturePermission()).ToList();
return Ok(ApiResponse<object>.SuccessResponse(response, "Roles perimssions updated.", 200));
}
catch (Exception ex)
{
return Ok(null);
return Ok(ApiResponse<object>.ErrorResponse( "RUnable to update roles perimssions.", 200));
}
}
@ -269,7 +286,8 @@ namespace MarcoBMS.Services.Controllers
FeaturePermission = featurePermissions
};
return Ok(vm);
return Ok(ApiResponse<object>.SuccessResponse(vm, "Roles Perimssions fetched successfully.", 200));
}
}
}

View File

@ -1,8 +1,6 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.DataAccess.Repository.IRepository;
using Marco.Pms.Model.Entitlements;
using MarcoBMS.Services.Helpers;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
@ -13,32 +11,23 @@ namespace MarcoBMS.Services.Controllers
[ApiController]
public class TaskController : ControllerBase
{
private readonly IUnitOfWork _unitOfWork;
private readonly ApplicationDbContext _context;
private ApplicationUser _applicationUser;
private readonly IActivityMasterRepository _activityRepo;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly UserHelper _userHelper;
public TaskController(IActivityMasterRepository activityRepo, IUnitOfWork unitOfWork, ApplicationDbContext context, IHttpContextAccessor httpContextAccessor)
public TaskController(ApplicationDbContext context, UserHelper userHelper)
{
_unitOfWork = unitOfWork;
_context = context;
_activityRepo = activityRepo;
_httpContextAccessor = httpContextAccessor;
_userHelper = userHelper;
}
[HttpGet]
[Route("activities")]
public async Task<IActionResult> GetActivities()
{
var tenantId = _httpContextAccessor.HttpContext?.Items["TenantId"]?.ToString();
var activities = await _activityRepo.GetAllAsync(c=>c.TenantId == Convert.ToInt32( tenantId));
var activities = await _context.ActivityMasters.Where(c => c.TenantId == _userHelper.GetTenantId()).ToListAsync();
return Ok(activities);
}
}
}

View File

@ -0,0 +1,68 @@
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Mapper;
using Marco.Pms.Model.Projects;
using Marco.Pms.Model.ViewModels.Employee;
using MarcoBMS.Services.Helpers;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace MarcoBMS.Services.Controllers
{
[Route("api/[controller]")]
[ApiController]
[Authorize]
public class UserController : ControllerBase
{
private readonly UserHelper _userHelper;
private readonly EmployeeHelper _employeeHelper;
private readonly ProjectsHelper _projectsHelper;
private readonly RolesHelper _rolesHelper;
public UserController(EmployeeHelper employeeHelper, ProjectsHelper projectsHelper, UserHelper userHelper, RolesHelper rolesHelper)
{
_userHelper = userHelper;
_employeeHelper = employeeHelper;
_projectsHelper = projectsHelper;
_rolesHelper = rolesHelper;
}
[HttpGet("profile")]
public async Task<IActionResult> GetUserProfileFromJwt()
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
var user = await _userHelper.GetCurrentUserAsync();
Employee emp = await _employeeHelper.GetEmployeeByApplicationUserID(user.Id);
List<FeaturePermission> featurePermission = await _rolesHelper.GetFeaturePermissionByEmployeeID(emp.Id);
string[] projectsId = [];
if (featurePermission != null && featurePermission.Exists(c => c.FeatureId.ToString() == "53176ebf-c75d-42e5-839f-4508ffac3def")) {
List<Project> projects = await _projectsHelper.GetAllProjectByTanentID(emp.TenantId);
projectsId = projects.Select(c=>c.Id.ToString()).ToArray();
}
else
{
List<ProjectAllocation> allocation = await _projectsHelper.GetProjectByEmployeeID(emp.Id);
projectsId = allocation.Select(c => c.ProjectId.ToString()).ToArray();
}
EmployeeVM employeeVM = EmployeeMapper.ToEmployeeVMFromEmployee(emp);
EmployeeProfile profile = new EmployeeProfile()
{
EmployeeInfo = employeeVM,
Projects = projectsId,
FeaturePermissions = featurePermission.Select(c => c.FeatureId.ToString()).ToArray(),
};
return Ok(profile);
}
}
}

View File

@ -0,0 +1,565 @@

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="x-apple-disable-message-reformatting">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=edge"><!--<![endif]-->
<title></title>
<style type="text/css">
@media only screen and (min-width: 620px) {
.u-row {
width: 600px !important;
}
.u-row .u-col {
vertical-align: top;
}
.u-row .u-col-50 {
width: 300px !important;
}
.u-row .u-col-100 {
width: 600px !important;
}
}
@media only screen and (max-width: 620px) {
.u-row-container {
max-width: 100% !important;
padding-left: 0px !important;
padding-right: 0px !important;
}
.u-row {
width: 100% !important;
}
.u-row .u-col {
display: block !important;
width: 100% !important;
min-width: 320px !important;
max-width: 100% !important;
}
.u-row .u-col > div {
margin: 0 auto;
}
.u-row .u-col img {
max-width: 100% !important;
}
}
body {
margin: 0;
padding: 0
}
table, td, tr {
border-collapse: collapse;
vertical-align: top
}
p {
margin: 0
}
.ie-container table, .mso-container table {
table-layout: fixed
}
* {
line-height: inherit
}
a[x-apple-data-detectors=true] {
color: inherit !important;
text-decoration: none !important
}
table, td {
color: #000000;
}
#u_body a {
color: #e93f32;
text-decoration: underline;
}
</style>
<!--[if !mso]><!-->
<link href="https://fonts.googleapis.com/css?family=Lato:400,700" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Lato:400,700" rel="stylesheet" type="text/css"><!--<![endif]-->
</head>
<body class="clean-body u_body" style="margin: 0;padding: 0;-webkit-text-size-adjust: 100%;background-color: #f9f9f9;color: #000000">
<!--[if IE]><div class="ie-container"><![endif]-->
<!--[if mso]><div class="mso-container"><![endif]-->
<table id="u_body" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;min-width: 320px;Margin: 0 auto;background-color: #f9f9f9;width:100%" cellpadding="0" cellspacing="0">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="center" style="background-color: #f9f9f9;"><![endif]-->
<!--<div>Top Spacing</div>-->
<div class="u-row-container" style="padding: 0px;background-color: #f9f9f9">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #f9f9f9;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: #f9f9f9;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #f9f9f9;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:15px;font-family:'Lato',sans-serif;" align="left">
<table height="0px" align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;border-top: 1px solid #f9f9f9;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top;font-size: 0px;line-height: 0px;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
Sita
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Logo Block</div>-->
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #ffffff;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #ffffff;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:25px 10px;font-family:'Lato',sans-serif;" align="left">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 0px;padding-left: 0px;" align="center">
<img align="center" border="0" src="http://localhost:5032/logos/marco-aiot-tech-logo.jpg" alt="Image" title="Image" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: inline-block !important;border: none;height: auto;float: none;width: 29%;max-width: 168.2px;" width="168.2" />
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Title Block</div>-->
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto; min-width: 320px; max-width: 600px; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; background-color: #f46b61;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #e93f32;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:35px 10px 10px;font-family:'Lato',sans-serif;" align="left">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 0px;padding-left: 0px;" align="center">
<img align="center" border="0" src="https://cdn.templates.unlayer.com/assets/1593141680866-reset.png" alt="Image" title="Image" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: inline-block !important;border: none;height: auto;float: none;width: 10%;max-width: 58px;" width="58" />
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:0px 10px 30px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="font-size: 14px; line-height: 140%; text-align: center;"><span style="font-size: 28px; line-height: 39.2px; color: #ffffff; font-family: Lato, sans-serif;">{{MAIL_TITLE}} </span></p>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Mail Body</div>-->
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #ffffff;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #ffffff;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:40px 40px 30px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 14px; line-height: 25.2px; color: #666666;">Hello,</span></p>
<p style="font-size: 14px; line-height: 140%;">&nbsp;</p>
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 14px; line-height: 25.2px; color: #666666;">We have sent you this email in response to your request to reset your password on MarcoPMS.</span></p>
<p style="font-size: 14px; line-height: 140%;">&nbsp;</p>
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 14px; line-height: 25.2px; color: #666666;">To reset your password, please follow the link below: </span></p>
</div>
</td>
</tr>
</tbody>
</table>
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:0px 40px;font-family:'Lato',sans-serif;" align="left">
<!--[if mso]><style>.v-button {background: transparent !important;}</style><![endif]-->
<div align="left">
<!--[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="" style="height:51px; v-text-anchor:middle; width:205px;" arcsize="2%" stroke="f" fillcolor="#e93f32"><w:anchorlock/><center style="color:#FFFFFF;"><![endif]-->
<a href="{{RESET_PWD_URL}}" target="_blank" class="v-button" style="box-sizing: border-box;display: inline-block;text-decoration: none;-webkit-text-size-adjust: none;text-align: center;color: #FFFFFF; background-color: #e93f32; border-radius: 1px;-webkit-border-radius: 1px; -moz-border-radius: 1px; width:auto; max-width:100%; overflow-wrap: break-word; word-break: break-word; word-wrap:break-word; mso-border-alt: none;font-size: 14px;">
<span style="display:block;padding:15px 40px;line-height:120%;"><span style="font-size: 18px; line-height: 21.6px;">Reset Password</span></span>
</a>
<!--[if mso]></center></v:roundrect><![endif]-->
</div>
</td>
</tr>
</tbody>
</table>
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:40px 40px 30px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="font-size: 14px; line-height: 140%;"><span style="color: #888888; font-size: 14px; line-height: 19.6px;"><em><span style="font-size: 14px; line-height: 22.4px;">Please ignore this email if you did not request a password change.</span></em></span><br /><span style="color: #888888; font-size: 14px; line-height: 19.6px;"><em><span style="font-size: 16px; line-height: 22.4px;">&nbsp;</span></em></span></p>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Contact</div>-->
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #e93f32;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #e93f32;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="300" style="width: 300px;padding: 20px 20px 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-50" style="max-width: 320px;min-width: 300px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 20px 20px 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 16px; line-height: 22.4px; color: #ecf0f1;">Contact</span></p>
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 14px; line-height: 19.6px; color: #ecf0f1;">1912 &nbsp;Mcwhorter Road, FL 11223</span></p>
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 14px; line-height: 19.6px; color: #ecf0f1;">+111 222 333 | info [@] marcoaiot.com</span></p>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="300" style="width: 300px;padding: 0px 0px 0px 20px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-50" style="max-width: 320px;min-width: 300px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px 0px 0px 20px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:25px 10px 10px;font-family:'Lato',sans-serif;" align="left">
<div align="left" style="direction: ltr;">
<div style="display: table; max-width:187px;">
<!--[if (mso)|(IE)]><table width="187" cellpadding="0" cellspacing="0" border="0"><tr><td style="border-collapse:collapse;" align="left"><table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse; mso-table-lspace: 0pt;mso-table-rspace: 0pt; width:187px;"><tr><![endif]-->
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 15px;" valign="top"><![endif]-->
<table border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 15px">
<tbody>
<tr style="vertical-align: top">
<td valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href=" " title="Facebook" target="_blank">
<img src="https://cdn.tools.unlayer.com/social/icons/circle-white/facebook.png" alt="Facebook" title="Facebook" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 15px;" valign="top"><![endif]-->
<table border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 15px">
<tbody>
<tr style="vertical-align: top">
<td valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href=" " title="Twitter" target="_blank">
<img src="https://cdn.tools.unlayer.com/social/icons/circle-white/twitter.png" alt="Twitter" title="Twitter" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 15px;" valign="top"><![endif]-->
<table border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 15px">
<tbody>
<tr style="vertical-align: top">
<td valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href=" " title="Instagram" target="_blank">
<img src="https://cdn.tools.unlayer.com/social/icons/circle-white/instagram.png" alt="Instagram" title="Instagram" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 0px;" valign="top"><![endif]-->
<table border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 0px">
<tbody>
<tr style="vertical-align: top">
<td valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href=" " title="LinkedIn" target="_blank">
<img src="https://cdn.tools.unlayer.com/social/icons/circle-white/linkedin.png" alt="LinkedIn" title="LinkedIn" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</td>
</tr>
</tbody>
</table>
<!--<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:5px 10px 10px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="line-height: 140%; font-size: 14px;"><span style="font-size: 14px; line-height: 19.6px;"><span style="color: #ecf0f1; font-size: 14px; line-height: 19.6px;"><span style="line-height: 19.6px; font-size: 14px;">Marco AIoT Technologies Pvt. Ltd. &copy;&nbsp; All Rights Reserved</span></span></span></p>
</div>
</td>
</tr>
</tbody>
</table>-->
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Bottom Spacing - light red</div>-->
<div class="u-row-container" style="padding: 0px;background-color: #f9f9f9">
<div class="u-row" style="margin: 0 auto; min-width: 320px; max-width: 600px; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; background-color: #f46b61;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: #f9f9f9;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #e93f32;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:15px;font-family:'Lato',sans-serif;" align="center">
<p style="line-height: 140%; font-size: 14px;"><span style="font-size: 14px; line-height: 19.6px;"><span style="color: #ecf0f1; font-size: 14px; line-height: 19.6px;"><span style="line-height: 19.6px; font-size: 14px;">Marco AIoT Technologies Pvt. Ltd. &copy;&nbsp; All Rights Reserved</span></span></span></p>
<!--<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;border-top: 1px solid #e93f32;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
</td>
</tr>
</tbody>
</table>-->
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #f9f9f9;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #f9f9f9;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:0px 40px 30px 20px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<small style="color: #a5a3a3;"> You're receiving this email because you have a MarcoPMS account. This email is not a marketing or promotional email. That is why this email does not contain an unsubscribe link. You will receive this email even if you have unsubscribed from MarcoPMS's marketing emails</small>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--[if (mso)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
<!--[if mso]></div><![endif]-->
<!--[if IE]></div><![endif]-->
</body>
</html>

View File

@ -0,0 +1,565 @@

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="x-apple-disable-message-reformatting">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=edge"><!--<![endif]-->
<title></title>
<style type="text/css">
@media only screen and (min-width: 620px) {
.u-row {
width: 600px !important;
}
.u-row .u-col {
vertical-align: top;
}
.u-row .u-col-50 {
width: 300px !important;
}
.u-row .u-col-100 {
width: 600px !important;
}
}
@media only screen and (max-width: 620px) {
.u-row-container {
max-width: 100% !important;
padding-left: 0px !important;
padding-right: 0px !important;
}
.u-row {
width: 100% !important;
}
.u-row .u-col {
display: block !important;
width: 100% !important;
min-width: 320px !important;
max-width: 100% !important;
}
.u-row .u-col > div {
margin: 0 auto;
}
.u-row .u-col img {
max-width: 100% !important;
}
}
body {
margin: 0;
padding: 0
}
table, td, tr {
border-collapse: collapse;
vertical-align: top
}
p {
margin: 0
}
.ie-container table, .mso-container table {
table-layout: fixed
}
* {
line-height: inherit
}
a[x-apple-data-detectors=true] {
color: inherit !important;
text-decoration: none !important
}
table, td {
color: #000000;
}
#u_body a {
color: #e93f32;
text-decoration: underline;
}
</style>
<!--[if !mso]><!-->
<link href="https://fonts.googleapis.com/css?family=Lato:400,700" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Lato:400,700" rel="stylesheet" type="text/css"><!--<![endif]-->
</head>
<body class="clean-body u_body" style="margin: 0;padding: 0;-webkit-text-size-adjust: 100%;background-color: #f9f9f9;color: #000000">
<!--[if IE]><div class="ie-container"><![endif]-->
<!--[if mso]><div class="mso-container"><![endif]-->
<table id="u_body" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;min-width: 320px;Margin: 0 auto;background-color: #f9f9f9;width:100%" cellpadding="0" cellspacing="0">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="center" style="background-color: #f9f9f9;"><![endif]-->
<!--<div>Top Spacing</div>-->
<div class="u-row-container" style="padding: 0px;background-color: #f9f9f9">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #f9f9f9;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: #f9f9f9;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #f9f9f9;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:15px;font-family:'Lato',sans-serif;" align="left">
<table height="0px" align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;border-top: 1px solid #f9f9f9;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top;font-size: 0px;line-height: 0px;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
Sita
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Logo Block</div>-->
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #ffffff;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #ffffff;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:25px 10px;font-family:'Lato',sans-serif;" align="left">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 0px;padding-left: 0px;" align="center">
<img align="center" border="0" src="https://cdn.templates.unlayer.com/assets/1593141459339-Untitled-1.jpg" alt="Image" title="Image" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: inline-block !important;border: none;height: auto;float: none;width: 29%;max-width: 168.2px;" width="168.2" />
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Title Block</div>-->
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto; min-width: 320px; max-width: 600px; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; background-color: #f46b61;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #e93f32;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:35px 10px 10px;font-family:'Lato',sans-serif;" align="left">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 0px;padding-left: 0px;" align="center">
<img align="center" border="0" src="https://cdn.templates.unlayer.com/assets/1593141680866-reset.png" alt="Image" title="Image" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: inline-block !important;border: none;height: auto;float: none;width: 10%;max-width: 58px;" width="58" />
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:0px 10px 30px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="font-size: 14px; line-height: 140%; text-align: center;"><span style="font-size: 28px; line-height: 39.2px; color: #ffffff; font-family: Lato, sans-serif;">Please reset your password </span></p>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Mail Body</div>-->
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #ffffff;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #ffffff;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:40px 40px 30px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 18px; line-height: 25.2px; color: #666666;">Hello,</span></p>
<p style="font-size: 14px; line-height: 140%;">&nbsp;</p>
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 18px; line-height: 25.2px; color: #666666;">We have sent you this email in response to your request to reset your password on MarcoPMS.</span></p>
<p style="font-size: 14px; line-height: 140%;">&nbsp;</p>
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 18px; line-height: 25.2px; color: #666666;">To reset your password, please follow the link below: </span></p>
</div>
</td>
</tr>
</tbody>
</table>
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:0px 40px;font-family:'Lato',sans-serif;" align="left">
<!--[if mso]><style>.v-button {background: transparent !important;}</style><![endif]-->
<div align="left">
<!--[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="" style="height:51px; v-text-anchor:middle; width:205px;" arcsize="2%" stroke="f" fillcolor="#e93f32"><w:anchorlock/><center style="color:#FFFFFF;"><![endif]-->
<a href="" target="_blank" class="v-button" style="box-sizing: border-box;display: inline-block;text-decoration: none;-webkit-text-size-adjust: none;text-align: center;color: #FFFFFF; background-color: #e93f32; border-radius: 1px;-webkit-border-radius: 1px; -moz-border-radius: 1px; width:auto; max-width:100%; overflow-wrap: break-word; word-break: break-word; word-wrap:break-word; mso-border-alt: none;font-size: 14px;">
<span style="display:block;padding:15px 40px;line-height:120%;"><span style="font-size: 18px; line-height: 21.6px;">Reset Password</span></span>
</a>
<!--[if mso]></center></v:roundrect><![endif]-->
</div>
</td>
</tr>
</tbody>
</table>
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:40px 40px 30px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="font-size: 14px; line-height: 140%;"><span style="color: #888888; font-size: 14px; line-height: 19.6px;"><em><span style="font-size: 16px; line-height: 22.4px;">Please ignore this email if you did not request a password change.</span></em></span><br /><span style="color: #888888; font-size: 14px; line-height: 19.6px;"><em><span style="font-size: 16px; line-height: 22.4px;">&nbsp;</span></em></span></p>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Contact</div>-->
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #e93f32;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #e93f32;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="300" style="width: 300px;padding: 20px 20px 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-50" style="max-width: 320px;min-width: 300px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 20px 20px 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 16px; line-height: 22.4px; color: #ecf0f1;">Contact</span></p>
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 14px; line-height: 19.6px; color: #ecf0f1;">1912 &nbsp;Mcwhorter Road, FL 11223</span></p>
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 14px; line-height: 19.6px; color: #ecf0f1;">+111 222 333 | info [@] marcoaiot.com</span></p>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="300" style="width: 300px;padding: 0px 0px 0px 20px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-50" style="max-width: 320px;min-width: 300px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px 0px 0px 20px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:25px 10px 10px;font-family:'Lato',sans-serif;" align="left">
<div align="left" style="direction: ltr;">
<div style="display: table; max-width:187px;">
<!--[if (mso)|(IE)]><table width="187" cellpadding="0" cellspacing="0" border="0"><tr><td style="border-collapse:collapse;" align="left"><table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse; mso-table-lspace: 0pt;mso-table-rspace: 0pt; width:187px;"><tr><![endif]-->
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 15px;" valign="top"><![endif]-->
<table border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 15px">
<tbody>
<tr style="vertical-align: top">
<td valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href=" " title="Facebook" target="_blank">
<img src="https://cdn.tools.unlayer.com/social/icons/circle-white/facebook.png" alt="Facebook" title="Facebook" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 15px;" valign="top"><![endif]-->
<table border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 15px">
<tbody>
<tr style="vertical-align: top">
<td valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href=" " title="Twitter" target="_blank">
<img src="https://cdn.tools.unlayer.com/social/icons/circle-white/twitter.png" alt="Twitter" title="Twitter" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 15px;" valign="top"><![endif]-->
<table border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 15px">
<tbody>
<tr style="vertical-align: top">
<td valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href=" " title="Instagram" target="_blank">
<img src="https://cdn.tools.unlayer.com/social/icons/circle-white/instagram.png" alt="Instagram" title="Instagram" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 0px;" valign="top"><![endif]-->
<table border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 0px">
<tbody>
<tr style="vertical-align: top">
<td valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href=" " title="LinkedIn" target="_blank">
<img src="https://cdn.tools.unlayer.com/social/icons/circle-white/linkedin.png" alt="LinkedIn" title="LinkedIn" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</td>
</tr>
</tbody>
</table>
<!--<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:5px 10px 10px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="line-height: 140%; font-size: 14px;"><span style="font-size: 14px; line-height: 19.6px;"><span style="color: #ecf0f1; font-size: 14px; line-height: 19.6px;"><span style="line-height: 19.6px; font-size: 14px;">Marco AIoT Technologies Pvt. Ltd. &copy;&nbsp; All Rights Reserved</span></span></span></p>
</div>
</td>
</tr>
</tbody>
</table>-->
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Bottom Spacing - light red</div>-->
<div class="u-row-container" style="padding: 0px;background-color: #f9f9f9">
<div class="u-row" style="margin: 0 auto; min-width: 320px; max-width: 600px; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; background-color: #f46b61;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: #f9f9f9;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #e93f32;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:15px;font-family:'Lato',sans-serif;" align="center">
<p style="line-height: 140%; font-size: 14px;"><span style="font-size: 14px; line-height: 19.6px;"><span style="color: #ecf0f1; font-size: 14px; line-height: 19.6px;"><span style="line-height: 19.6px; font-size: 14px;">Marco AIoT Technologies Pvt. Ltd. &copy;&nbsp; All Rights Reserved</span></span></span></p>
<!--<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;border-top: 1px solid #e93f32;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
</td>
</tr>
</tbody>
</table>-->
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #f9f9f9;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #f9f9f9;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:0px 40px 30px 20px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<small style="color: #a5a3a3;"> You're receiving this email because you have a MarcoPMS account. This email is not a marketing or promotional email. That is why this email does not contain an unsubscribe link. You will receive this email even if you have unsubscribed from MarcoPMS's marketing emails</small>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--[if (mso)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
<!--[if mso]></div><![endif]-->
<!--[if IE]></div><![endif]-->
</body>
</html>

View File

@ -0,0 +1,564 @@

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="x-apple-disable-message-reformatting" />
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=edge" /><!--<![endif]-->
<title></title>
<style type="text/css">
@media only screen and (min-width: 620px) {
.u-row {
width: 600px !important;
}
.u-row .u-col {
vertical-align: top;
}
.u-row .u-col-50 {
width: 300px !important;
}
.u-row .u-col-100 {
width: 600px !important;
}
}
@media only screen and (max-width: 620px) {
.u-row-container {
max-width: 100% !important;
padding-left: 0px !important;
padding-right: 0px !important;
}
.u-row {
width: 100% !important;
}
.u-row .u-col {
display: block !important;
width: 100% !important;
min-width: 320px !important;
max-width: 100% !important;
}
.u-row .u-col > div {
margin: 0 auto;
}
.u-row .u-col img {
max-width: 100% !important;
}
}
body {
margin: 0;
padding: 0
}
table, td, tr {
border-collapse: collapse;
vertical-align: top
}
p {
margin: 0
}
.ie-container table, .mso-container table {
table-layout: fixed
}
* {
line-height: inherit
}
a[x-apple-data-detectors=true] {
color: inherit !important;
text-decoration: none !important
}
table, td {
color: #000000;
}
#u_body a {
color: #e93f32;
text-decoration: underline;
}
</style>
<!--[if !mso]><!-->
<link href="https://fonts.googleapis.com/css?family=Lato:400,700" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Lato:400,700" rel="stylesheet" type="text/css" /><!--<![endif]-->
</head>
<body class="clean-body u_body" style="margin: 0;padding: 0;-webkit-text-size-adjust: 100%;background-color: #f9f9f9;color: #000000">
<!--[if IE]><div class="ie-container"><![endif]-->
<!--[if mso]><div class="mso-container"><![endif]-->
<table id="u_body" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;min-width: 320px;Margin: 0 auto;background-color: #f9f9f9;width:100%" cellpadding="0" cellspacing="0">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="center" style="background-color: #f9f9f9;"><![endif]-->
<!--<div>Top Spacing</div>-->
<div class="u-row-container" style="padding: 0px;background-color: #f9f9f9">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #f9f9f9;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: #f9f9f9;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #f9f9f9;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:15px;font-family:'Lato',sans-serif;" align="left">
<table height="0px" align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;border-top: 1px solid #f9f9f9;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top;font-size: 0px;line-height: 0px;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
Sita
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Logo Block</div>-->
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #ffffff;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #ffffff;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:25px 10px;font-family:'Lato',sans-serif;" align="left">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 0px;padding-left: 0px;" align="center">
<img align="center" border="0" src="http://localhost:5032/logos/marco-aiot-tech-logo.jpg" alt="Image" title="Image" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: inline-block !important;border: none;height: auto;float: none;width: 29%;max-width: 168.2px;" width="168.2" />
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Title Block</div>-->
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto; min-width: 320px; max-width: 600px; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; background-color: #f46b61;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #e93f32;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:35px 10px 10px;font-family:'Lato',sans-serif;" align="left">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 0px;padding-left: 0px;" align="center">
<img align="center" border="0" src="https://cdn.templates.unlayer.com/assets/1593141680866-reset.png" alt="Image" title="Image" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: inline-block !important;border: none;height: auto;float: none;width: 10%;max-width: 58px;" width="58" />
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:0px 10px 30px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="font-size: 14px; line-height: 140%; text-align: center;"><span style="font-size: 28px; line-height: 39.2px; color: #ffffff; font-family: Lato, sans-serif;">{{MAIL_TITLE}} </span></p>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Mail Body</div>-->
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #ffffff;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #ffffff;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:40px 40px 30px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 14px; line-height: 25.2px; color: #666666;">Hello {{RECEIVER_NAME}},</span></p>
<p style="font-size: 14px; line-height: 140%;">&nbsp;</p>
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 14px; line-height: 25.2px; color: #666666;">Welcome, You've joined your teammates on MarcoPMS. We have sent you this email to set your password on MarcoPMS.</span></p>
<p style="font-size: 14px; line-height: 140%;">&nbsp;</p>
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 14px; line-height: 25.2px; color: #666666;">To set your password, please follow the link below: </span></p>
</div>
</td>
</tr>
</tbody>
</table>
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:0px 40px;font-family:'Lato',sans-serif;" align="left">
<!--[if mso]><style>.v-button {background: transparent !important;}</style><![endif]-->
<div align="left">
<!--[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="" style="height:51px; v-text-anchor:middle; width:205px;" arcsize="2%" stroke="f" fillcolor="#e93f32"><w:anchorlock/><center style="color:#FFFFFF;"><![endif]-->
<a href="{{RESET_PWD_URL}}" target="_blank" class="v-button" style="box-sizing: border-box;display: inline-block;text-decoration: none;-webkit-text-size-adjust: none;text-align: center;color: #FFFFFF; background-color: #e93f32; border-radius: 1px;-webkit-border-radius: 1px; -moz-border-radius: 1px; width:auto; max-width:100%; overflow-wrap: break-word; word-break: break-word; word-wrap:break-word; mso-border-alt: none;font-size: 14px;">
<span style="display:block;padding:15px 40px;line-height:120%;"><span style="font-size: 18px; line-height: 21.6px;">Set Password</span></span>
</a>
<!--[if mso]></center></v:roundrect><![endif]-->
</div>
</td>
</tr>
</tbody>
</table>
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:40px 40px 30px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="font-size: 14px; line-height: 140%;"><span style="color: #888888; font-size: 14px; line-height: 19.6px;"><em><span style="font-size: 14px; line-height: 22.4px;">Please ignore this email if you did not request a password change.</span></em></span><br /><span style="color: #888888; font-size: 14px; line-height: 19.6px;"><em><span style="font-size: 16px; line-height: 22.4px;">&nbsp;</span></em></span></p>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Contact</div>-->
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #e93f32;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #e93f32;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="300" style="width: 300px;padding: 20px 20px 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-50" style="max-width: 320px;min-width: 300px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 20px 20px 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 16px; line-height: 22.4px; color: #ecf0f1;">Contact</span></p>
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 14px; line-height: 19.6px; color: #ecf0f1;">1912 &nbsp;Mcwhorter Road, FL 11223</span></p>
<p style="font-size: 14px; line-height: 140%;"><span style="font-size: 14px; line-height: 19.6px; color: #ecf0f1;">+111 222 333 | info [@] marcoaiot.com</span></p>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="300" style="width: 300px;padding: 0px 0px 0px 20px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-50" style="max-width: 320px;min-width: 300px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px 0px 0px 20px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:25px 10px 10px;font-family:'Lato',sans-serif;" align="left">
<div align="left" style="direction: ltr;">
<div style="display: table; max-width:187px;">
<!--[if (mso)|(IE)]><table width="187" cellpadding="0" cellspacing="0" border="0"><tr><td style="border-collapse:collapse;" align="left"><table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse; mso-table-lspace: 0pt;mso-table-rspace: 0pt; width:187px;"><tr><![endif]-->
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 15px;" valign="top"><![endif]-->
<table border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 15px">
<tbody>
<tr style="vertical-align: top">
<td valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href=" " title="Facebook" target="_blank">
<img src="https://cdn.tools.unlayer.com/social/icons/circle-white/facebook.png" alt="Facebook" title="Facebook" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important" />
</a>
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 15px;" valign="top"><![endif]-->
<table border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 15px">
<tbody>
<tr style="vertical-align: top">
<td valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href=" " title="Twitter" target="_blank">
<img src="https://cdn.tools.unlayer.com/social/icons/circle-white/twitter.png" alt="Twitter" title="Twitter" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important" />
</a>
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 15px;" valign="top"><![endif]-->
<table border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 15px">
<tbody>
<tr style="vertical-align: top">
<td valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href=" " title="Instagram" target="_blank">
<img src="https://cdn.tools.unlayer.com/social/icons/circle-white/instagram.png" alt="Instagram" title="Instagram" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important" />
</a>
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 0px;" valign="top"><![endif]-->
<table border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 0px">
<tbody>
<tr style="vertical-align: top">
<td valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href=" " title="LinkedIn" target="_blank">
<img src="https://cdn.tools.unlayer.com/social/icons/circle-white/linkedin.png" alt="LinkedIn" title="LinkedIn" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important" />
</a>
</td>
</tr>
</tbody>
</table>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</td>
</tr>
</tbody>
</table>
<!--<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:5px 10px 10px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="line-height: 140%; font-size: 14px;"><span style="font-size: 14px; line-height: 19.6px;"><span style="color: #ecf0f1; font-size: 14px; line-height: 19.6px;"><span style="line-height: 19.6px; font-size: 14px;">Marco AIoT Technologies Pvt. Ltd. &copy;&nbsp; All Rights Reserved</span></span></span></p>
</div>
</td>
</tr>
</tbody>
</table>-->
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--<div>Bottom Spacing - light red</div>-->
<div class="u-row-container" style="padding: 0px;background-color: #f9f9f9">
<div class="u-row" style="margin: 0 auto; min-width: 320px; max-width: 600px; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; background-color: #f46b61;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: #f9f9f9;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #e93f32;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:15px;font-family:'Lato',sans-serif;" align="center">
<p style="line-height: 140%; font-size: 14px;"><span style="font-size: 14px; line-height: 19.6px;"><span style="color: #ecf0f1; font-size: 14px; line-height: 19.6px;"><span style="line-height: 19.6px; font-size: 14px;">Marco AIoT Technologies Pvt. Ltd. &copy;&nbsp; All Rights Reserved</span></span></span></p>
<!--<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;border-top: 1px solid #e93f32;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%">
</td>
</tr>
</tbody>
</table>-->
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #f9f9f9;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:600px;"><tr style="background-color: #f9f9f9;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="600" style="width: 600px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 600px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:'Lato',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:0px 40px 30px 20px;font-family:'Lato',sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<small style="color: #a5a3a3;"> You're receiving this email because you have a MarcoPMS account. This email is not a marketing or promotional email. That is why this email does not contain an unsubscribe link. You will receive this email even if you have unsubscribed from MarcoPMS's marketing emails</small>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--[if (mso)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
<!--[if mso]></div><![endif]-->
<!--[if IE]></div><![endif]-->
</body>
</html>

View File

@ -1,20 +1,101 @@
using Marco.Pms.DataAccess.Data;

using Marco.Pms.DataAccess.Data;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Mapper;
using Marco.Pms.Model.ViewModels.Employee;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Runtime.Intrinsics.Arm;
namespace MarcoBMS.Services.Helpers
{
public class EmployeeHelper
{
private readonly ApplicationDbContext _context;
public EmployeeHelper(ApplicationDbContext context) {
public EmployeeHelper(ApplicationDbContext context)
{
_context = context;
}
public async Task<Employee> GetEmployeeByID(int EmployeeID)
{
return await _context.Employees.FindAsync(EmployeeID);
}
public async Task<Employee> GetEmployeeByApplicationUserID(string ApplicationUserID)
{
try
{
var result = await _context.Employees.Where(c => c.ApplicationUserId == ApplicationUserID).ToListAsync();
return await _context.Employees.Where(c => c.ApplicationUserId == ApplicationUserID).SingleOrDefaultAsync();
}
catch (Exception ex)
{
return null;
}
}
public async Task<List<EmployeeVM>> SearchEmployeeByProjectId(int TenentId, string searchString, int? ProjectId)
{
try
{
List<EmployeeVM> result = new List<EmployeeVM>();
if (ProjectId != null)
{
result = await (from pa in _context.ProjectAllocations.Where(c => c.ProjectId == ProjectId)
join em in _context.Employees.Where(c => c.TenantId == TenentId).Include(fp => fp.JobRole) // Include Feature
on pa.EmployeeId equals em.Id
where em.FirstName.ToLower().Contains(searchString.ToLower()) || em.LastName.ToLower().Contains(searchString.ToLower())
select em.ToEmployeeVMFromEmployee()
)
.ToListAsync();
}
else
{
result = await _context.Employees.Where(c => c.TenantId == TenentId &&
(c.FirstName.ToLower().Contains(searchString.ToLower()) || c.LastName.ToLower().Contains(searchString.ToLower()))).Include(fp => fp.JobRole)
.Select(c => c.ToEmployeeVMFromEmployee()).ToListAsync();
}
return result;
}
catch (Exception ex)
{
return new List<EmployeeVM>();
}
}
public async Task<List<EmployeeVM>> GetEmployeeByProjectId(int TenentId, int? ProjectId)
{
try
{
List<EmployeeVM> result = new List<EmployeeVM>();
if (ProjectId != null)
{
result = await (from pa in _context.ProjectAllocations.Where(c => c.ProjectId == ProjectId)
join em in _context.Employees.Where(c => c.TenantId == TenentId).Include(fp => fp.JobRole) // Include Feature
on pa.EmployeeId equals em.Id
select em.ToEmployeeVMFromEmployee()
)
.ToListAsync();
}
else
{
result = await _context.Employees.Where(c => c.TenantId == TenentId).Include(fp => fp.JobRole)
.Select(c => c.ToEmployeeVMFromEmployee()).ToListAsync();
}
return result;
}
catch (Exception ex)
{
return new List<EmployeeVM>();
}
}
}
}

View File

@ -4,7 +4,7 @@ using Microsoft.CodeAnalysis;
using Microsoft.EntityFrameworkCore;
namespace MarcoBMS.Services.Helpers
namespace ModelServices.Helpers
{
public class ProjectHelper
{

View File

@ -0,0 +1,48 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.Model.Projects;
using Microsoft.EntityFrameworkCore;
namespace MarcoBMS.Services.Helpers
{
public class ProjectsHelper
{
private readonly ApplicationDbContext _context;
public ProjectsHelper(ApplicationDbContext context)
{
_context = context;
}
public async Task<List<Project>> GetAllProjectByTanentID(int tanentID)
{
List<Project> alloc = await _context.Projects.Where(c => c.TenantId == tanentID).ToListAsync();
return alloc;
}
public async Task<List<ProjectAllocation>> GetProjectByEmployeeID(int employeeID)
{
List<ProjectAllocation> alloc = await _context.ProjectAllocations.Where(c => c.EmployeeId ==employeeID && c.IsActive == true).Include(c=>c.Project).ToListAsync();
return alloc;
}
public async Task<List<ProjectAllocation>> GetTeamByProject(int TenantId, int ProjectId, bool IncludeInactive)
{
if (IncludeInactive)
{
var employees = await _context.ProjectAllocations.Where(c => c.TenantId == TenantId && c.ProjectId == ProjectId).Include(e => e.Employee).ToListAsync();
return employees;
}
else
{
var employees = await _context.ProjectAllocations.Where(c => c.TenantId == TenantId && c.ProjectId == ProjectId && c.IsActive == true).Include(e => e.Employee).ToListAsync();
return employees;
}
}
}
}

View File

@ -0,0 +1,53 @@

using Marco.Pms.DataAccess.Data;
using Marco.Pms.Model.Entitlements;
using Microsoft.EntityFrameworkCore;
namespace MarcoBMS.Services.Helpers
{
public class RolesHelper
{
private readonly ApplicationDbContext _context;
public RolesHelper(ApplicationDbContext context)
{
_context = context;
}
public async Task<List<FeaturePermission>> GetFeaturePermissionByEmployeeID(int EmployeeID)
{
List<Guid> roleMappings = await _context.EmployeeRoleMappings.Where(c => c.EmployeeId ==EmployeeID && c.IsEnabled == true).Select(c=>c.RoleId).ToListAsync();
// _context.RolePermissionMappings
var result = await (from rpm in _context.RolePermissionMappings
join fp in _context.FeaturePermissions.Where(c=>c.IsEnabled == true).Include(fp => fp.Feature) // Include Feature
on rpm.FeaturePermissionId equals fp.Id
where roleMappings.Contains(rpm.ApplicationRoleId)
select fp)
.ToListAsync();
return result;
// return null;
}
public async Task<List<FeaturePermission>> GetFeaturePermissionByRoleID(Guid roleId)
{
List<Guid> roleMappings = await _context.RolePermissionMappings.Where(c => c.ApplicationRoleId == roleId ).Select(c => c.ApplicationRoleId).ToListAsync();
// _context.RolePermissionMappings
var result = await (from rpm in _context.RolePermissionMappings.Where(c=>c.ApplicationRoleId == roleId)
join fp in _context.FeaturePermissions.Where(c => c.IsEnabled == true).Include(fp => fp.Feature) // Include Feature
on rpm.FeaturePermissionId equals fp.Id
select fp)
.ToListAsync();
return result;
// return null;
}
}
}

View File

@ -0,0 +1,63 @@
using Marco.Pms.Model.Dtos.Employees;
using Marco.Pms.Model.Entitlements;
using Microsoft.AspNetCore.Identity;
using System.Security.Claims;
namespace MarcoBMS.Services.Helpers
{
public class UserHelper
{
private readonly UserManager<IdentityUser> _userManager;
private readonly IHttpContextAccessor _httpContextAccessor;
public UserHelper(UserManager<IdentityUser> userManager, IHttpContextAccessor httpContextAccessor)
{
_userManager = userManager;
_httpContextAccessor = httpContextAccessor;
}
public int GetTenantId()
{
var tenant = _httpContextAccessor.HttpContext?.User.FindFirst("TenantId")?.Value;
return (tenant != null ? Convert.ToInt32(tenant) : 1);
}
public async Task<IdentityUser?> GetCurrentUserAsync()
{
var userId = _httpContextAccessor.HttpContext?.User.FindFirstValue(ClaimTypes.NameIdentifier);
if (string.IsNullOrEmpty(userId))
return null;
var user = await _userManager.FindByEmailAsync(userId);
return user; //await _userManager.FindByIdAsync(userId);
}
public async Task<object?> GetCurrentUserProfileAsync()
{
var user = await GetCurrentUserAsync();
return user == null ? null : new
{
user.Id,
user.UserName,
user.Email,
user.PhoneNumber
};
}
public async Task<IdentityUser?> GetRegisteredUser(string email)
{
//IdentityUser? user = await _userManager.Users
// .FirstOrDefaultAsync(u => u.Email == model.Email || u.PhoneNumber == model.PhoneNumber);
IdentityUser? user = await _userManager.FindByEmailAsync(email);
//if (user == null)
//{
// user = await _userManager.Find(model.Email);
//}
return user;
}
}
}

View File

@ -29,6 +29,9 @@
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="2.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.MongoDB" Version="7.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>

Some files were not shown because too many files have changed in this diff Show More