Removed all warning
This commit is contained in:
parent
52a67ba15b
commit
c44deb439e
@ -7,27 +7,27 @@ namespace Marco.Pms.Model.Dtos.Employees
|
||||
{
|
||||
public ApplicationUserDto() { }
|
||||
public int? Id { get; set; }
|
||||
public string FirstName { get; set; }
|
||||
public string LastName { 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 string? Gender { get; set; }
|
||||
public DateTime? BirthDate { get; set; }
|
||||
public DateTime? JoiningDate { get; set; }
|
||||
|
||||
public string PermanentAddress { get; set; }
|
||||
public string CurrentAddress { get; set; }
|
||||
public string PhoneNumber { get; set; }
|
||||
public string? PermanentAddress { get; set; }
|
||||
public string? CurrentAddress { get; set; }
|
||||
public string? PhoneNumber { get; set; }
|
||||
|
||||
public string EmergencyPhoneNumber { get; set; }
|
||||
public string? EmergencyPhoneNumber { get; set; }
|
||||
|
||||
public string? AadharNumber { get; set; }
|
||||
|
||||
public string? PanNumber { get; set; }
|
||||
|
||||
public IFormFile? Photo { get; set; } // To store the captured photo
|
||||
public List<IFormFile> Documents { get; set; }
|
||||
public List<IFormFile>? Documents { get; set; }
|
||||
public string? ApplicationUserId { get; set; }
|
||||
|
||||
public Guid RoleId { get; set; }
|
||||
|
@ -24,9 +24,9 @@ namespace Marco.Pms.Model.Mapper
|
||||
{
|
||||
return new Project
|
||||
{
|
||||
ContactPerson = projectModel.ContactPerson,
|
||||
ProjectAddress = projectModel.ProjectAddress,
|
||||
Name = projectModel.Name,
|
||||
ContactPerson = projectModel.ContactPerson ?? "",
|
||||
ProjectAddress = projectModel.ProjectAddress ?? "",
|
||||
Name = projectModel.Name ?? "",
|
||||
EndDate = projectModel.EndDate,
|
||||
StartDate = projectModel.StartDate,
|
||||
TenantId = TenantId,
|
||||
@ -39,9 +39,9 @@ namespace Marco.Pms.Model.Mapper
|
||||
return new Project
|
||||
{
|
||||
Id = id,
|
||||
ContactPerson = projectModel.ContactPerson,
|
||||
ProjectAddress = projectModel.ProjectAddress,
|
||||
Name = projectModel.Name,
|
||||
ContactPerson = projectModel.ContactPerson ?? "",
|
||||
ProjectAddress = projectModel.ProjectAddress ?? "",
|
||||
Name = projectModel.Name ?? "",
|
||||
EndDate = projectModel.EndDate,
|
||||
StartDate = projectModel.StartDate,
|
||||
TenantId = TenantId,
|
||||
|
@ -276,7 +276,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
if (recordAttendanceDot.MarkTime == null) return BadRequest(ApiResponse<object>.ErrorResponse("Invalid Mark Time", "Invalid Mark Time",400));
|
||||
|
||||
DateTime finalDateTime = GetDateFromTimeStamp(recordAttendanceDot, recordAttendanceDot.MarkTime);
|
||||
|
||||
if (recordAttendanceDot.Comment == null) return BadRequest(ApiResponse<object>.ErrorResponse("Invalid Comment", "Invalid Comment", 400));
|
||||
|
||||
if (attendance != null)
|
||||
{
|
||||
|
@ -20,6 +20,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
[HttpPost("fileupload")]
|
||||
public async Task<IActionResult> FileUploadDemo([FromForm] DemoEmployeeModel model)
|
||||
{
|
||||
if(model.ImageFile == null) {return BadRequest(ApiResponse<object>.ErrorResponse("Error.", "Error.", 400));}
|
||||
string imageName = await Saveimage(model.ImageFile);
|
||||
return Ok(ApiResponse<object>.SuccessResponse("Success.", "Success.", 200));
|
||||
}
|
||||
@ -71,7 +72,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
public string? EmployeeName { get; set; }
|
||||
public string? Occupation { get; set; }
|
||||
public string? ImageName { get; set; }
|
||||
public string ImageSrc { get; set; }
|
||||
public string? ImageSrc { get; set; }
|
||||
|
||||
public IFormFile? ImageFile { get; set; } // List to handle multiple files
|
||||
}
|
||||
|
@ -101,6 +101,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
ProjectDetailsVM vm = await GetProjectViewModel(id, project);
|
||||
|
||||
ProjectVM projectVM = new ProjectVM();
|
||||
if (vm.project != null) {
|
||||
projectVM.Id = vm.project.Id;
|
||||
projectVM.Name = vm.project.Name;
|
||||
projectVM.ProjectAddress = vm.project.ProjectAddress;
|
||||
@ -108,25 +109,33 @@ namespace MarcoBMS.Services.Controllers
|
||||
projectVM.StartDate = vm.project.StartDate;
|
||||
projectVM.EndDate = vm.project.EndDate;
|
||||
projectVM.ProjectStatusId = vm.project.ProjectStatusId;
|
||||
}
|
||||
projectVM.Buildings = new List<BuildingVM>();
|
||||
if (vm.buildings != null) {
|
||||
foreach (Building build in vm.buildings)
|
||||
{
|
||||
BuildingVM buildVM = new BuildingVM() { Id = build.Id, Description = build.Description, Name = build.Name };
|
||||
buildVM.Floors = new List<FloorsVM>();
|
||||
if (vm.floors != null)
|
||||
{
|
||||
foreach (Floor floorDto in vm.floors.Where(c => c.BuildingId == build.Id).ToList())
|
||||
{
|
||||
FloorsVM floorVM = new FloorsVM() { FloorName = floorDto.FloorName, Id = floorDto.Id };
|
||||
floorVM.WorkAreas = new List<WorkAreaVM>();
|
||||
|
||||
if (vm.workAreas != null)
|
||||
{
|
||||
foreach (WorkArea workAreaDto in vm.workAreas.Where(c => c.FloorId == floorVM.Id).ToList())
|
||||
{
|
||||
WorkAreaVM workAreaVM = new WorkAreaVM() { Id = workAreaDto.Id, AreaName = workAreaDto.AreaName, WorkItems = new List<WorkItemVM>() };
|
||||
|
||||
if(vm.workItems != null)
|
||||
{
|
||||
foreach (WorkItem workItemDto in vm.workItems.Where(c => c.WorkAreaId == workAreaDto.Id).ToList())
|
||||
{
|
||||
WorkItemVM workItemVM = new WorkItemVM() { WorkItemId = workItemDto.Id, WorkItem = workItemDto };
|
||||
//workItemVM.WorkItem.WorkArea = null
|
||||
workItemVM.WorkItem.WorkArea = new WorkArea ();
|
||||
workItemVM.WorkItem.WorkArea = new WorkArea();
|
||||
//workItemVM.WorkItem.ActivityMaster.Tenant = null;
|
||||
workItemVM.WorkItem.ActivityMaster.Tenant = new Tenant();
|
||||
//workItemVM.WorkItem.Tenant = null;
|
||||
@ -136,14 +145,18 @@ namespace MarcoBMS.Services.Controllers
|
||||
|
||||
workAreaVM.WorkItems.Add(workItemVM);
|
||||
}
|
||||
}
|
||||
|
||||
floorVM.WorkAreas.Add(workAreaVM);
|
||||
}
|
||||
}
|
||||
|
||||
buildVM.Floors.Add(floorVM);
|
||||
}
|
||||
}
|
||||
projectVM.Buildings.Add(buildVM);
|
||||
}
|
||||
}
|
||||
return Ok(ApiResponse<object>.SuccessResponse(projectVM, "Success.", 200));
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Azure;
|
||||
using System.Data;
|
||||
using Marco.Pms.DataAccess.Data;
|
||||
using Marco.Pms.Model.Dtos.Roles;
|
||||
using Marco.Pms.Model.Entitlements;
|
||||
@ -10,9 +10,7 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Data;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
#nullable disable
|
||||
namespace MarcoBMS.Services.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
|
@ -113,13 +113,17 @@ namespace MarcoBMS.Services.Controllers
|
||||
if (taskAllocation == null) {
|
||||
return BadRequest(ApiResponse<object>.ErrorResponse("No such task has been allocated.", "No such task has been allocated.", 400));
|
||||
}
|
||||
if(taskAllocation.CompletedTask != 0)
|
||||
if(taskAllocation.WorkItem != null)
|
||||
{
|
||||
if (taskAllocation.CompletedTask != 0)
|
||||
{
|
||||
taskAllocation.WorkItem.CompletedWork -= taskAllocation.CompletedTask;
|
||||
}
|
||||
taskAllocation.ReportedDate = reportTask.ReportedDate;
|
||||
taskAllocation.CompletedTask = reportTask.CompletedTask;
|
||||
taskAllocation.WorkItem.CompletedWork += reportTask.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
var comment = reportTask.ToCommentFromReportTaskDto(tenantId,Employee.Id);
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
public async Task Invoke(HttpContext context)
|
||||
{
|
||||
if (context.User.Identity.IsAuthenticated)
|
||||
if (context.User.Identity != null && context.User.Identity.IsAuthenticated)
|
||||
{
|
||||
var tenantId = context.User.FindFirst("tenantId")?.Value;
|
||||
if (tenantId == null)
|
||||
|
@ -122,7 +122,7 @@ builder.Services.AddSingleton<ILoggingService, LoggingService>();
|
||||
builder.Services.AddHttpContextAccessor();
|
||||
|
||||
var jwtSettings = builder.Configuration.GetSection("Jwt").Get<JwtSettings>();
|
||||
if(jwtSettings != null)
|
||||
if(jwtSettings != null && jwtSettings.Key != null)
|
||||
{
|
||||
builder.Services.AddAuthentication(options =>
|
||||
{
|
||||
|
@ -14,19 +14,39 @@ namespace MarcoBMS.Services.Service
|
||||
public void LogError(string? message, params object[]? args)
|
||||
{
|
||||
using (LogContext.PushProperty("LogLevel", "Error"))
|
||||
if (args != null)
|
||||
{
|
||||
_logger.LogError(message, args);
|
||||
}
|
||||
else {
|
||||
_logger.LogError(message);
|
||||
}
|
||||
}
|
||||
|
||||
public void LogInfo(string? message, params object[]? args)
|
||||
{
|
||||
using (LogContext.PushProperty("LogLevel", "Information"))
|
||||
if (args != null)
|
||||
{
|
||||
_logger.LogInformation(message, args);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogInformation(message);
|
||||
}
|
||||
}
|
||||
|
||||
public void LogWarning(string? message, params object[]? args)
|
||||
{
|
||||
using (LogContext.PushProperty("LogLevel", "Warning"))
|
||||
_logger.LogWarning(message,args);
|
||||
if (args != null)
|
||||
{
|
||||
_logger.LogWarning(message, args);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogWarning(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
|
||||
#nullable disable
|
||||
namespace MarcoBMS.Services.Service
|
||||
{
|
||||
public class RefreshTokenService
|
||||
|
Loading…
x
Reference in New Issue
Block a user