finish customize chekcout header

This commit is contained in:
MahanCh
2025-04-08 16:50:51 +03:30
parent 4eb7e8eaf5
commit 4801fcfd89
6 changed files with 9797 additions and 141 deletions

View File

@@ -204,9 +204,9 @@ public class CustomizeCheckoutMandatoryViewModel
public WorkshopShiftStatus ShiftStatus { get; set; }
public IrregularShift IrregularShift { get; set; }
public ICollection<CustomizeRotatingShift> CustomizeRotatingShifts { get; set; }
public ICollection<CustomizeRotatingShift> CustomizeRotatingShifts { get; set; } = [];
public ICollection<CustomizeSifts> EmployeeSettingsShifts { get; set; }
public ICollection<CustomizeSifts> EmployeeSettingsShifts { get; set; } = [];
}

View File

@@ -0,0 +1,191 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class addheaderproperiesincustomizecheckout : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<TimeOnly>(
name: "IrregularShift_EndTime",
table: "CustomizeCheckoutTemps",
type: "time",
nullable: true);
migrationBuilder.AddColumn<TimeOnly>(
name: "IrregularShift_StartTime",
table: "CustomizeCheckoutTemps",
type: "time",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "IrregularShift_WorkshopIrregularShifts",
table: "CustomizeCheckoutTemps",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<TimeOnly>(
name: "IrregularShift_EndTime",
table: "CustomizeCheckouts",
type: "time",
nullable: true);
migrationBuilder.AddColumn<TimeOnly>(
name: "IrregularShift_StartTime",
table: "CustomizeCheckouts",
type: "time",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "IrregularShift_WorkshopIrregularShifts",
table: "CustomizeCheckouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.CreateTable(
name: "CustomizeCheckouts_CustomizeRotatingShifts",
columns: table => new
{
CustomizeCheckoutid = table.Column<long>(type: "bigint", nullable: false),
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
StartTime = table.Column<TimeOnly>(type: "time", nullable: false),
EndTime = table.Column<TimeOnly>(type: "time", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomizeCheckouts_CustomizeRotatingShifts", x => new { x.CustomizeCheckoutid, x.Id });
table.ForeignKey(
name: "FK_CustomizeCheckouts_CustomizeRotatingShifts_CustomizeCheckouts_CustomizeCheckoutid",
column: x => x.CustomizeCheckoutid,
principalTable: "CustomizeCheckouts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CustomizeCheckouts_RegularShifts",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CustomizeCheckoutid = table.Column<long>(type: "bigint", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false),
StartTime = table.Column<TimeOnly>(type: "time", nullable: false),
EndTime = table.Column<TimeOnly>(type: "time", nullable: false),
Placement = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomizeCheckouts_RegularShifts", x => x.id);
table.ForeignKey(
name: "FK_CustomizeCheckouts_RegularShifts_CustomizeCheckouts_CustomizeCheckoutid",
column: x => x.CustomizeCheckoutid,
principalTable: "CustomizeCheckouts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CustomizeCheckoutTemps_CustomizeRotatingShifts",
columns: table => new
{
CustomizeCheckoutTempid = table.Column<long>(type: "bigint", nullable: false),
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
StartTime = table.Column<TimeOnly>(type: "time", nullable: false),
EndTime = table.Column<TimeOnly>(type: "time", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomizeCheckoutTemps_CustomizeRotatingShifts", x => new { x.CustomizeCheckoutTempid, x.Id });
table.ForeignKey(
name: "FK_CustomizeCheckoutTemps_CustomizeRotatingShifts_CustomizeCheckoutTemps_CustomizeCheckoutTempid",
column: x => x.CustomizeCheckoutTempid,
principalTable: "CustomizeCheckoutTemps",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CustomizeCheckoutTemps_RegularShifts",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CustomizeCheckoutTempid = table.Column<long>(type: "bigint", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false),
StartTime = table.Column<TimeOnly>(type: "time", nullable: false),
EndTime = table.Column<TimeOnly>(type: "time", nullable: false),
Placement = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomizeCheckoutTemps_RegularShifts", x => x.id);
table.ForeignKey(
name: "FK_CustomizeCheckoutTemps_RegularShifts_CustomizeCheckoutTemps_CustomizeCheckoutTempid",
column: x => x.CustomizeCheckoutTempid,
principalTable: "CustomizeCheckoutTemps",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_CustomizeCheckouts_RegularShifts_CustomizeCheckoutid",
table: "CustomizeCheckouts_RegularShifts",
column: "CustomizeCheckoutid");
migrationBuilder.CreateIndex(
name: "IX_CustomizeCheckoutTemps_RegularShifts_CustomizeCheckoutTempid",
table: "CustomizeCheckoutTemps_RegularShifts",
column: "CustomizeCheckoutTempid");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CustomizeCheckouts_CustomizeRotatingShifts");
migrationBuilder.DropTable(
name: "CustomizeCheckouts_RegularShifts");
migrationBuilder.DropTable(
name: "CustomizeCheckoutTemps_CustomizeRotatingShifts");
migrationBuilder.DropTable(
name: "CustomizeCheckoutTemps_RegularShifts");
migrationBuilder.DropColumn(
name: "IrregularShift_EndTime",
table: "CustomizeCheckoutTemps");
migrationBuilder.DropColumn(
name: "IrregularShift_StartTime",
table: "CustomizeCheckoutTemps");
migrationBuilder.DropColumn(
name: "IrregularShift_WorkshopIrregularShifts",
table: "CustomizeCheckoutTemps");
migrationBuilder.DropColumn(
name: "IrregularShift_EndTime",
table: "CustomizeCheckouts");
migrationBuilder.DropColumn(
name: "IrregularShift_StartTime",
table: "CustomizeCheckouts");
migrationBuilder.DropColumn(
name: "IrregularShift_WorkshopIrregularShifts",
table: "CustomizeCheckouts");
}
}
}

View File

@@ -1679,10 +1679,10 @@ CreateWorkingHoursTemp command, bool holidayWorking)
#region CustomizeSettings
CustomizeWorkshopEmployeeSettings customizeWorkshopEmployeeSettings = _context.CustomizeWorkshopEmployeeSettings
.AsSplitQuery().FirstOrDefault(x =>
.AsSplitQuery().AsNoTracking().FirstOrDefault(x =>
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
CustomizeWorkshopSettings customizeWorkshopSettings =
_context.CustomizeWorkshopSettings.FirstOrDefault(x => x.WorkshopId == workshopId);
_context.CustomizeWorkshopSettings.AsNoTracking().FirstOrDefault(x => x.WorkshopId == workshopId);
//ToDo handel exception if is null
monthySalary = customizeWorkshopEmployeeSettings?.Salary ?? 0;
monthDays = customizeWorkshopSettings.MaxMonthDays == MaxMonthDays.ThirtyDaysForAllMonth
@@ -1710,7 +1710,7 @@ CreateWorkingHoursTemp command, bool holidayWorking)
#endregion
List<RollCallViewModel> rollCallResult = _context.RollCalls.Where(x =>
List<RollCallViewModel> rollCallResult = _context.RollCalls.AsNoTracking().Where(x =>
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.ShiftDate.Date >= contractStart.Date &&
x.ShiftDate.Date <= contractEnd.Date && x.EndDate != null)
.Select(x => new RollCallViewModel()

View File

@@ -15,10 +15,10 @@
//"MesbahDb": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]is[3019]#@ATt;TrustServerCertificate=true;"
//local
//"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;"
"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;"
//mahan Docker
"MesbahDb": "Data Source=localhost,5069;Initial Catalog=mesbah_db;User ID=sa;Password=YourPassword123;TrustServerCertificate=True;"
//"MesbahDb": "Data Source=localhost,5069;Initial Catalog=mesbah_db;User ID=sa;Password=YourPassword123;TrustServerCertificate=True;"
},
"GoogleRecaptchaV3": {
"SiteKey": "6Lfhp_AnAAAAAB79WkrMoHd1k8ir4m8VvfjE7FTH",