TeamWork Task And ticket uploud

This commit is contained in:
SamSys
2024-08-24 19:13:34 +03:30
parent eaea8e6de3
commit ed95fbd8d4
332 changed files with 83402 additions and 59336 deletions

View File

@@ -11,6 +11,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="PersianTools.Core" Version="2.0.4" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
</ItemGroup>

View File

@@ -91,6 +91,12 @@ public class AuthHelper : IAuthHelper
}
}
public string GetWorkshopSlug()
{
return CurrentAccountInfo().ClientAriaPermission == "true"
? _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "WorkshopSlug")?.Value
: "";
}
#endregion

View File

@@ -20,4 +20,6 @@ public interface IAuthHelper
void UpdateWorkshopSlugClaim(string workshopSlug);
#endregion
string GetWorkshopSlug();
}

View File

@@ -1,10 +1,16 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using _0_Framework.Infrastructure;
using PersianTools.Core;
using static System.Net.Mime.MediaTypeNames;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
using Image = System.Drawing.Image;
namespace _0_Framework.Application;
@@ -865,8 +871,109 @@ public static class Tools
var day = Convert.ToInt32(persianDate.Substring(8, 2));
return new PersianDateTime(year, month, day);
}
public static string ResizeImage(string imagePath, int width, int height)
{
using (var srcImage = Image.FromFile(imagePath))
{
var newImage = new Bitmap(width, height);
using (var graphics = Graphics.FromImage(newImage))
{
graphics.CompositingQuality = CompositingQuality.HighQuality;
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
graphics.SmoothingMode = SmoothingMode.HighQuality;
graphics.DrawImage(srcImage, 0, 0, width, height);
}
using (var memoryStream = new MemoryStream())
{
newImage.Save(memoryStream, ImageFormat.Jpeg);
return Convert.ToBase64String(memoryStream.ToArray());
}
}
}
public static PersianDateTime ToFirstDayOfNextMonth(this DateTime date)
{
var pc = new PersianCalendar();
var year = pc.GetYear(date);
var month = pc.GetMonth(date);
if (month == 12)
{
year += 1;
month = 1;
}
else
{
month += 1;
}
return new PersianDateTime(year, month, 1);
}
#endregion
#region Safa
public static string GetContentTypeImage(string extension)
{
if (!extension.StartsWith("."))
{
extension = "." + extension;
}
return extension.ToLower() switch
{
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".png" => "image/png",
".gif" => "image/gif",
".bmp" => "image/bmp",
".svg" => "image/svg+xml",
".ico" => "image/x-icon",
_ => "",
};
}
public static string GetContentType(string extension)
{
// Ensure the extension starts with a dot
if (!extension.StartsWith("."))
{
extension = "." + extension;
}
// Use switch expression to return the appropriate content type
return extension.ToLower() switch
{
".txt" => "text/plain",
".htm" => "text/html",
".html" => "text/html",
".css" => "text/css",
".js" => "application/javascript",
".json" => "application/json",
".xml" => "application/xml",
".pdf" => "application/pdf",
".zip" => "application/zip",
".rar" => "application/x-rar-compressed",
".tar" => "application/x-tar",
".mp3" => "audio/mpeg",
".wav" => "audio/wav",
".mp4" => "video/mp4",
".avi" => "video/x-msvideo",
".doc" => "application/msword",
".docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
".xls" => "application/vnd.ms-excel",
".xlsx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
".ppt" => "application/vnd.ms-powerpoint",
".pptx" => "application/vnd.openxmlformats-officedocument.presentationml.presentation",
_ => "application/octet-stream",
};
}
#endregion
public static string ConvertToEnglish(this string value)
{
if (string.IsNullOrEmpty(value))
@@ -991,6 +1098,7 @@ public static class Tools
return false;
return true;
}
#region Mahan
public static string ToFarsiDuration(this string date)
{
@@ -1103,6 +1211,14 @@ public static class Tools
}
}
#region DayOfWeekMethods
public static DateTime GetNextDayOfWeek(this DateTime date, DayOfWeek dayOfWeek)
{
int numberOfNextDayOfWeek = ((int)dayOfWeek - (int)date.DayOfWeek + 7) % 7;
return date.AddDays(numberOfNextDayOfWeek == 0 ? 7 : numberOfNextDayOfWeek);
}
#endregion
//این متد آخر همان روز را به صورت دیت تایم برمیگرداند
public static DateTime ToGeorgianDateTime2(this string persianDate)
@@ -1121,8 +1237,6 @@ public static class Tools
return res;
}
catch (Exception e)
{
@@ -1158,6 +1272,37 @@ public static class Tools
}
public static string DayOfWeeKToPersian(this DayOfWeek dayOfWeek)
{
return dayOfWeek switch
{
DayOfWeek.Friday => "جمعه",
DayOfWeek.Monday => "دوشنبه",
DayOfWeek.Saturday => "شنبه",
DayOfWeek.Sunday => "یکشنبه",
DayOfWeek.Thursday => "پنجشنبه",
DayOfWeek.Tuesday => "سه شنبه",
DayOfWeek.Wednesday => "چهارشنبه",
_ => ""
};
}
#endregion
#region Pooya
public static DateTime GetUndefinedDateTime()
{
return new DateTime(2121, 03, 21);
}
public static bool IsDateUndefined(this DateTime date)
{
return date == new DateTime(2121, 03, 21);
}
#endregion
}

View File

@@ -10,8 +10,8 @@ public static class Version
{
static Version()
{
StyleVersion = "2.11.34";
AdminVersion = "2.5.19";
StyleVersion = "2.12.00";
AdminVersion = "2.5.20";
CameraVersion = "1.0.3";
}

View File

@@ -21,6 +21,8 @@ public class AccountViewModel
public int PositionValue { get; set; }
public long PositionId { get; set; }
public string PositionIsActive { get; set; }
#endregion
public string AdminAreaPermission { get; set; }
}

View File

@@ -37,7 +37,7 @@ public interface IAccountApplication
OperationResult CreateNewWorkshopAccount(long currentAccountId, long newAccountId);
#region Mahan
List<AccountViewModel> AccountsForAssign(long accountId);
List<AccountViewModel> AccountsForAssign(long taskId);
List<AccountViewModel> GetAccountsByPositionId(long positionId);
List<AccountViewModel> GetAccountLowerPositionvalue();

View File

@@ -1,9 +1,41 @@
using System.Collections.Generic;
using System;
namespace AccountManagement.Application.Contracts.Assign;
public class AssignViewModel:EditAssign
public class AssignViewModel
{
public long Id { get; set; }
public string AssignedName { get; set; }
public int AssignedPositionValue { get; set; }
public long AssignerId { get; set; }
public long AssignedId { get; set; }
public long TaskId { get; set; }
public int AssignerPositionValue { get; set; }
//زمان پایان وظیفه
public string EndTaskDateFa { get; set; }
public DateTime EndTaskDateGr { get; set; }
//آیا درخواست مهلت کرده است؟
public bool TimeRequest { get; set; }
//تعداد تایید درخواست مهلت
public int AcceptedTimeRequest { get; set; }
//مهلت زمان درخواست شده
public DateTime? RequestDate { get; set; }
public string? RequestDateFa { get; set; }
//توضیحات درخواست مهلت
public string? TimeRequestDescription { get; set; }
//آیا درخواست انصراف داده شده
//آیا کنسل شده است
public bool IsCancel { get; set; }
//توضیحات درخواست انصراف
public string? CancelDescription { get; set; }
public bool IsDone { get; set; }
public bool IsDoneRequest { get; set; }
public string? DoneDescription { get; set; }
public bool IsCanceledRequest { get; set; }
}

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
namespace AccountManagement.Application.Contracts.Assign;
@@ -8,5 +9,27 @@ public class CreateAssign
public List<long> AssignedId { get; set; }
public long TaskId { get; set; }
public int AssignerPositionValue { get; set; }
//زمان پایان وظیفه
public string EndTaskDateFa { get; set; }
public DateTime EndTaskDateGr { get; set; }
//آیا درخواست مهلت کرده است؟
public bool TimeRequest { get; set; }
//تعداد تایید درخواست مهلت
public int AcceptedTimeRequest { get; set; }
//مهلت زمان درخواست شده
public DateTime? RequestDate { get; set; }
//توضیحات درخواست مهلت
public string? TimeRequestDescription { get; set; }
//آیا درخواست انصراف داده شده
//آیا کنسل شده است
public bool IsCancel { get; set; }
//توضیحات درخواست انصراف
public string? CancelDescription { get; set; }
public bool IsDone { get; set; }
public bool IsDoneRequest { get; set; }
public string? DoneDescription { get; set; }
public bool IsCanceledRequest { get; set; }
}

View File

@@ -10,6 +10,7 @@ public class CreateCameraAccount
{
public string Username { get; set; }
public string Password { get; set; }
public string RePassword { get; set; }
public string Mobile { get; set; }
public long WorkshopId { get; set; }
public string WorkshopName { get; set; }

View File

@@ -2,6 +2,6 @@
public class CompleteTaskViewModel
{
public long Id { get; set; }
public long TaskId { get; set; }
public string? Description { get; set; }
}

View File

@@ -16,6 +16,17 @@ public class CreateTask
public List<long> UploadedMedia { get; set; }
public long UploadedVoiceMedia { get; set; }
#region Task Schedule
public string ScheduleCount { get; set; }
public string ScheduleType{ get; set; }
public bool HasSchedule { get; set; }
public string ScheduleUnitType { get; set; }
public string ScheduleUnitNumber { get; set; }
#endregion
}

View File

@@ -1,4 +1,6 @@
namespace AccountManagement.Application.Contracts.Task;
using System.Security.AccessControl;
namespace AccountManagement.Application.Contracts.Task;
public class CreateTaskCancel
{
public long TaskId { get; set; }

View File

@@ -0,0 +1,19 @@
using AccountManagement.Application.Contracts.Account;
using AccountManagement.Application.Contracts.Position;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AccountManagement.Application.Contracts.Task;
public class CreateTaskModal
{
public CreateTask Command { get; set; }
public long TicketId{ get; set; }
public List<AccountViewModel> AccountsList { get; set; }
public List<PositionViewModel> PositionViewModels { get; set; }
public string DateFa { get; set; }
public long Id { get; set; }
}

View File

@@ -1,5 +1,8 @@
using System.Collections.Generic;
using AccountManagement.Application.Contracts.Account;
using AccountManagement.Application.Contracts.Assign;
using AccountManagement.Application.Contracts.Media;
using AccountManagement.Application.Contracts.Ticket;
namespace AccountManagement.Application.Contracts.Task;
public class EditTask:CreateTask
@@ -8,5 +11,12 @@ public class EditTask:CreateTask
public List<MediaViewModel> medias { get; set; }
public string? CompleteDescription { get; set; }
public bool IsDone { get; set; }
public bool IsCancel { get; set; }
public string CreateDateFa { get; set; }
public List<long> DeletedFileIds { get; set; }
public List<AssignViewModel> AssignViewModels { get; set; }
public AccountViewModel SenderViewModel { get; set; }
public EditTicket TicketViewModel { get; set; }
public long? TicketId { get; set; }
public List<AccountViewModel> AssignsLists { get; set; }
}

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Assign;
using AccountManagement.Application.Contracts.TaskMessage;
using Microsoft.AspNetCore.Http;
namespace AccountManagement.Application.Contracts.Task;
@@ -11,44 +12,53 @@ public interface ITaskApplication
OperationResult RemoveTask(long TaskId);
OperationResult RemoveFile(long MediaId);
OperationResult Edit(EditTask command);
OperationResult CreateAssign(CreateAssign command);
OperationResult CreateTask(CreateTask command);
OperationResult CreateTaskByPosition(CreateTask command);
EditTask GetDetails(long taskId);
EditTask GetDetails(long taskId);
//گرفتن تمامی وظایف
List<TaskViewModel> GetTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetSelfTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetAllNotSelfIncludedTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetAllTasks(TaskSearchModel searchModel);
//List<TaskViewModel> GetAllNotSelfIncludedTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetReceivedTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetSentTasks(TaskSearchModel searchModel);
// گرفتن مهلت برای یک وظیفه
OperationResult CreateRequestTime(CreateTaskTimeRequest command);
// گرفتن مهلت برای یک وظیفه
OperationResult CreateRequestTime(CreateTaskTimeRequest command);
//تایید مهلت وظیفه
OperationResult AcceptRequestDatetime(long taskId);
OperationResult RejectTimeRequest(long taskId);
OperationResult AcceptRequestDatetime(long taskId, long assignedId,string message);
OperationResult RejectTimeRequest(long taskId, long assignedId, string message);
//درخواست انصراف وظیفه
OperationResult CreateCancelRequest(CreateTaskCancel command);
//تایید اانصراف وظیفه
OperationResult AcceptCancelRequest(long taskId);
OperationResult RejectCancelRequest(long taskId);
OperationResult AcceptCancelRequest(long taskId,long assignedId, string message);
OperationResult RejectCancelRequest(long taskId, long assignedId, string message);
OperationResult CreateCompleteTaskRequest(CompleteTaskViewModel command);
OperationResult AcceptCompleteRequest(long taskId);
OperationResult RejectCompleteRequest(long taskId);
OperationResult AcceptCompleteRequest(long taskId, long assignedId, string message);
OperationResult RejectCompleteRequest(long taskId, long assignedId, string message);
OperationResult CreateTaskByPosition(CreateTask command, List<long> positionIds);
List<TaskViewModel> GetRequestedTasks(TaskSearchModel searchModel);
List<TaskViewModel> AllRequestedTasks(TaskSearchModel searchModel);
int GetRequestedTasksCount();
List<TaskMessageViewModel> GetTaskMessages(long assignId);
OperationResult ChangeRequestTimeAndAccept(string time,long taskId);
TaskViewModel GetRequestDetails(long id);
OperationResult UploadMedia(IFormFile mediaFile,long senderId);
OperationResult ChangeRequestTimeAndAccept(string time,long taskId,long assignedId, string message);
EditTask GetRequestDetails(long id);
OperationResult UploadMedia(IFormFile mediaFile, long senderId);
OperationResult RemoveMedia(long mediaId);
void RemoveTempUploadedFiles(long userId);
OperationResult SendTicketResponseInTask(long assignId,string message,long ticketId);
List<AssignViewModel> GetAssignsByTaskId(long taskId);
//متد انتقال داده از تسک به ارجاعی ها
//OperationResult MoveDataFRomTaskToAssign();
}

View File

@@ -18,26 +18,22 @@ public class TaskViewModel
public string EndTaskDateFA { get; set; }
public string EndTaskTime { get; set; }
public string RequestTaskDate { get; set; }
public bool IsDone { get; set; }
public bool IsDoneRequest { get; set; }
public string IsDoneDescription { get; set; }
public bool RequestCancel { get; set; }
public bool RequestCancel { get; set; }
public bool RequestTime { get; set; }
public bool IsCancel { get; set; }
public bool IsCancelRequest { get; set; }
public string CancelDescription { get; set; }
public int AcceptedTimeRequest { get; set; }
public string TimeRequestDescription { get; set; }
public DateTime EndTaskDateGE { get; set; }
public DateTime EndTaskDateGE { get; set; }
public DateTime CreateTaskDateGE { get; set; }
public string ContractingPartyName { get; set; }
public string? Description { get; set; }
public AccountViewModel Sender { get; set; }
public string Assigner { get; set; }
public string SelfName { get; set; }
public long SenderId { get; set; }
public string Color { get; set; }
@@ -52,5 +48,7 @@ public class TaskViewModel
public bool CanDelete { get; set; }
public bool CanAssign { get; set; }
public bool CanCheckRequests { get; set; }
public AssignViewModel AssignedReceiverViewModel { get; set; }
}

View File

@@ -0,0 +1,9 @@
namespace AccountManagement.Application.Contracts.TaskMessage;
public class CreateTaskMessage
{
public string Message { get; set; }
public long AssignId { get; set; }
public long SenderId { get; set; }
public long ReceiverId { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace AccountManagement.Application.Contracts.TaskMessage;
public class EditTaskMessage:CreateTaskMessage
{
public long Id { get; set; }
}

View File

@@ -0,0 +1,14 @@
using System.Security.Cryptography;
namespace AccountManagement.Application.Contracts.TaskMessage;
public class TaskMessageViewModel
{
public string Message { get; set; }
public string SenderName { get; set; }
public long SenderId { get; set; }
public long ReceiverId { get; set; }
public string TypeOfMessage { get; set; }
public string RequestedDateFa { get; set; }
public string CreationDate { get; set; }
}

View File

@@ -0,0 +1,12 @@
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Task;
namespace AccountManagement.Application.Contracts.TaskSchedule;
public interface ITaskScheduleApplication
{
OperationResult Create(CreateTask command);
OperationResult CreateLimitedTasks(CreateTask command);
OperationResult CreateUnlimitedTasks(CreateTask command);
}

View File

@@ -1,11 +1,17 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using AccountManagement.Application.Contracts.Media;
namespace AccountManagement.Application.Contracts.Ticket;
public class AdminResponseViewModel
{
public long Id { get; set; }
public string FullName { get; set; }
public string IsActive { get; set; }
public long TicketId { get; set; }
public string Response { get; set; }
public long AdminAccountId { get; set; }
public DateTime CreationDate { get; set; }
public List<MediaViewModel> MediaViewModels { get; set; }
}

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Http;
namespace AccountManagement.Application.Contracts.Ticket;
@@ -12,5 +13,7 @@ public class CreateTicket
public string TicketType { get; set; }
public List<long> UploadedMediaIds { get; set; }
public long ScreenShotId { get; set; }
public long VoiceId { get; set; }
public long VoiceId { get; set; }
public DateTime CreationDate { get; set; }
public long WorkshopId { get; set; }
}

View File

@@ -0,0 +1,10 @@
namespace AccountManagement.Application.Contracts.Ticket;
public class CreateTicketViewModel
{
public string FullName { get; set; }
public string CreateDate { get; set; }
public string WorkshopName { get; set; }
public string PhoneNumber { get; set; }
}

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using AccountManagement.Application.Contracts.Account;
using AccountManagement.Application.Contracts.Media;
namespace AccountManagement.Application.Contracts.Ticket;
@@ -7,6 +8,12 @@ public class EditTicket:CreateTicket
{
public long Id { get; set; }
public List<MediaViewModel> MediaViewModels { get; set; }
public List<AdminResponseViewModel> AdminResponseViewModels{ get; set; }
public List<Response> ResponseViewModels { get; set; }
public List<AdminResponseViewModel> AdminResponseViewModels{ get; set; }
public List<ClientResponseViewModel> ClientResponseViewModels { get; set; }
public AccountViewModel Sender { get; set; }
public string WorkshopName { get; set; }
public string TicketNumber { get; set; }
public string CreationDateStr { get; set; }
public string Status { get; set; }
}

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Task;
using Microsoft.AspNetCore.Http;
namespace AccountManagement.Application.Contracts.Ticket;
@@ -12,6 +13,21 @@ public interface ITicketApplication
OperationResult AdminResponseTicket(ResponseTicket command);
OperationResult ClientResponseTicket(ResponseTicket command);
EditTicket GetDetails(long id);
EditTicket GetDetailsForClient(long id);
List<TicketViewModel> GetAll(TicketSearchModel searchModel);
bool IsExist(long id);
OperationResult UploadMedia(IFormFile mediaFile, long senderId);
OperationResult RemoveMedia(long mediaId);
void RemoveTempUploadedFiles(long userId);
List<TicketViewModel> GetTicketsForClients(TicketSearchModel searchModel);
OperationResult AcceptPendingAdminResponse(long adminResId);
OperationResult RejectPendingAdminResponse(long adminResId);
OperationResult EditAndAcceptPendingAdminResponse(long adminResId,string newResponse);
OperationResult DeletePendingAdminResponse(int adminResId);
OperationResult EditPendingAdminResponse(long adminResId, string newMessage);
OperationResult CloseTicket(long ticketId);
}

View File

@@ -8,9 +8,16 @@ using System.Threading.Tasks;
namespace AccountManagement.Application.Contracts.Ticket;
public class Response
{
public long AdminResponseId { get; set; }
public long ClientResponseId { get; set; }
public long TicketId { get; set; }
public string FullName { get; set; }
public string ResponseMessage { get; set; }
public bool IsAdmin { get; set; }
public bool IsClient { get; set; }
public string IsActive { get; set; }
public long AdminAccountId { get; set; }
public List<MediaViewModel> MediaViewModels { get; set; }
public DateTime CreationDate { get; set; }
public string CreationDateStr { get; set; }
}

View File

@@ -6,6 +6,7 @@ public class ResponseTicket
{
public long TicketId { get; set; }
public string Response { get; set; }
public long AdminId { get; set; }
public List<long> UploadedFileIds { get; set; }
public long VoiceId { get; set; }
}

View File

@@ -2,6 +2,14 @@
public class TicketSearchModel
{
public int PageIndex { get; set; }
public string TicketNumber { get; set; }
public long WorkshopId { get; set; }
public long ClientAccountId { get; set; }
public string StartDate { get; set; }
public string EndDate { get; set; }
@@ -10,11 +18,7 @@ public class TicketSearchModel
public string OneDay { get; set; }
public string IsAssigned { get; set; }
public string TypeOfTicket { get; set; }
public string Title { get; set; }
public string GeneralSearch { get; set; }
public string Status { get; set; }

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Security.AccessControl;
namespace AccountManagement.Application.Contracts.Ticket;
@@ -11,5 +12,10 @@ public class TicketViewModel:EditTicket
public string CreationDateTime { get; set; }
public DateTime CreationDateTimeGr { get; set; }
public long? TaskId { get; set; }
public bool HasTask { get; set; }
public string RawTicketNumber { get; set; }
public int PageIndex { get; set; }
}

View File

@@ -0,0 +1,14 @@
using System.Collections.Generic;
using System.Runtime.InteropServices.ComTypes;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Account;
namespace AccountManagement.Application.Contracts.TicketAccessAccount;
public interface ITicketAccessAccountApplication
{
bool HasTicketAccess(long accountId);
OperationResult Create(long accountId);
OperationResult Delete(long id);
List<TicketAccessAccountViewModel> GetAllAccessedAccounts();
}

View File

@@ -0,0 +1,9 @@
namespace AccountManagement.Application.Contracts.TicketAccessAccount;
public class TicketAccessAccountViewModel
{
public long Id { get; set; }
public long AccountId { get; set; }
public string Name { get; set; }
public string CreateDateFa { get; set; }
}

View File

@@ -444,15 +444,15 @@ public class AccountApplication : IAccountApplication
{
return this._accountLeftworkRepository.SaveWorkshopAccount(workshopAccountList, startDate, leftDate, accountId);
}
public OperationResult CreateNewWorkshopAccount(long currentAccountId, long newAccountId)
{
return this._accountLeftworkRepository.CopyWorkshopToNewAccount(currentAccountId, newAccountId);
}
#region Mahan
public List<AccountViewModel> AccountsForAssign(long accountId)
public List<AccountViewModel> AccountsForAssign(long taskId)
{
return _accountRepository.AccountsForAssign(accountId);
return _accountRepository.AccountsForAssign(taskId);
}
public List<AccountViewModel> GetAccountsByPositionId(long positionId)
@@ -471,25 +471,28 @@ public class AccountApplication : IAccountApplication
public OperationResult ReLogin()
{
var prAcc = _authHelper.CurrentAccountInfo();
var operation = new OperationResult();
var account = _accountRepository.GetIncludePositions(prAcc.Id);
if (account == null)
return operation.Failed("این اکانت وجود ندارد");
var prAcc = _authHelper.CurrentAccountInfo();
var operation = new OperationResult();
var account = _accountRepository.GetIncludePositions(prAcc.Id);
if (account == null)
return operation.Failed("این اکانت وجود ندارد");
var permissions = _roleRepository.Get(account.RoleId)
.Permissions
.Select(x => x.Code)
.ToList();
var permissions = _roleRepository.Get(account.RoleId)
.Permissions
.Select(x => x.Code)
.ToList();
_authHelper.SignOut();
var authViewModel = new AuthViewModel(account.id, account.RoleId, account.Fullname
, account.Username, account.Mobile, account.ProfilePhoto, permissions, account.RoleName, account.AdminAreaPermission, account.ClientAriaPermission, account.Position.PositionValue);
_authHelper.Signin(authViewModel);
return operation.Succcedded(2);
_authHelper.SignOut();
var authViewModel = new AuthViewModel(account.id, account.RoleId, account.Fullname
, account.Username, account.Mobile, account.ProfilePhoto, permissions, account.RoleName, account.AdminAreaPermission, account.ClientAriaPermission, account.Position.PositionValue);
_authHelper.Signin(authViewModel);
return operation.Succcedded(2);
}
#endregion
}
}

View File

@@ -7,6 +7,7 @@
<ItemGroup>
<ProjectReference Include="..\AccountManagement.Application.Contracts\AccountManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\AccountManagement.Domain\AccountManagement.Domain.csproj" />
<ProjectReference Include="..\Company.Domain\Company.Domain.csproj" />
</ItemGroup>

View File

@@ -3,21 +3,24 @@ using _0_Framework.Application;
using AccountManagement.Application.Contracts.Account;
using AccountManagement.Application.Contracts.Position;
using AccountManagement.Domain.AccountAgg;
using AccountManagement.Domain.AssignAgg;
using TaskManager.Domain.PositionAgg;
namespace TaskManager.Application;
public class PositionApplication:IPositionApplication
public class PositionApplication : IPositionApplication
{
private readonly IPositionRepository _positionRepository;
private readonly IAccountRepository _accountRepository;
private readonly IAccountApplication _accountApplication;
private readonly IAssignRepository _assignRepository;
public PositionApplication(IPositionRepository positionRepository, IAccountRepository accountRepository, IAccountApplication accountApplication)
public PositionApplication(IPositionRepository positionRepository, IAccountRepository accountRepository, IAccountApplication accountApplication, IAssignRepository assignRepository)
{
_positionRepository = positionRepository;
_accountRepository = accountRepository;
_accountApplication = accountApplication;
_assignRepository = assignRepository;
}
//ساخت پوزیشن
public OperationResult Create(CreatePosition command)
@@ -29,18 +32,18 @@ public class PositionApplication:IPositionApplication
}
if (command.Value==0)
if (command.Value == 0)
{
return operation.Failed("لطفا سطح سمت را وارد کنید");
}
if (command.Value>5)
if (command.Value > 5)
{
return operation.Failed(" سطح سمت وارد شده معتبر نمیباشد");
}
if (_positionRepository.Exists(x=>x.PositionValue==command.Value))
if (_positionRepository.Exists(x => x.PositionValue == command.Value))
{
return operation.Failed("سطح انتخاب شده قبلا تعریف شده است");
}
@@ -54,12 +57,12 @@ public class PositionApplication:IPositionApplication
public OperationResult SaveAccountPosition(List<long> accountIds, long positionId)
{
var operation = new OperationResult();
if (!_positionRepository.Exists(x=>x.id==positionId))
if (!_positionRepository.Exists(x => x.id == positionId))
{
return operation.Failed("چنین سمتی وجود ندارد");
}
if (accountIds.Count<1)
if (accountIds.Count < 1)
{
return operation.Failed("لطفا شخصی برای ذخیره انتخاب کنید");
}
@@ -80,21 +83,31 @@ public class PositionApplication:IPositionApplication
public List<int> GetUnUsedPositionValues()
{
return _positionRepository.GetUnUsedPositionValues();
return _positionRepository.GetUnUsedPositionValues();
}
public OperationResult Remove(long id)
{
var operation = new OperationResult();
if (!_positionRepository.Exists(x=>x.id==id))
if (!_positionRepository.Exists(x => x.id == id))
{
return operation.Failed("سمت مورد نظر یافت نشد");
return operation.Failed("گروه مورد نظر یافت نشد");
}
if (_accountApplication.GetAccountsByPositionId(id).Count>0)
if (_accountApplication.GetAccountsByPositionId(id).Count > 0)
{
return operation.Failed("شما نمیتوانید سمتی که در آن شخصی وجود دارد را حذف کنید.");
return operation.Failed("شما نمیتوانید گروهی که در آن شخصی وجود دارد را حذف کنید.");
}
var deActives = _accountRepository.GetAccountsDeactivePositionValue(id);
if (deActives?.Count > 0)
{
foreach (var acc in deActives)
{
var account = _accountRepository.Get(acc.Id);
account.RemovePosition();
}
}
_positionRepository.Remove(id);
@@ -105,7 +118,7 @@ public class PositionApplication:IPositionApplication
public OperationResult Edit(EditPosition command)
{
var operation = new OperationResult();
if (_positionRepository.Exists(x=>x.id!=command.Id&&x.PositionName==command.Name))
if (_positionRepository.Exists(x => x.id != command.Id && x.PositionName == command.Name))
{
return operation.Failed("سمتی با این نام وجود دارد");
}
@@ -115,13 +128,13 @@ public class PositionApplication:IPositionApplication
}
var position = _positionRepository.Get(command.Id);
position.Edit(command.Name,command.Value);
position.Edit(command.Name, command.Value);
_positionRepository.SaveChanges();
return operation.Succcedded(command.Id);
}
//گرفتن تمامی پوزیشن ها برای نمایش
public List<PositionViewModel> GetPositions()=>
public List<PositionViewModel> GetPositions() =>
_positionRepository.GetPositions();
//ذخیره پوزیشن
public OperationResult Save()
@@ -132,7 +145,7 @@ public class PositionApplication:IPositionApplication
//حذف یک شخص از یک گروه
public OperationResult RemoveAccountFromPosition(long positionId, long AccountId)
{
var operation=new OperationResult();
var operation = new OperationResult();
if (!_accountRepository.Exists(x => x.id == AccountId))
{
return operation.Failed("چنین شخصی وجود ندارد");
@@ -142,19 +155,24 @@ public class PositionApplication:IPositionApplication
{
return operation.Failed("چنین شخصی در این گروه وجود ندارد");
}
account.DeletePositionId();
account.DeActivePosition();
_positionRepository.SaveChanges();
return operation.Succcedded();
return operation.Succcedded();
}
//حذف یک لیستی از اشخاص از یک گروه
public OperationResult RemoveAccountListFromPosition(List<long> accountIdList, long PositionId)
{
var operation= new OperationResult();
var operation = new OperationResult();
foreach (var account in accountIdList)
{
var acc = _accountRepository.GetIncludePositions(account);
acc.DeletePositionId();
if (_assignRepository.Exists(x => x.AssignerId == acc.id || x.AssignedId == acc.id))
acc.DeActivePosition();
else
acc.RemovePosition();
}
_accountRepository.SaveChanges();
return operation.Succcedded();

View File

@@ -1,7 +1,6 @@
using _0_Framework.Application;
using System;
using System.Collections.Generic;
using System.Data.OleDb;
using System.IO;
using System.Linq;
using AccountManagement.Application.Contracts.Assign;
@@ -10,12 +9,13 @@ using AccountManagement.Domain.AccountAgg;
using AccountManagement.Domain.AssignAgg;
using AccountManagement.Domain.MediaAgg;
using AccountManagement.Domain.TaskAgg;
using IPE.SmsIrClient.Models.Results;
using TaskManager.Domain.PositionAgg;
using System.Reflection;
using Microsoft.AspNetCore.Http;
using System.Globalization;
using AccountManagement.Application.Contracts.TaskMessage;
using AccountManagement.Domain.AdminResponseAgg;
using AccountManagement.Domain.TaskMessageAgg;
using AccountManagement.Domain.TicketAgg;
namespace AccountManagement.Application;
@@ -27,11 +27,13 @@ public class TaskApplication : ITaskApplication
private readonly IPositionRepository _positionRepository;
private readonly IAssignRepository _assignRepository;
private readonly IHttpContextAccessor _contextAccessor;
private readonly ITaskMessageRepository _taskMessageRepository;
private readonly ITicketRepository _ticketRepository;
private readonly IAuthHelper _authHelper;
public TaskApplication(ITaskRepository taskRepository, IAccountRepository accountRepository, IMediaRepository mediaRepository, IAssignRepository assignRepository, IHttpContextAccessor contextAccessor, IPositionRepository positionRepository, IAuthHelper authHelper)
public TaskApplication(ITaskRepository taskRepository, IAccountRepository accountRepository, IMediaRepository mediaRepository, IAssignRepository assignRepository, IHttpContextAccessor contextAccessor, IPositionRepository positionRepository, IAuthHelper authHelper, ITaskMessageRepository taskMessageRepository, ITicketRepository ticketRepository)
{
_taskRepository = taskRepository;
_accountRepository = accountRepository;
@@ -39,8 +41,9 @@ public class TaskApplication : ITaskApplication
_assignRepository = assignRepository;
_contextAccessor = contextAccessor;
_positionRepository = positionRepository;
_authHelper = authHelper;
_taskMessageRepository = taskMessageRepository;
_ticketRepository = ticketRepository;
}
//غیرفعال سازی تسک
public OperationResult DeActiveTask(long TaskId)
@@ -67,6 +70,7 @@ public class TaskApplication : ITaskApplication
}
var task = _taskRepository.Get(TaskId);
var assigns = _assignRepository.GetAssignsByTaskId(TaskId);
var positionValue = int.Parse(_contextAccessor.HttpContext.User.FindFirst("PositionValue").Value);
var sender = _accountRepository.GetIncludePositions(task.SenderId);
if (sender.Position.PositionValue < positionValue)
@@ -74,7 +78,7 @@ public class TaskApplication : ITaskApplication
return operation.Failed("شما نمیتواند وظیفه ای که سطحی از شما پایین تر دارد را حذف کنید");
}
var medias = _mediaRepository.GetMediaByTaskId(TaskId);
if (task.IsCanceledRequest || task.IsDone || task.IsCancel || task.TimeRequest || task.AcceptedTimeRequest > 0)
if (assigns.Any(x => x.IsCanceledRequest || x.IsDone || x.IsCancel || x.TimeRequest || x.AcceptedTimeRequest > 0))
{
task.DeActive();
}
@@ -114,22 +118,18 @@ public class TaskApplication : ITaskApplication
{
return operation.Failed("لطفا عنوان وظیفه خود ار وارد کنید");
}
if (string.IsNullOrEmpty(command.EndTaskDate))
{
return operation.Failed("لطفا تاریخ انجام وظیفه را وارد کنید");
}
if (command.ReceiverId.Count < 1)
{
return operation.Failed("طرف وظیفه خود را وارد کنید");
}
if (command.SenderId < 1)
{
return operation.Failed("خطای سیستمی!!!");
}
var sender = _accountRepository.GetIncludePositions(command.SenderId);
if (sender.Position.PositionValue < posValue)
{
@@ -167,14 +167,14 @@ public class TaskApplication : ITaskApplication
return operation.Failed("لطفا تاریخ را به درستی وارد کنید");
}
task.Edit(command.Title, endTask, command.Description, command.SenderId, command.ContractingPartyName);
task.Edit(command.Title, command.Description, command.SenderId, command.ContractingPartyName);
_taskRepository.SaveChanges();
_assignRepository.RemoveRangeAssigns(task.id);
foreach (var receiver in receivers)
{
var assign = new Assign(task.id, task.SenderId, receiver.id, sender.Position.PositionValue,
receiver.Fullname,
receiver.Position.PositionValue);
receiver.Position.PositionValue, endTask);
_assignRepository.Create(assign);
}
_assignRepository.SaveChanges();
@@ -184,53 +184,19 @@ public class TaskApplication : ITaskApplication
#region SaveDocuments
if (command.UploadedMedia?.Count>0)
if (command.UploadedMedia?.Count > 0)
{
foreach (var mediaId in command.UploadedMedia)
{
var media = _mediaRepository.Get(mediaId);
var oldPath = media.Path;
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
File.Move(oldPath, filepath);
media.Edit(filepath, media.Type, media.Category);
_mediaRepository.SaveChanges();
_mediaRepository.CreateMediaWithTaskMedia(task.id, media.id);
MoveTaskFile(mediaId, task.id);
}
}
#endregion
if (command.UploadedVoiceMedia > 0)
{
var media = _mediaRepository.Get(command.UploadedVoiceMedia);
var oldPath = media.Path;
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
File.Move(oldPath, filepath);
media.Edit(filepath, media.Type, "صوت");
_mediaRepository.SaveChanges();
_mediaRepository.CreateMediaWithTaskMedia(task.id, media.id);
MoveTaskFile(command.UploadedVoiceMedia, task.id, "voice");
}
#region DeleteMedias
@@ -269,6 +235,28 @@ public class TaskApplication : ITaskApplication
return operation.Failed("خطای سیستمی!!");
}
var assignEntity = _assignRepository.GetAssignByAssignedIdAndTaskId(command.AssignerId, command.TaskId);
var now = DateTime.Now;
if (assignEntity.EndTaskDate < now)
{
operation.Failed("شما نمیتوانید وظیفه ای که مهلت آن گذشته است را به کسی ارجاع دهید");
}
if (_assignRepository.Exists(x => x.TaskId == command.TaskId && command.AssignedId.Contains(x.AssignedId)))
{
var assignedIdsInDataBase = _assignRepository.GetAssignedIdsByTaskId(command.TaskId);
var similarIds = assignedIdsInDataBase.Intersect(command.AssignedId).ToList();
var assignedAccounts = _accountRepository.GetAccountsByIds(similarIds);
string accNames = "";
foreach (var account in assignedAccounts)
{
accNames = accNames + account.Fullname + "،";
}
return operation.Failed($"به اشخاص {accNames} قبلا این تسک ارجاع داده شده است");
}
foreach (var assignedId in command.AssignedId)
{
if (!_accountRepository.Exists(x => x.id == assignedId))
@@ -278,13 +266,19 @@ public class TaskApplication : ITaskApplication
}
var task = _taskRepository.Get(command.TaskId);
var endOfDayDateTime = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59);
var assigner = _accountRepository.GetIncludePositions(command.AssignerId);
foreach (var assignedId in command.AssignedId)
{
var assigned = _accountRepository.GetIncludePositions(assignedId);
var assign = new Assign(command.TaskId, command.AssignerId, assignedId, assigner.Position.PositionValue,
assigned.Fullname, assigned.Position.PositionValue);
assigned.Fullname, assigned.Position.PositionValue, endOfDayDateTime);
_assignRepository.Create(assign);
}
_assignRepository.SaveChanges();
@@ -296,8 +290,9 @@ public class TaskApplication : ITaskApplication
var operation = new OperationResult();
if (string.IsNullOrEmpty(command.Title))
{
return operation.Failed("لطفا عنوان وظیفه خود ار وارد کنید");
return operation.Failed("لطفا عنوان وظیفه خود را وارد کنید");
}
var now = DateTime.Now.Date;
if (string.IsNullOrEmpty(command.EndTaskDate))
{
@@ -305,11 +300,9 @@ public class TaskApplication : ITaskApplication
return operation.Failed("لطفا تاریخ انجام وظیفه را وارد کنید");
}
if (string.IsNullOrEmpty(command.ContractingPartyName))
{
return operation.Failed("لطفا طرف حساب خودرا وارد کنید");
return operation.Failed("لطفا طرف حساب خود را وارد کنید");
}
@@ -361,8 +354,6 @@ public class TaskApplication : ITaskApplication
{
}
var endTask = string.IsNullOrWhiteSpace(command.EndTaskTime) || command.EndTaskTime == "00:00" ? command.EndTaskDate.ToGeorgianDateTime2() : command.EndTaskDate.ToGeorgianDateWithTime(command.EndTaskTime);
var errorDateTime = new DateTime(3000, 12, 20, new PersianCalendar());
@@ -375,65 +366,34 @@ public class TaskApplication : ITaskApplication
{
return operation.Failed("لطفا تاریخ آینده را وارد کنید");
}
var task = new Tasks(command.Title, endTask, command.Description, command.SenderId, command.ContractingPartyName);
var task = new Tasks(command.Title, command.Description, command.SenderId, command.ContractingPartyName);
_taskRepository.Create(task);
_assignRepository.SaveChanges();
foreach (var receiver in receivers)
{
var assign = new Assign(task.id, task.SenderId, receiver.id, sender.Position.PositionValue, receiver.Fullname,
receiver.Position.PositionValue);
receiver.Position.PositionValue, endTask);
_assignRepository.Create(assign);
}
#region SaveMedias
#region SaveDocuments
if (command.UploadedMedia?.Count > 0)
{
foreach (var mediaId in command.UploadedMedia)
{
var media = _mediaRepository.Get(mediaId);
var oldPath = media.Path;
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
{
foreach (var mediaId in command.UploadedMedia)
{
MoveTaskFile(mediaId, task.id);
}
}
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
File.Move(oldPath, filepath);
media.Edit(filepath, media.Type, media.Category);
_mediaRepository.SaveChanges();
_mediaRepository.CreateMediaWithTaskMedia(task.id, media.id);
}
}
#endregion
if (command.UploadedVoiceMedia > 0)
{
var media = _mediaRepository.Get(command.UploadedVoiceMedia);
var oldPath = media.Path;
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
File.Move(oldPath, filepath);
media.Edit(filepath, media.Type, "صوت");
_mediaRepository.SaveChanges();
_mediaRepository.CreateMediaWithTaskMedia(task.id, media.id);
MoveTaskFile(command.UploadedVoiceMedia, task.id, "voice");
}
#endregion
@@ -446,7 +406,7 @@ public class TaskApplication : ITaskApplication
var operation = new OperationResult();
var sender = _accountRepository.GetIncludePositions(command.SenderId);
var receivers = _positionRepository.GetAccountsByIds(command.PositionId);
var receivers = _positionRepository.GetAccountsByPositionIds(command.PositionId);
if (sender.Position.PositionValue == 1)
@@ -461,9 +421,6 @@ public class TaskApplication : ITaskApplication
{
}
DateTime endTask;
if (string.IsNullOrWhiteSpace(command.EndTaskTime))
{
@@ -474,62 +431,33 @@ public class TaskApplication : ITaskApplication
endTask = command.EndTaskDate.ToGeorgianDateWithTime(command.EndTaskTime);
}
var task = new Tasks(command.Title, endTask, command.Description, command.SenderId, command.ContractingPartyName);
var task = new Tasks(command.Title, command.Description, command.SenderId, command.ContractingPartyName);
_taskRepository.Create(task);
_assignRepository.SaveChanges();
foreach (var receiver in receivers)
{
var assign = new Assign(task.id, task.SenderId, receiver.id, sender.Position.PositionValue, receiver.Fullname,
receiver.Position.PositionValue);
receiver.Position.PositionValue, endTask);
_assignRepository.Create(assign);
}
#region SaveMedias
#region SaveDocuments
foreach (var mediaId in command.UploadedMedia)
if (command.UploadedMedia?.Count > 0)
{
var media = _mediaRepository.Get(mediaId);
var oldPath = media.Path;
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
File.Move(oldPath, filepath);
media.Edit(filepath, media.Type, media.Category);
_mediaRepository.SaveChanges();
_mediaRepository.CreateMediaWithTaskMedia(task.id, media.id);
foreach (var mediaId in command.UploadedMedia)
{
MoveTaskFile(mediaId, task.id);
}
}
#endregion
if (command.UploadedVoiceMedia > 0)
{
var media = _mediaRepository.Get(command.UploadedVoiceMedia);
var oldPath = media.Path;
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
File.Move(oldPath, filepath);
media.Edit(filepath, media.Type, "صوت");
_mediaRepository.SaveChanges();
_mediaRepository.CreateMediaWithTaskMedia(task.id, media.id);
MoveTaskFile(command.UploadedVoiceMedia, task.id, "voice");
}
@@ -539,7 +467,7 @@ public class TaskApplication : ITaskApplication
return operation.Succcedded(task.id);
}
// ویرایش تسک
// جزئیات تسک
public EditTask GetDetails(long taskId)
{
return _taskRepository.GetDetails(taskId);
@@ -558,11 +486,16 @@ public class TaskApplication : ITaskApplication
return _taskRepository.GetSelfTasks(searchModel);
}
public List<TaskViewModel> GetAllNotSelfIncludedTasks(TaskSearchModel searchModel)
public List<TaskViewModel> GetAllTasks(TaskSearchModel searchModel)
{
return _taskRepository.GetAllNotSelfIncludedTasks(searchModel);
return _taskRepository.GetAllTasks(searchModel);
}
//public List<TaskViewModel> GetAllNotSelfIncludedTasks(TaskSearchModel searchModel)
//{
// return _taskRepository.GetAllNotSelfIncludedTasks(searchModel);
//}
public List<TaskViewModel> GetReceivedTasks(TaskSearchModel searchModel)
{
return _taskRepository.GetReceivedTasks(searchModel);
@@ -594,7 +527,7 @@ public class TaskApplication : ITaskApplication
}
var task = _taskRepository.Get(command.TaskId);
var task = _taskRepository.GetIncludeAssign(command.TaskId);
var requestTime = command.RequestTime.ToGeorgianDateTime();
var errorDateTime = new DateTime(3000, 12, 20, new PersianCalendar());
if (requestTime == errorDateTime)
@@ -603,39 +536,91 @@ public class TaskApplication : ITaskApplication
}
if (task.SenderId == accountId)
{
task.ChangeTimeTask(requestTime);
foreach (var assign in task.Assigns)
{
assign.ChangeTimeTask(requestTime);
var message = new TaskMessage(command.Description, "تغییر تاریخ", assign.id);
_taskMessageRepository.Create(message);
_taskMessageRepository.SaveChanges();
_taskMessageRepository.CreateTaskMessageItems(accountId, assign.AssignedId, message.id);
}
_taskMessageRepository.SaveChanges();
}
else
{
task.CreateTimeRequest(requestTime, command.Description);
var assign = _assignRepository.GetAssignByAssignedIdAndTaskId(accountId, command.TaskId);
assign.CreateTimeRequest(requestTime, command.Description);
var message = new TaskMessage(command.Description, "درخواست مهلت", assign.id, command.RequestTime);
_taskMessageRepository.Create(message);
_taskMessageRepository.SaveChanges();
_taskMessageRepository.CreateTaskMessageItems(accountId, assign.Task.SenderId, message.id);
}
_taskRepository.SaveChanges();
return operation.Succcedded(task.id);
}
//تایید درخواست مهلت
public OperationResult AcceptRequestDatetime(long taskId)
public OperationResult AcceptRequestDatetime(long taskId, long assignedId, string message)
{
var accountId = _authHelper.CurrentAccountId();
var operation = new OperationResult();
if (!_taskRepository.Exists(x => x.id == taskId))
{
return operation.Failed("چنین وظیفه ای وجود ندارد");
}
var task = _taskRepository.Get(taskId);
if (!task.TimeRequest)
var assign = _assignRepository.GetAssignByAssignedIdAndTaskId(assignedId, taskId);
if (!assign.TimeRequest)
{
return operation.Failed("چنین وظیفه ای درخواستی برای مهلت ندارد");
}
if (task.RequestDate == null)
if (assign.RequestDate == null)
{
return operation.Failed("تاریخی برای درخواست وظیفه ثبت نشده است");
}
task.AcceptTimeRequest();
_taskRepository.SaveChanges();
return operation.Succcedded(task.id);
assign.AcceptTimeRequest();
message = string.IsNullOrWhiteSpace(message) ? "درخواست شما مورد تایید قرار گرفت" : message;
var messageEntity = new TaskMessage(message, "تایید درخواست مهلت", assign.id);
_taskMessageRepository.Create(messageEntity);
_taskMessageRepository.SaveChanges();
_taskMessageRepository.CreateTaskMessageItems(accountId, assignedId, messageEntity.id);
_assignRepository.SaveChanges();
return operation.Succcedded(taskId);
}
//لغو درخواست مهلت تسک
public OperationResult RejectTimeRequest(long taskId, long assignedId, string message)
{
var accountId = _authHelper.CurrentAccountId();
var operation = new OperationResult();
if (!_taskRepository.Exists(x => x.id == taskId))
{
return operation.Failed("چنین وظیفه ای وجود ندارد");
}
var assign = _assignRepository.GetAssignByAssignedIdAndTaskId(assignedId, taskId);
if (!assign.TimeRequest)
{
return operation.Failed("چنین وظیفه ای درخواستی برای مهلت ندارد");
}
assign.RejectTimeRequest();
if (assign.EndTaskDate.Date <= DateTime.Now.Date)
{
var now = DateTime.Now;
var endOfDay = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59);
assign.EditTime(endOfDay);
}
var messageEntity = new TaskMessage(message, "رد درخواست مهلت", assign.id);
_taskMessageRepository.Create(messageEntity);
_taskMessageRepository.SaveChanges();
_taskMessageRepository.CreateTaskMessageItems(accountId, assignedId, messageEntity.id);
_assignRepository.SaveChanges();
return operation.Succcedded(taskId);
}
//ساخت درخواست کنسل
public OperationResult CreateCancelRequest(CreateTaskCancel command)
{
@@ -650,120 +635,188 @@ public class TaskApplication : ITaskApplication
{
return operation.Failed("چنین وظیفه ای وجود ندارد");
}
var task = _taskRepository.Get(command.TaskId);
task.CreateCancelRequest(command.Description);
var task = _taskRepository.GetIncludeAssign(command.TaskId);
if (task.SenderId == accountId)
{
task.AcceptCancelRequest();
foreach (var assign in task.Assigns)
{
assign.CreateCancelRequest(command.Description);
assign.AcceptCancelRequest();
var message = new TaskMessage(command.Description, "لغو", assign.id);
_taskMessageRepository.Create(message);
_taskMessageRepository.SaveChanges();
_taskMessageRepository.CreateTaskMessageItems(accountId, assign.AssignedId, message.id);
}
_taskMessageRepository.SaveChanges();
}
_taskRepository.SaveChanges();
else
{
var assign = _assignRepository.GetAssignByAssignedIdAndTaskId(accountId, task.id);
assign.CreateCancelRequest(command.Description);
var message = new TaskMessage(command.Description, "درخواست کنسل", assign.id);
_taskMessageRepository.Create(message);
_taskMessageRepository.SaveChanges();
_taskMessageRepository.CreateTaskMessageItems(accountId, assign.Task.SenderId, message.id);
}
_assignRepository.SaveChanges();
return operation.Succcedded(task.id);
}
//تایید درخواست کنسل
public OperationResult AcceptCancelRequest(long taskId)
public OperationResult AcceptCancelRequest(long taskId, long assignedId, string message)
{
var accountId = _authHelper.CurrentAccountId();
var operation = new OperationResult();
if (!_taskRepository.Exists(x => x.id == taskId))
{
return operation.Failed("چنین وظیفه ای وجود ندارد");
}
var task = _taskRepository.Get(taskId);
if (!task.IsCanceledRequest)
var assign = _assignRepository.GetAssignByAssignedIdAndTaskId(assignedId, taskId);
if (!assign.IsCanceledRequest)
{
return operation.Failed("چنین وظیفه ای درخواستی برای انصراف ندارد");
}
task.AcceptCancelRequest();
_taskRepository.SaveChanges();
assign.AcceptCancelRequest();
message = string.IsNullOrWhiteSpace(message) ? "درخواست شما مورد تایید قرار گرفت" : message;
var messageEntity = new TaskMessage(message, "تایید درخواست کنسل", assign.id);
_taskMessageRepository.Create(messageEntity);
_taskMessageRepository.SaveChanges();
_taskMessageRepository.CreateTaskMessageItems(accountId, assignedId, messageEntity.id);
_assignRepository.SaveChanges();
return operation.Succcedded(taskId);
}
//لغو درخواست کنسل تسک
public OperationResult RejectCancelRequest(long taskId, long assignedId, string message)
{
var accountId = _authHelper.CurrentAccountId();
var operation = new OperationResult();
if (!_taskRepository.Exists(x => x.id == taskId))
{
return operation.Failed("چنین وظیفه ای وجود ندارد");
}
var assign = _assignRepository.GetAssignByAssignedIdAndTaskId(assignedId, taskId);
if (!assign.IsCanceledRequest)
{
return operation.Failed("چنین وظیفه ای درخواستی برای انصراف ندارد");
}
assign.RejectCancel();
if (assign.EndTaskDate.Date <= DateTime.Now.Date)
{
var now = DateTime.Now;
var endOfDay = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59);
assign.EditTime(endOfDay);
}
var messageEntity = new TaskMessage(message, "رد درخواست کنسل", assign.id);
_taskMessageRepository.Create(messageEntity);
_taskMessageRepository.SaveChanges();
_taskMessageRepository.CreateTaskMessageItems(accountId, assignedId, messageEntity.id);
_assignRepository.SaveChanges();
return operation.Succcedded(taskId);
}
//انجام شدن تسک
public OperationResult CreateCompleteTaskRequest(CompleteTaskViewModel command)
{
var accountId = _authHelper.CurrentAccountId();
var operation = new OperationResult();
if (!_taskRepository.Exists(x => x.id == command.Id))
if (!_taskRepository.Exists(x => x.id == command.TaskId))
{
return operation.Failed("چنین وظیفه ای وجود ندارد");
}
var task = _taskRepository.Get(command.Id);
task.CompleteRequest(command.Description);
var task = _taskRepository.GetIncludeAssign(command.TaskId);
if (task.SenderId ==accountId)
{
command.Description=string.IsNullOrWhiteSpace(command.Description) ? "وظیفه محول‌شده توسط ارسال کننده به پایان رسیده است." :command.Description;
}
else
{
command.Description = string.IsNullOrWhiteSpace(command.Description) ? "وظیفه محول شده با موفقیت به اتمام رسید." : command.Description;
}
if (task.SenderId == accountId)
{
task.Completed();
foreach (var assign in task.Assigns)
{
assign.CompleteRequest(command.Description);
assign.Completed();
var message = new TaskMessage(command.Description, "تکمیل", assign.id);
_taskMessageRepository.Create(message);
_taskMessageRepository.SaveChanges();
_taskMessageRepository.CreateTaskMessageItems(accountId, assign.AssignedId, message.id);
}
_taskMessageRepository.SaveChanges();
}
_taskRepository.SaveChanges();
else
{
var assign = _assignRepository.GetAssignByAssignedIdAndTaskId(accountId, task.id);
assign.CompleteRequest(command.Description);
var message = new TaskMessage(command.Description, "درخواست انجام", assign.id);
_taskMessageRepository.Create(message);
_taskMessageRepository.SaveChanges();
_taskMessageRepository.CreateTaskMessageItems(accountId, assign.Task.SenderId, message.id);
}
_assignRepository.SaveChanges();
return operation.Succcedded(task.id);
}
public OperationResult AcceptCompleteRequest(long taskId)
public OperationResult AcceptCompleteRequest(long taskId, long assignedId, string message)
{
var accountId = _authHelper.CurrentAccountId();
var operation = new OperationResult();
if (!_taskRepository.Exists(x => x.id == taskId))
{
return operation.Failed("چنین وظیفه ای وجود ندارد");
}
var task = _taskRepository.Get(taskId);
if (!task.IsDoneRequest)
var assign = _assignRepository.GetAssignByAssignedIdAndTaskId(assignedId, taskId);
if (!assign.IsDoneRequest)
{
return operation.Failed("چنین وظیفه ای درخواستی برای تایید ندارد");
}
task.Completed();
_taskRepository.SaveChanges();
assign.Completed();
message = string.IsNullOrWhiteSpace(message) ? "درخواست شما مورد تایید قرار گرفت" : message;
var messageEntity = new TaskMessage(message, "تایید درخواست انجام", assign.id);
_taskMessageRepository.Create(messageEntity);
_taskMessageRepository.SaveChanges();
_taskMessageRepository.CreateTaskMessageItems(accountId, assignedId, messageEntity.id);
_assignRepository.SaveChanges();
return operation.Succcedded(taskId);
}
public OperationResult RejectCompleteRequest(long taskId)
public OperationResult RejectCompleteRequest(long taskId, long assignedId, string message)
{
var accountId = _authHelper.CurrentAccountId();
var operation = new OperationResult();
if (!_taskRepository.Exists(x => x.id == taskId))
{
return operation.Failed("چنین وظیفه ای وجود ندارد");
}
var task = _taskRepository.Get(taskId);
if (!task.IsDoneRequest)
var assign = _assignRepository.GetAssignByAssignedIdAndTaskId(assignedId, taskId);
if (!assign.IsDoneRequest)
{
return operation.Failed("چنین وظیفه ای درخواستی برای انصراف ندارد");
}
task.RejectCompleteRequest();
_taskRepository.SaveChanges();
assign.RejectCompleteRequest();
if (assign.EndTaskDate.Date <= DateTime.Now.Date)
{
var now = DateTime.Now;
var endOfDay = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59);
assign.EditTime(endOfDay);
}
var messageEntity = new TaskMessage(message, "رد درخواست انجام", assign.id);
_taskMessageRepository.Create(messageEntity);
_taskMessageRepository.SaveChanges();
_taskMessageRepository.CreateTaskMessageItems(accountId, assignedId, messageEntity.id);
_assignRepository.SaveChanges();
return operation.Succcedded(taskId);
}
//لغو درخواست کنسل تسک
public OperationResult RejectCancelRequest(long taskId)
{
var operation = new OperationResult();
if (!_taskRepository.Exists(x => x.id == taskId))
{
return operation.Failed("چنین وظیفه ای وجود ندارد");
}
var task = _taskRepository.Get(taskId);
if (!task.IsCanceledRequest)
{
return operation.Failed("چنین وظیفه ای درخواستی برای انصراف ندارد");
}
task.RejectCancel();
_taskRepository.SaveChanges();
return operation.Succcedded(taskId);
}
//لغو درخواست مهلت تسک
public OperationResult RejectTimeRequest(long taskId)
{
var operation = new OperationResult();
if (!_taskRepository.Exists(x => x.id == taskId))
{
return operation.Failed("چنین وظیفه ای وجود ندارد");
}
var task = _taskRepository.Get(taskId);
if (!task.TimeRequest)
{
return operation.Failed("چنین وظیفه ای درخواستی برای مهلت ندارد");
}
task.RejectTimeRequest();
_taskRepository.SaveChanges();
return operation.Succcedded(task.id);
}
public OperationResult CreateTaskByPosition(CreateTask command, List<long> positionIds)
{
@@ -801,7 +854,12 @@ public class TaskApplication : ITaskApplication
public List<TaskViewModel> AllRequestedTasks(TaskSearchModel searchModel)
{
return _taskRepository.AllRequestedTasks(searchModel);
return _taskRepository.AllRequestedTasks(searchModel);
}
public List<TaskMessageViewModel> GetTaskMessages(long assignId)
{
return _taskMessageRepository.GetTaskMessages(assignId);
}
public int GetRequestedTasksCount()
@@ -809,40 +867,45 @@ public class TaskApplication : ITaskApplication
return _taskRepository.GetRequestedTasksCount();
}
public OperationResult ChangeRequestTimeAndAccept(string time, long taskId)
public OperationResult ChangeRequestTimeAndAccept(string time, long taskId, long assignedId, string message)
{
var accountId = _authHelper.CurrentAccountId();
var operation = new OperationResult();
if (!_taskRepository.Exists(x => x.id == taskId))
{
return operation.Failed("چنین وظیفه ای وجود ندارد");
}
var task = _taskRepository.Get(taskId);
if (!task.TimeRequest)
var assign = _assignRepository.GetAssignByAssignedIdAndTaskId(assignedId, taskId);
if (!assign.TimeRequest)
{
return operation.Failed("چنین وظیفه ای درخواستی برای مهلت ندارد");
}
if (task.RequestDate == null)
if (assign.RequestDate == null)
{
return operation.Failed("تاریخی برای درخواست وظیفه ثبت نشده است");
}
DateTime timeGr = time.ToGeorgianDateTime2();
task.ChangeTimeTask(timeGr);
assign.ChangeTimeTask(timeGr);
var messageEntity = new TaskMessage(message, "تایید و تغییر درخواست کنسل", assign.id);
_taskMessageRepository.Create(messageEntity);
_taskMessageRepository.SaveChanges();
_taskMessageRepository.CreateTaskMessageItems(accountId, assignedId, messageEntity.id);
_taskRepository.SaveChanges();
return operation.Succcedded(task.id);
return operation.Succcedded(taskId);
}
public TaskViewModel GetRequestDetails(long id)
public EditTask GetRequestDetails(long id)
{
return _taskRepository.GetRequestDetails(id);
}
public OperationResult UploadMedia(IFormFile mediaFile, long senderId)
{
var operation = new OperationResult();
if ((mediaFile.Length > 2000000) || (mediaFile.Length > 2000000) || (mediaFile.Length > 2000000))
return operation.Failed("حجم فایل نمیتواند از 2 مگابایت بیشتر باشد");
if ((mediaFile.Length > 5000000))
return operation.Failed("حجم فایل نمیتواند از 5 مگابایت بیشتر باشد");
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
"temp", $"{senderId}");
Directory.CreateDirectory(path);
@@ -897,4 +960,51 @@ public class TaskApplication : ITaskApplication
}
}
public OperationResult SendTicketResponseInTask(long assignId, string message, long ticketId)
{
var accountId = _authHelper.CurrentAccountId();
var operation = new OperationResult();
var assign = _assignRepository.GetIncludeTask(assignId);
if (ticketId != assign.Task.TicketId)
{
return operation.Failed("خطای سیستمی!");
}
var adminRes = new AdminResponse(message, ticketId, accountId);
_ticketRepository.CreateAdminResponse(adminRes);
_ticketRepository.SaveChanges();
return operation.Succcedded();
}
public List<AssignViewModel> GetAssignsByTaskId(long taskId)
{
return _assignRepository.GetAssignsByTaskId(taskId);
}
//public OperationResult MoveDataFRomTaskToAssign()
//{
// return _taskRepository.MoveDataFRomTaskToAssign();
//}
public void MoveTaskFile(long mediaId, long taskId, string category = "file")
{
var media = _mediaRepository.Get(mediaId);
var oldPath = media.Path;
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
"Task", $"{taskId}");
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
File.Move(oldPath, filepath);
string categoryMedia = category == "file" ? media.Category :
category == "voice" ? "صوت" : throw new InvalidDataException();
media.Edit(filepath, media.Type, categoryMedia);
_mediaRepository.SaveChanges();
_mediaRepository.CreateMediaWithTaskMedia(taskId, media.id);
}
}

View File

@@ -0,0 +1,223 @@
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Task;
using AccountManagement.Application.Contracts.TaskSchedule;
using AccountManagement.Domain.TaskScheduleAgg;
using System;
using System.IO;
using Company.Domain.HolidayItemAgg;
namespace AccountManagement.Application;
public class TaskScheduleApplication : ITaskScheduleApplication
{
private readonly ITaskApplication _taskApplication;
private readonly ITaskScheduleRepository _taskScheduleRepository;
private readonly IHolidayItemRepository _holidayItemRepository;
public TaskScheduleApplication(ITaskApplication taskApplication, ITaskScheduleRepository taskScheduleRepository, IHolidayItemRepository holidayItemRepository)
{
_taskApplication = taskApplication;
_taskScheduleRepository = taskScheduleRepository;
_holidayItemRepository = holidayItemRepository;
}
public OperationResult Create(CreateTask command)
{
OperationResult operation = new OperationResult();
if (command.HasSchedule)
{
switch (command.ScheduleType)
{
case "limited":
if (Convert.ToInt32(command.ScheduleCount) > 60)
{
return operation.Failed("تعداد وارد شده بیشتر از حد مجاز است");
}
return CreateLimitedTasks(command);
break;
case "unlimited":
return CreateUnlimitedTasks(command);
break;
default:
return operation.Failed("خطای سیستمی!");
}
}
else
{
return operation.Failed("این تسک بصورت زمان بندی شده نمیباشد");
}
}
public OperationResult CreateLimitedTasks(CreateTask command)
{
OperationResult operation = new OperationResult();
if (Convert.ToInt32(command.ScheduleCount) < 1 || string.IsNullOrWhiteSpace(command.ScheduleCount))
{
return operation.Failed("تعداد وارد شده باید بیشتر از 2 باشد");
}
switch (command.ScheduleUnitType)
{
case "year":
if (Convert.ToInt32(command.ScheduleCount) != 1)
{
return operation.Failed("دوره نمیتواند بیشتر از 1 سال باشد");
}
break;
case "month":
if (Convert.ToInt32(command.ScheduleCount) > 12)
{
return operation.Failed("بازه وارد شده نا معتبر است");
}
break;
case "week":
if (command.ScheduleUnitNumber != "first" && command.ScheduleUnitNumber != "last")
{
return operation.Failed("بازه وارد شده نا معتبر است");
}
break;
case "day":
if (Convert.ToInt32(command.ScheduleUnitNumber) > 29)
{
return operation.Failed("بازه وارد شده نا معتبر است");
}
break;
default:
return operation.Failed("نوع بازه مشخص نمیباشد");
break;
}
try
{
DateTime previousDateRaw = command.EndTaskDate.ToGeorgianDateTime2();
DateTime previousDateEdited = command.EndTaskDate.ToGeorgianDateTime2();
int count = Convert.ToInt32(command.ScheduleCount);
bool isInt = int.TryParse(command.ScheduleUnitNumber, out int unitNumber);
string kindOfWeekUnit = isInt ? "" : command.ScheduleUnitNumber;
switch (command.ScheduleUnitType)
{
case "year":
for (int i = 1; i <= count; i++)
{
command.EndTaskDate = previousDateEdited.ToFarsi();
operation = _taskApplication.CreateTask(command);
bool isHoliday = _holidayItemRepository.GetHoliday(previousDateRaw);
while (isHoliday || previousDateEdited.DayOfWeek == DayOfWeek.Friday)
{
previousDateEdited = previousDateRaw.AddDays(1);
isHoliday = _holidayItemRepository.GetHoliday(previousDateEdited);
}
previousDateRaw = previousDateRaw.AddYears(unitNumber);
previousDateEdited = previousDateRaw;
}
break;
case "month":
for (int i = 1; i <= count; i++)
{
command.EndTaskDate = previousDateEdited.ToFarsi();
operation = _taskApplication.CreateTask(command);
bool isHoliday = _holidayItemRepository.GetHoliday(previousDateRaw);
while (isHoliday || previousDateEdited.DayOfWeek == DayOfWeek.Friday)
{
previousDateEdited = previousDateRaw.AddDays(1);
isHoliday = _holidayItemRepository.GetHoliday(previousDateEdited);
}
previousDateRaw = previousDateRaw.AddMonths(unitNumber);
previousDateEdited = previousDateRaw;
}
break;
case "week":
for (int i = 1; i <= count; i++)
{
if (string.IsNullOrWhiteSpace(kindOfWeekUnit))
{
throw new InvalidDataException();
}
command.EndTaskDate = kindOfWeekUnit switch
{
"first" => previousDateRaw.GetNextDayOfWeek(DayOfWeek.Saturday).ToFarsi(),
"last" => previousDateRaw.GetNextDayOfWeek(DayOfWeek.Thursday).ToFarsi(),
_ => throw new InvalidDataException()
};
operation = _taskApplication.CreateTask(command);
bool isHoliday = _holidayItemRepository.GetHoliday(previousDateRaw);
while (isHoliday || previousDateEdited.DayOfWeek == DayOfWeek.Friday)
{
previousDateEdited = previousDateRaw.AddDays(1);
isHoliday = _holidayItemRepository.GetHoliday(previousDateEdited);
}
previousDateRaw = command.EndTaskDate.ToGeorgianDateTime();
previousDateEdited = previousDateRaw;
}
break;
case "day":
for (int i = 1; i <= count; i++)
{
command.EndTaskDate = previousDateEdited.ToFarsi();
operation = _taskApplication.CreateTask(command);
previousDateRaw = previousDateRaw.AddDays(unitNumber);
bool isHoliday = _holidayItemRepository.GetHoliday(previousDateRaw);
while (isHoliday || previousDateEdited.DayOfWeek == DayOfWeek.Friday)
{
previousDateEdited = previousDateRaw.AddDays(1);
isHoliday = _holidayItemRepository.GetHoliday(previousDateEdited);
}
previousDateEdited = previousDateRaw;
}
break;
default:
return operation.Failed("نوع بازه درست نمیباشد");
}
var lastDate = command.EndTaskDate.ToGeorgianDateTime();
var taskSchedule = new TaskSchedule(command.ScheduleCount, command.ScheduleType, command.ScheduleUnitType,
command.ScheduleUnitNumber, lastDate);
_taskScheduleRepository.Create(taskSchedule);
_taskScheduleRepository.SaveChanges();
operation = operation.Succcedded();
return operation;
}
catch (Exception e)
{
return operation.Failed(e.ToString());
}
}
public OperationResult CreateUnlimitedTasks(CreateTask command)
{
var operation = _taskApplication.CreateTask(command);
if (!operation.IsSuccedded)
return operation;
var lastDate = command.EndTaskDate.ToGeorgianDateTime();
var taskSchedule = new TaskSchedule(command.ScheduleCount, command.ScheduleType, command.ScheduleUnitType,
command.ScheduleUnitNumber, lastDate);
_taskScheduleRepository.Create(taskSchedule);
_taskScheduleRepository.SaveChanges();
return operation.Succcedded();
}
}

View File

@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.TaskSubject;
using AccountManagement.Domain.TaskSubjectAgg;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
namespace AccountManagement.Application;

View File

@@ -0,0 +1,60 @@
using System.Collections.Generic;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.TicketAccessAccount;
using AccountManagement.Domain.AccountAgg;
using AccountManagement.Domain.TicketAccessAccountAgg;
namespace AccountManagement.Application;
public class TicketAccessAccountApplication : ITicketAccessAccountApplication
{
private readonly ITicketAccessAccountRepository _ticketAccessAccountRepository;
private readonly IAccountRepository _accountRepository;
public TicketAccessAccountApplication(ITicketAccessAccountRepository ticketAccessAccountRepository, IAccountRepository accountRepository)
{
_ticketAccessAccountRepository = ticketAccessAccountRepository;
_accountRepository = accountRepository;
}
public bool HasTicketAccess(long accountId)
{
return _ticketAccessAccountRepository.HasTicketAccess(accountId);
}
public OperationResult Create(long accountId)
{
OperationResult operation = new();
if (!_accountRepository.Exists(x => x.id == accountId && x.AdminAreaPermission == "true"))
{
return operation.Failed("شخص انتخاب شده نا معتبر است");
}
if (_ticketAccessAccountRepository.Exists(x => x.AccountId == accountId))
return operation.Failed("به این شخص قبلا دسترسی داده شده است");
TicketAccessAccount accessAccountEntity = new(accountId);
_ticketAccessAccountRepository.Create(accessAccountEntity);
_ticketAccessAccountRepository.SaveChanges();
return operation.Succcedded(accessAccountEntity.id);
}
public OperationResult Delete(long id)
{
OperationResult operation = new();
if (!_ticketAccessAccountRepository.Exists(x => x.id == id))
return operation.Failed("اطلاعات داده شده نامعتبر است");
_ticketAccessAccountRepository.Remove(id);
_ticketAccessAccountRepository.SaveChanges();
return operation.Succcedded(id);
}
public List<TicketAccessAccountViewModel> GetAllAccessedAccounts()
{
return _ticketAccessAccountRepository.GetAllAccessedAccounts();
}
}

View File

@@ -2,10 +2,10 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Task;
using AccountManagement.Application.Contracts.Ticket;
using AccountManagement.Application.Contracts.TicketAccessAccount;
using AccountManagement.Domain.AccountAgg;
using AccountManagement.Domain.AdminResponseAgg;
using AccountManagement.Domain.AssignAgg;
@@ -13,7 +13,7 @@ using AccountManagement.Domain.ClientResponseAgg;
using AccountManagement.Domain.MediaAgg;
using AccountManagement.Domain.TaskAgg;
using AccountManagement.Domain.TicketAgg;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
namespace AccountManagement.Application;
@@ -24,14 +24,18 @@ public class TicketApplication : ITicketApplication
private readonly ITaskRepository _taskRepository;
private readonly IAssignRepository _assignRepository;
private readonly IMediaRepository _mediaRepository;
private readonly ITicketAccessAccountApplication _ticketAccessAccountApplication;
private readonly IAuthHelper _authHelper;
public TicketApplication(ITicketRepository ticketRepository, IAccountRepository accountRepository, ITaskRepository taskRepository, IAssignRepository assignRepository, IMediaRepository mediaRepository)
public TicketApplication(ITicketRepository ticketRepository, IAccountRepository accountRepository, ITaskRepository taskRepository, IAssignRepository assignRepository, IMediaRepository mediaRepository, ITicketAccessAccountApplication ticketAccessAccountApplication, IAuthHelper authHelper)
{
_ticketRepository = ticketRepository;
_accountRepository = accountRepository;
_taskRepository = taskRepository;
_assignRepository = assignRepository;
_mediaRepository = mediaRepository;
_ticketAccessAccountApplication = ticketAccessAccountApplication;
_authHelper = authHelper;
}
public OperationResult CreateTicket(CreateTicket command)
@@ -47,21 +51,24 @@ public class TicketApplication : ITicketApplication
return operation.Failed("لطفا عنوان را وارد کنید");
}
if (string.IsNullOrWhiteSpace(command.Description))
if (string.IsNullOrWhiteSpace(command.Description) && command.VoiceId < 1)
{
return operation.Failed("لطفا توضیحات خودرا وارد کنید");
}
else if (string.IsNullOrWhiteSpace(command.Description))
{
command.Description = "";
}
var ticketNumber = (_ticketRepository.GetLastTicketNumber() + 1).ToString("D5");
var ticket = new Ticket(command.Title, command.Description, command.SenderId, command.ContractingPartyName,
command.TicketType);
command.TicketType, command.WorkshopId, ticketNumber);
_ticketRepository.Create(ticket);
_ticketRepository.SaveChanges();
#region SaveDocuments
if (command.UploadedMediaIds?.Count>0)
if (command.UploadedMediaIds?.Count > 0)
{
foreach (var mediaId in command.UploadedMediaIds)
{
@@ -80,6 +87,7 @@ public class TicketApplication : ITicketApplication
_mediaRepository.SaveChanges();
_mediaRepository.CreateTicketMedia(ticket.id, media.id);
_mediaRepository.SaveChanges();
}
}
if (command.ScreenShotId > 0)
@@ -90,13 +98,14 @@ public class TicketApplication : ITicketApplication
"Ticket", $"{ticket.id}");
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, Path.GetFileName(path));
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
File.Move(oldPath, filepath);
media.Edit(filepath, media.Type, media.Category);
media.Edit(filepath, media.Type, "اسکرین شات");
_mediaRepository.SaveChanges();
_mediaRepository.CreateTicketMedia(ticket.id, media.id);
}
@@ -105,13 +114,13 @@ public class TicketApplication : ITicketApplication
#region SaveVoice
if (command.VoiceId > 0)
{
var media = _mediaRepository.Get(command.ScreenShotId);
var media = _mediaRepository.Get(command.VoiceId);
var oldPath = media.Path;
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
"Ticket", $"{ticket.id}");
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, Path.GetFileName(path));
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
File.Move(oldPath, filepath);
media.Edit(filepath, media.Type, "صوت");
@@ -119,6 +128,7 @@ public class TicketApplication : ITicketApplication
_mediaRepository.SaveChanges();
_mediaRepository.CreateTicketMedia(ticket.id, media.id);
}
#endregion
@@ -181,27 +191,34 @@ public class TicketApplication : ITicketApplication
{
}
var ticket = _ticketRepository.Get(ticketId);
if (ticket == null)
return operation.Failed("چنین پشتیبانی وجود ندارد");
var endTask = string.IsNullOrWhiteSpace(command.EndTaskTime) ? command.EndTaskDate.ToGeorgianDateTime2() : command.EndTaskDate.ToGeorgianDateWithTime(command.EndTaskTime);
var task = new Tasks(command.Title, endTask, command.Description, command.SenderId, command.ContractingPartyName, ticketId);
var task = new Tasks(command.Title, command.Description, command.SenderId, command.ContractingPartyName, ticketId);
_taskRepository.Create(task);
ticket.AssignedToTasks();
_assignRepository.SaveChanges();
foreach (var receiver in receivers)
{
var assign = new Assign(task.id, task.SenderId, receiver.id, sender.Position.PositionValue, receiver.Fullname,
receiver.Position.PositionValue);
receiver.Position.PositionValue, endTask);
_assignRepository.Create(assign);
}
_assignRepository.SaveChanges();
#region SaveMedias
#region SaveDocuments
if (command.UploadedMedia?.Count>0)
if (command.UploadedMedia?.Count > 0)
{
foreach (var mediaId in command.UploadedMedia)
{
@@ -221,7 +238,7 @@ public class TicketApplication : ITicketApplication
_mediaRepository.SaveChanges();
_mediaRepository.CreateMediaWithTaskMedia(task.id, media.id);
}
}
#endregion
@@ -245,7 +262,7 @@ public class TicketApplication : ITicketApplication
}
#endregion
_taskRepository.SaveChanges();
@@ -268,18 +285,28 @@ public class TicketApplication : ITicketApplication
public OperationResult AdminResponseTicket(ResponseTicket command)
{
var operation = new OperationResult();
if (string.IsNullOrWhiteSpace(command.Response))
if (string.IsNullOrWhiteSpace(command.Response) && !(command.UploadedFileIds?.Count > 0) && !(command.VoiceId > 0))
{
return operation.Failed("لطفا پیغام خود را وارد کنبد");
return operation.Failed("لطفا پیغام یا فایل را وارد کنید");
}
var adminRes = new AdminResponse(command.Response, command.TicketId);
_ticketRepository.CreateAdminResponse(adminRes);
_ticketRepository.SaveChanges();
if (string.IsNullOrWhiteSpace(command.Response))
{
command.Response = "$GOzaReshgirMediaVoIce@";
}
var adminRes = new AdminResponse(command.Response, command.TicketId, command.AdminId);
if (_ticketAccessAccountApplication.HasTicketAccess(command.AdminId))
adminRes.Active();
var ticket = _ticketRepository.Get(command.TicketId);
_ticketRepository.CreateAdminResponse(adminRes);
ticket.Responded();
_ticketRepository.SaveChanges();
#region SaveDocuments
if (command.UploadedFileIds?.Count>0)
if (command.UploadedFileIds?.Count > 0)
{
foreach (var mediaId in command.UploadedFileIds)
{
@@ -300,10 +327,28 @@ public class TicketApplication : ITicketApplication
_mediaRepository.CreateAdminResponseMedia(adminRes.id, media.id);
}
}
if (command.VoiceId > 0)
{
var media = _mediaRepository.Get(command.VoiceId);
var oldPath = media.Path;
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
"TicketAdminResponse", $"{adminRes.id}");
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
File.Move(oldPath, filepath);
media.Edit(filepath, media.Type, "صوت");
_mediaRepository.SaveChanges();
_mediaRepository.CreateAdminResponseMedia(adminRes.id, media.id);
}
#endregion
_mediaRepository.SaveChanges();
return operation.Succcedded(adminRes.id);
}
@@ -311,17 +356,24 @@ public class TicketApplication : ITicketApplication
public OperationResult ClientResponseTicket(ResponseTicket command)
{
var operation = new OperationResult();
if (string.IsNullOrWhiteSpace(command.Response) && !(command.UploadedFileIds?.Count > 0) && !(command.VoiceId > 0))
{
return operation.Failed("لطفا پیغام یا فایل را وارد کنید");
}
if (string.IsNullOrWhiteSpace(command.Response))
{
return operation.Failed("لطفا پیغام خود را وارد کنبد");
command.Response = "$GOzaReshgirMediaVoIce@";
}
var clientRes = new ClientResponse(command.Response, command.TicketId);
var ticket = _ticketRepository.Get(command.TicketId);
_ticketRepository.CreateClientResponse(clientRes);
_ticketRepository.SaveChanges();
ticket.Open();
_ticketRepository.SaveChanges();
#region SaveDocuments
if (command.UploadedFileIds?.Count>0)
if (command.UploadedFileIds?.Count > 0)
{
foreach (var mediaId in command.UploadedFileIds)
{
@@ -343,6 +395,25 @@ public class TicketApplication : ITicketApplication
}
}
if (command.VoiceId > 0)
{
var media = _mediaRepository.Get(command.VoiceId);
var oldPath = media.Path;
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
"TicketClientResponse", $"{clientRes.id}");
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
File.Move(oldPath, filepath);
media.Edit(filepath, media.Type, "صوت");
_mediaRepository.SaveChanges();
_mediaRepository.CreateClientResponseMedia(clientRes.id, media.id);
}
#endregion
_mediaRepository.SaveChanges();
return operation.Succcedded(clientRes.id);
@@ -353,6 +424,11 @@ public class TicketApplication : ITicketApplication
return _ticketRepository.GetDetails(id);
}
public EditTicket GetDetailsForClient(long id)
{
return _ticketRepository.GetDetailsForClient(id);
}
public List<TicketViewModel> GetAll(TicketSearchModel searchModel)
{
return _ticketRepository.GetAll(searchModel);
@@ -360,6 +436,168 @@ public class TicketApplication : ITicketApplication
public bool IsExist(long id)
{
return _ticketRepository.Exists(x => x.id == id);
return _ticketRepository.Exists(x => x.id == id);
}
public OperationResult UploadMedia(IFormFile mediaFile, long senderId)
{
var operation = new OperationResult();
if ((mediaFile.Length > 5000000) || (mediaFile.Length > 5000000) || (mediaFile.Length > 5000000))
return operation.Failed("حجم فایل نمیتواند از 5 مگابایت بیشتر باشد");
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
"temp", $"{senderId}");
Directory.CreateDirectory(path);
string uniqueFileName = $"{Path.GetFileNameWithoutExtension(mediaFile.FileName)}_{DateTime.Now.Ticks}{Path.GetExtension(mediaFile.FileName)}";
string filepath = Path.Combine(path, uniqueFileName);
using (var stream = new FileStream(filepath, FileMode.Create))
{
mediaFile.CopyTo(stream);
}
var type = Path.GetExtension(filepath);
var media = new Media(filepath, type, "فایل");
_mediaRepository.Create(media);
_mediaRepository.SaveChanges();
return operation.Succcedded(media.id);
}
public OperationResult RemoveMedia(long mediaId)
{
var operation = new OperationResult();
try
{
var media = _mediaRepository.Get(mediaId);
var path = media.Path;
if (File.Exists(path))
{
File.Delete(path);
}
_mediaRepository.Remove(mediaId);
return operation.Succcedded();
}
catch
{
return operation.Failed("مشکلی در حذف این فایل وجود دارد");
}
}
public void RemoveTempUploadedFiles(long userId)
{
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
"temp", $"{userId}");
if (Directory.Exists(path))
{
Directory.Delete(path, true);
}
}
public List<TicketViewModel> GetTicketsForClients(TicketSearchModel searchModel)
{
return _ticketRepository.GetTicketsForClients(searchModel);
}
public OperationResult AcceptPendingAdminResponse(long adminResId)
{
var operation = new OperationResult();
var adminRes = _ticketRepository.GetAdminResponse(adminResId);
var ticket = _ticketRepository.Get(adminRes.TicketId);
if (adminRes.IsActiveString == "true")
{
return operation.Failed("خطایی رخ داده است . لطفا با مدیر سیستم تماس بگیرید");
}
adminRes.Active();
ticket.Responded();
_ticketRepository.SaveChanges();
return operation.Succcedded();
}
public OperationResult RejectPendingAdminResponse(long adminResId)
{
var operation = new OperationResult();
var adminRes = _ticketRepository.GetAdminResponse(adminResId);
if (adminRes.IsActiveString == "true")
{
return operation.Failed("خطایی رخ داده است . لطفا با مدیر سیستم تماس بگیرید");
}
_ticketRepository.RemoveAdminResponse(adminResId);
_ticketRepository.SaveChanges();
return operation.Succcedded();
}
public OperationResult EditAndAcceptPendingAdminResponse(long adminResId, string newResponse)
{
var operation = new OperationResult();
var adminRes = _ticketRepository.GetAdminResponse(adminResId);
var ticket = _ticketRepository.Get(adminRes.TicketId);
if (adminRes.IsActiveString == "true")
{
return operation.Failed("خطایی رخ داده است . لطفا با مدیر سیستم تماس بگیرید");
}
adminRes.Edit(newResponse);
adminRes.Active();
ticket.Responded();
_ticketRepository.SaveChanges();
return operation.Succcedded();
}
public OperationResult DeletePendingAdminResponse(int adminResId)
{
var operation = new OperationResult();
var userId = _authHelper.CurrentAccountId();
try
{
var adminRes = _ticketRepository.GetAdminResponse(adminResId);
if (adminRes.AdminAccountId!=userId)
{
return operation.Failed("شما نمیتوانید این پیام را پاک کنید");
}
if (adminRes.IsActiveString=="true")
{
return operation.Failed("شما نمیتوانید این پیام را پاک کنید");
}
_ticketRepository.RemoveAdminResponse(adminResId);
_taskRepository.SaveChanges();
return operation.Succcedded();
}
catch (Exception e)
{
return operation.Failed(e.ToString());
}
}
public OperationResult EditPendingAdminResponse(long adminResId,string newMessage)
{
var operation = new OperationResult();
var entity=_ticketRepository.GetAdminResponse(adminResId);
if (entity==null)
{
return operation.Failed("مشکل سیستمی!!");
}
entity.Edit(newMessage);
_ticketRepository.SaveChanges();
return operation.Succcedded();
}
public OperationResult CloseTicket(long ticketId)
{
var operation= new OperationResult();
var ticket = _ticketRepository.Get(ticketId);
if (ticket == null)
{
return operation.Failed("اطلاعات وارد شده نامعتبر است");
}
ticket.Completed();
_ticketRepository.SaveChanges();
return operation.Succcedded();
}
}

View File

@@ -6,6 +6,7 @@ using AccountManagement.Application.Contracts.Role;
using AccountManagement.Application.Contracts.Task;
using AccountManagement.Application.Contracts.TaskSubject;
using AccountManagement.Application.Contracts.Ticket;
using AccountManagement.Application.Contracts.TicketAccessAccount;
using AccountManagement.Domain.AccountAgg;
using AccountManagement.Domain.AccountLeftWorkAgg;
using AccountManagement.Domain.AssignAgg;
@@ -13,7 +14,9 @@ using AccountManagement.Domain.CameraAccountAgg;
using AccountManagement.Domain.MediaAgg;
using AccountManagement.Domain.RoleAgg;
using AccountManagement.Domain.TaskAgg;
using AccountManagement.Domain.TaskMessageAgg;
using AccountManagement.Domain.TaskSubjectAgg;
using AccountManagement.Domain.TicketAccessAccountAgg;
using AccountManagement.Domain.TicketAgg;
using AccountMangement.Infrastructure.EFCore;
using AccountMangement.Infrastructure.EFCore.Repository;
@@ -41,13 +44,15 @@ namespace AccountManagement.Configuration
services.AddTransient<IAccountLeftworkRepository, AccountLeftworkRepository>();
//services.AddTransient<IWorkshopAccountRepository, IWorkshopAccountRepository>();
#region Mahan
services.AddTransient<IPositionRepository, PositionRepository>();
//services.AddTransient<IWorkshopAccountRepository, IWorkshopAccountRepository>();
#region Mahan
services.AddTransient<IPositionRepository, PositionRepository>();
services.AddTransient<IPositionApplication, PositionApplication>();
services.AddScoped<ITaskRepository, TaskRepository>();
services.AddTransient<ITaskApplication, TaskApplication>();
services.AddTransient<ITaskRepository, TaskRepository>();
services.AddTransient<ITaskSubjectRepository, TaskSubjectRepository>();
services.AddTransient<ITaskSubjectApplication, TaskSubjectApplication>();
@@ -59,6 +64,12 @@ namespace AccountManagement.Configuration
services.AddTransient<ITicketRepository, TicketRepository>();
services.AddTransient<ITicketApplication, TicketApplication>();
services.AddTransient<ITaskMessageRepository, TaskMessageRepository>();
services.AddTransient<ITicketAccessAccountRepository, TicketAccessAccountRepository>();
services.AddTransient<ITicketAccessAccountApplication, TicketAccessAccountApplication>();
#endregion

View File

@@ -27,7 +27,7 @@ namespace AccountManagement.Domain.AccountAgg
public string IsActiveString { get; private set; }
#region Mahan
public string PositionIsActive { get; private set; }
public long? PositionId { get; private set; }
public Position Position { get; private set; }
@@ -128,13 +128,19 @@ namespace AccountManagement.Domain.AccountAgg
public void SetPosition(long positionId)
{
PositionId = positionId;
PositionIsActive = "true";
}
public void DeletePositionId()
public void DeActivePosition()
{
PositionIsActive = "false";
}
public void RemovePosition()
{
PositionId = null;
PositionIsActive = null;
}
#endregion
}
}

View File

@@ -9,6 +9,7 @@ namespace AccountManagement.Domain.AccountAgg
{
Account GetBy(string username);
Account GetById(long id);
EditAccount GetDetails(long id);
EditAccount GetByVerifyCode(string code, string phone);
EditAccount GetByUserNameAndId(long id, string username);
@@ -17,15 +18,15 @@ namespace AccountManagement.Domain.AccountAgg
List<AccountViewModel> GetClientsAccount();
List<AccountViewModel> Search(AccountSearchModel searchModel);
Task RemoveCode(long id);
#region Mahan
Account GetIncludePositions(long id);
List<AccountViewModel> GetAccountsByPositionId(long positionId);
List<AccountViewModel> AccountsForAssign(long taskId);
List<Account> GetAccountsByIds(List<long> ids);
List<AccountViewModel> GetAccountLowerPositionvalue();
AccountViewModel GetAccountViewModel(long id);
List<AccountViewModel> GetAccountsDeactivePositionValue(long Positionid);
#endregion
}

View File

@@ -7,16 +7,31 @@ namespace AccountManagement.Domain.AdminResponseAgg;
public class AdminResponse:EntityBase
{
public AdminResponse(string response,long ticketId)
public AdminResponse(string response,long ticketId, long adminAccountId)
{
Response = response;
TicketId = ticketId;
AdminAccountId = adminAccountId;
IsActiveString = "false";
}
public long TicketId { get; private set; }
public long AdminAccountId { get; private set; }
public string Response { get; private set; }
public string IsActiveString { get; private set; }
public Ticket Ticket { get; set; }
public List<AdminResponseMedia> AdminResponseMedias { get; set; }
public void Active()
{
IsActiveString = "true";
}
public void Edit(string response)
{
Response=response;
}
}

View File

@@ -1,11 +1,14 @@
using _0_Framework.Domain;
using AccountManagement.Domain.TaskAgg;
using System;
using System.Collections.Generic;
using AccountManagement.Domain.TaskMessageAgg;
namespace AccountManagement.Domain.AssignAgg;
public class Assign : EntityBase
{
public Assign(long taskId, long assignerId, long assignedId, int assignerPositionValue, string assignedName, int assignedPositionValue)
public Assign(long taskId, long assignerId, long assignedId, int assignerPositionValue, string assignedName, int assignedPositionValue, DateTime endTaskDate)
{
TaskId = taskId;
AssignerId = assignerId;
@@ -13,21 +16,129 @@ public class Assign : EntityBase
AssignerPositionValue = assignerPositionValue;
AssignedName = assignedName;
AssignedPositionValue = assignedPositionValue;
EndTaskDate = endTaskDate;
}
public long TaskId { get; private set; }
//آیدی شخص ارسال کننده
public long AssignerId { get; private set; }
//نام دریافت کننده
public string AssignedName { get; private set; }
//آیدی شخص دریافت کننده
public long AssignedId { get; private set; }
//سطح شخص ارسال کننده
public int AssignerPositionValue { get; private set; }
//آیدی شخص ارسال کننده
public long TaskId { get; private set; }
//نام دریافت کننده
public long AssignerId { get; private set; }
//آیدی شخص دریافت کننده
public string AssignedName { get; private set; }
//سطح شخص ارسال کننده
public long AssignedId { get; private set; }
public int AssignerPositionValue { get; private set; }
public int AssignedPositionValue { get; private set; }
//زمان پایان وظیفه
public DateTime EndTaskDate { get; private set; }
//آیا درخواست مهلت کرده است؟
public bool TimeRequest { get; private set; }
//تعداد تایید درخواست مهلت
public int AcceptedTimeRequest { get; private set; }
//مهلت زمان درخواست شده
public DateTime? RequestDate { get; private set; }
//توضیحات درخواست مهلت
public string? TimeRequestDescription { get; private set; }
//آیا درخواست انصراف داده شده
public Tasks Task { get; set; }
//آیا کنسل شده است
public bool IsCancel { get; private set; }
//توضیحات درخواست انصراف
public string? CancelDescription { get; private set; }
public bool IsDone { get; private set; }
public bool IsDoneRequest { get; private set; }
public string? DoneDescription { get; private set; }
public bool IsCanceledRequest { get; private set; }
public Tasks Task { get; set; }
public List<TaskMessage> TaskMessageList { get; set; }
public void EditTime(DateTime endTaskDate)
{
EndTaskDate = endTaskDate;
}
public void CreateTimeRequest(DateTime requestDate, string timeRequestDescription)
{
RequestDate = requestDate;
TimeRequestDescription = timeRequestDescription;
TimeRequest = true;
}
public void AcceptTimeRequest()
{
TimeRequest = false;
AcceptedTimeRequest++;
EndTaskDate = RequestDate.Value;
}
public void RejectTimeRequest()
{
TimeRequest = false;
TimeRequestDescription = null;
RequestDate = null;
}
public void CreateCancelRequest(string cancelDescription)
{
CancelDescription = cancelDescription;
IsCanceledRequest = true;
}
public void AcceptCancelRequest()
{
IsCanceledRequest = false;
IsCancel = true;
}
public void RejectCancel()
{
CancelDescription = null;
IsCanceledRequest = false;
}
public void CompleteRequest(string? doneDescription)
{
DoneDescription = doneDescription;
IsDoneRequest = true;
}
public void RejectCompleteRequest()
{
IsDoneRequest = false;
DoneDescription = null;
}
public void Completed()
{
IsDoneRequest = false;
IsDone = true;
}
public void ChangeTimeTask(DateTime time)
{
EndTaskDate = time;
AcceptedTimeRequest++;
RequestDate = null;
TimeRequest = false;
}
public void InsertNewData(DateTime endTaskDate,bool timeRequest,int acceptedTimeRequest,DateTime? requestDate, string timeRequestDescription, bool isCanceledRequest,
bool isCancel,string cancelDescription,bool isDone,bool isDoneRequest,string? doneDescription)
{
EndTaskDate = endTaskDate;
TimeRequest=timeRequest;
AcceptedTimeRequest = acceptedTimeRequest;
RequestDate = requestDate;
TimeRequestDescription = timeRequestDescription;
IsCanceledRequest = isCanceledRequest;
IsCancel=isCancel;
IsDone=isDone;
CancelDescription=cancelDescription;
IsDone=isDone;
IsDoneRequest=isDoneRequest;
DoneDescription=doneDescription;
}
}

View File

@@ -1,13 +1,17 @@
using System.Collections.Generic;
using _0_Framework.Domain;
using AccountManagement.Application.Contracts.Assign;
using Microsoft.VisualBasic.CompilerServices;
namespace AccountManagement.Domain.AssignAgg;
public interface IAssignRepository:IRepository<long,Assign>
public interface IAssignRepository : IRepository<long, Assign>
{
List<AssignViewModel> GetAssignsByTaskId(long id);
void RemoveRangeAssigns(long taskId);
List<AssignViewModel> GetAssignsByTaskId(long id);
void RemoveRangeAssigns(long taskId);
List<long> GetAssignedIdsByTaskId(long taskId);
Assign GetAssignByAssignedIdAndTaskId(long assignedId, long taskId);
Assign GetIncludeTask(long id);
}

View File

@@ -14,7 +14,7 @@ public interface IPositionRepository : IRepository<long, Position>
List<int> GetUnUsedPositionValues();
List<AccountViewModel> GetNoPositionAccounts();
List<Account> GetAccountsByIds(List<long> ids);
List<Account> GetAccountsByPositionIds(List<long> ids);
void Remove(long id);

View File

@@ -1,25 +1,38 @@
using System;
using System.Collections.Generic;
using _0_Framework.Application;
using _0_Framework.Domain;
using AccountManagement.Application.Contracts.Task;
using AccountManagement.Application.Contracts.TaskMessage;
namespace AccountManagement.Domain.TaskAgg;
public interface ITaskRepository:IRepository<long,Tasks>
{
EditTask GetDetails(long TaskId);
Tasks GetIncludeAssign(long taskId);
void Remove(long id);
//گرفتن تمامی وظایف
List<TaskViewModel> GetTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetAllTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetRequestedTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetSelfTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetAllNotSelfIncludedTasks(TaskSearchModel searchModel);
//List<TaskViewModel> GetAllNotSelfIncludedTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetReceivedTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetSentTasks(TaskSearchModel searchModel);
List<TaskViewModel> AllRequestedTasks(TaskSearchModel searchModel);
string SetTasksColors(DateTime time,bool isCancel);
int GetRequestedTasksCount();
TaskViewModel GetRequestDetails(long id);
EditTask GetRequestDetails(long id);
string GetWebEnvironmentPath();
bool HasOverdueTasks();
/// گرفتن پیام های مربوط به هر تسک
//OperationResult MoveDataFRomTaskToAssign();
}

View File

@@ -4,61 +4,48 @@ using System.Security.AccessControl;
using _0_Framework.Domain;
using AccountManagement.Domain.AssignAgg;
using AccountManagement.Domain.TaskMediaAgg;
using AccountManagement.Domain.TaskScheduleAgg;
namespace AccountManagement.Domain.TaskAgg;
public class Tasks : EntityBase
{
public Tasks(string title, DateTime endTaskDate, string? description, long senderId, string contractingPartyName)
public Tasks(string title, string? description, long senderId, string contractingPartyName)
{
Title = title;
EndTaskDate = endTaskDate;
Description = description;
SenderId = senderId;
ContractingPartyName = contractingPartyName;
StartTaskDate = DateTime.Now;
IsActiveString = "true";
TaskScheduleId = null;
}
//عنوان وظیفه
public string Title { get; private set; }
//زمان پایان وظیفه
public DateTime EndTaskDate { get; private set; }
//زمان ارسال وظیفه
public DateTime StartTaskDate { get; private set; }
//توضیحات وظیفه
public string? Description { get; private set; }
//آیدی شخص ارسال کننده
public long SenderId { get; private set; }
//آیا درخواست مهلت کرده است؟
public bool TimeRequest { get; private set; }
//تعداد تایید درخواست مهلت
public int AcceptedTimeRequest { get; set; }
//مهلت زمان درخواست شده
public DateTime? RequestDate { get; private set; }
//توضیحات درخواست مهلت
public string? TimeRequestDescription { get; private set; }
//آیا درخواست انصراف داده شده
public bool IsCanceledRequest { get; private set; }
//نام طرف حساب
public string ContractingPartyName { get; set; }
//آیا کنسل شده است
public bool IsCancel { get; private set; }
//توضیحات درخواست انصراف
public string? CancelDescription { get; private set; }
public bool IsDone { get; private set; }
public bool IsDoneRequest { get; private set; }
public string? DoneDescription { get; private set; }
public string IsActiveString { get; private set; }
public long? TicketId { get; private set; }
public long? TaskScheduleId { get; private set; }
public List<Assign> Assigns { get; set; }
public List<TaskMedia> TaskMedias { get; set; }
public long? TicketId { get; set; }
public TaskSchedule TaskSchedule { get; set; }
public Tasks(string title, DateTime endTaskDate, string? description, long senderId, string contractingPartyName, long ticketId)
public Tasks(string title, string? description, long senderId, string contractingPartyName, long ticketId)
{
Title = title;
EndTaskDate = endTaskDate;
Description = description;
SenderId = senderId;
ContractingPartyName = contractingPartyName;
@@ -67,93 +54,30 @@ public class Tasks : EntityBase
TicketId = ticketId;
}
public void Edit(string title, DateTime endTaskDate, string? description, long senderId, string contractingPartyName)
public void Edit(string title, string? description, long senderId, string contractingPartyName)
{
Title = title;
EndTaskDate = endTaskDate;
Description = description;
SenderId = senderId;
ContractingPartyName= contractingPartyName;
ContractingPartyName = contractingPartyName;
}
//برای ایجاد یک درخواست مهلت
public void CreateTimeRequest(DateTime requestDate, string timeRequestDescription)
public void DeActive()
{
RequestDate = requestDate;
TimeRequestDescription = timeRequestDescription;
TimeRequest = true;
IsActiveString = "false";
}
public void AcceptTimeRequest()
public void Activator()
{
TimeRequest = false;
AcceptedTimeRequest++;
EndTaskDate = (DateTime)RequestDate;
}
public void RejectTimeRequest()
{
TimeRequest = false;
TimeRequestDescription = null;
RequestDate = null;
IsActiveString = "true";
}
public void CreateCancelRequest(string cancelDescription)
public void SetTaskSchedule(long taskScheduleId)
{
CancelDescription = cancelDescription;
IsCanceledRequest=true;
TaskScheduleId = taskScheduleId;
}
public void AcceptCancelRequest()
{
IsCanceledRequest=false;
IsCancel = true;
}
public void RejectCancel()
{
CancelDescription = null;
IsCanceledRequest = false;
}
public void CompleteRequest(string? doneDescription)
{
DoneDescription = doneDescription;
IsDoneRequest = true;
}
public void RejectCompleteRequest()
{
IsDoneRequest = false;
DoneDescription=null;
}
public void Completed()
{
IsDoneRequest = false;
IsDone=true;
}
public void DeActive()
{
IsActiveString = "false";
}
public void Activator()
{
IsActiveString = "true";
}
public void ChangeTimeTask(DateTime time)
{
EndTaskDate = time;
AcceptedTimeRequest++;
RequestDate = null;
TimeRequest = false;
}
}

View File

@@ -0,0 +1,11 @@
using System.Collections.Generic;
using _0_Framework.Domain;
using AccountManagement.Application.Contracts.TaskMessage;
namespace AccountManagement.Domain.TaskMessageAgg;
public interface ITaskMessageRepository: IRepository<long, TaskMessage>
{
void CreateTaskMessageItems(long senderId,long receiverId,long messageId);
List<TaskMessageViewModel> GetTaskMessages(long assignId);
}

View File

@@ -0,0 +1,26 @@
using System.Collections.Generic;
using System.Runtime;
using _0_Framework.Domain;
using AccountManagement.Domain.AssignAgg;
using AccountManagement.Domain.TaskMessageItemsAgg;
namespace AccountManagement.Domain.TaskMessageAgg;
public class TaskMessage:EntityBase
{
public TaskMessage(string message, string typeOfMessage, long assignId, string requestedDateFa="")
{
Message = message;
TypeOfMessage = typeOfMessage;
AssignId = assignId;
RequestedDateFa = requestedDateFa;
}
public string Message { get; private set; }
public string TypeOfMessage { get; private set; }
public string RequestedDateFa { get; private set; }
public long AssignId { get; private set; }
public List<TaskMessageItems> TaskMessageItemsList { get; set; }
public Assign Assign { get; set; }
}

View File

@@ -0,0 +1,22 @@
using _0_Framework.Domain;
using AccountManagement.Domain.TaskMessageAgg;
namespace AccountManagement.Domain.TaskMessageItemsAgg;
public class TaskMessageItems:EntityBase
{
public TaskMessageItems(long senderAccountId, long receiverAccountId, long taskMessageId)
{
SenderAccountId = senderAccountId;
ReceiverAccountId = receiverAccountId;
TaskMessageId = taskMessageId;
}
public long SenderAccountId { get; private set; }
public long ReceiverAccountId { get; private set; }
public long TaskMessageId { get; private set; }
public TaskMessage TaskMessage { get; set; }
}

View File

@@ -0,0 +1,8 @@
using _0_Framework.Domain;
namespace AccountManagement.Domain.TaskScheduleAgg;
public interface ITaskScheduleRepository:IRepository<long,TaskSchedule>
{
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using _0_Framework.Domain;
using AccountManagement.Domain.TaskAgg;
namespace AccountManagement.Domain.TaskScheduleAgg;
public class TaskSchedule:EntityBase
{
public TaskSchedule(string count, string type, string unitType, string unitNumber, DateTime lastEndTaskDate)
{
Count = count;
Type = type;
UnitType = unitType;
UnitNumber = unitNumber;
LastEndTaskDate = lastEndTaskDate;
}
public string Count { get; private set; }
public string Type { get; private set; }
public string UnitType { get; private set; }
public string UnitNumber { get; private set; }
public DateTime LastEndTaskDate { get; private set; }
public List<Tasks> TasksList { get; set; }
public void SetLastEndTaskDate(DateTime lastEndTaskDate)
{
LastEndTaskDate = lastEndTaskDate;
}
}

View File

@@ -0,0 +1,12 @@
using System.Collections.Generic;
using _0_Framework.Domain;
using AccountManagement.Application.Contracts.TicketAccessAccount;
namespace AccountManagement.Domain.TicketAccessAccountAgg;
public interface ITicketAccessAccountRepository:IRepository<long,TicketAccessAccount>
{
bool HasTicketAccess(long accountId);
List<TicketAccessAccountViewModel> GetAllAccessedAccounts();
void Remove (long id);
}

View File

@@ -0,0 +1,13 @@
using _0_Framework.Domain;
namespace AccountManagement.Domain.TicketAccessAccountAgg;
public class TicketAccessAccount:EntityBase
{
public TicketAccessAccount(long accountId)
{
AccountId = accountId;
}
public long AccountId { get; private set; }
}

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using _0_Framework.Application;
using _0_Framework.Domain;
using AccountManagement.Application.Contracts.Ticket;
using AccountManagement.Domain.AdminResponseAgg;
@@ -9,9 +10,16 @@ namespace AccountManagement.Domain.TicketAgg;
public interface ITicketRepository:IRepository<long,Ticket>
{
List<TicketViewModel> GetAll(TicketSearchModel searchModel);
List<TicketViewModel> GetTicketsForClients(TicketSearchModel searchModel);
void CreateAdminResponse(AdminResponse command);
void CreateClientResponse(ClientResponse command);
EditTicket GetDetails(long id);
EditTicket GetDetailsForClient(long id);
int GetLastTicketNumber();
AdminResponse GetAdminResponse(long adminResId);
ClientResponse GetClientResponse(long adminResId);
void RemoveAdminResponse(long adminResId);
}

View File

@@ -9,23 +9,27 @@ namespace AccountManagement.Domain.TicketAgg;
public class Ticket:EntityBase
{
public Ticket(string title, string description, long senderId, string contractingPartyName, string ticketType)
public Ticket(string title, string description, long senderId, string contractingPartyName, string ticketType, long workshopId, string ticketNumber,long subAccountSenderId=0)
{
Title = title;
Description = description;
Status = "درحال بررسی";
Status = "باز";
SenderId = senderId;
ContractingPartyName = contractingPartyName;
TicketType = ticketType;
WorkshopId = workshopId;
TicketNumber = ticketNumber;
SubAccountSenderId = subAccountSenderId;
}
public string Title { get; private set; }
public string Description { get; private set; }
public string TicketType { get; set; }
public string TicketNumber { get; set; }
public string Status { get; private set; }
public long SenderId { get; private set; }
public long SubAccountSenderId { get; set; }
public string ContractingPartyName { get; private set; }
public long? TaskId { get; private set; }
public long WorkshopId { get; private set; }
public List<ClientResponse> ClientResponses { get; set; }
public List<AdminResponse> AdminResponses{ get; set; }
public List<TicketMedia> TicketMedias { get; set; }
@@ -39,4 +43,14 @@ public class Ticket:EntityBase
{
Status = "پاسخ داده شده";
}
public void AssignedToTasks()
{
Status = "درحال بررسی";
}
public void Open()
{
Status = "باز";
}
}

View File

@@ -17,6 +17,9 @@ using AccountManagement.Domain.ClientResponseAgg;
using AccountManagement.Domain.ClientResponseMediaAgg;
using AccountManagement.Domain.TicketAgg;
using AccountManagement.Domain.TicketMediasAgg;
using AccountManagement.Domain.TaskMessageAgg;
using AccountManagement.Domain.TaskMessageItemsAgg;
using AccountManagement.Domain.TicketAccessAccountAgg;
namespace AccountMangement.Infrastructure.EFCore
{
@@ -42,6 +45,10 @@ namespace AccountMangement.Infrastructure.EFCore
public DbSet<ClientResponseMedia> ClientResponseMedias { get; set; }
public DbSet<Ticket> Tickets { get; set; }
public DbSet<TicketMedia> TicketMedias { get; set; }
public DbSet<TaskMessage> TaskMessages { get; set; }
public DbSet<TaskMessageItems> TaskMessageItems { get; set; }
public DbSet<TicketAccessAccount> TicketAccessAccounts { get; set; }
#endregion
public AccountContext(DbContextOptions<AccountContext> options) : base(options)

View File

@@ -23,7 +23,8 @@ public class AccountMapping : IEntityTypeConfiguration<Account>
builder.Property(x => x.Email).HasMaxLength(150);
builder.Property(x => x.VerifyCode).HasMaxLength(1000);
builder.Property(x => x.IsActiveString).HasMaxLength(6);
builder.Property(x => x.PositionId).HasMaxLength(10).IsRequired(false);
builder.Property(x => x.PositionId).HasMaxLength(10).IsRequired(false);
builder.Property(x => x.PositionIsActive).HasMaxLength(5);
builder.HasOne(x => x.Role).WithMany(x => x.Accounts).HasForeignKey(x => x.RoleId);
builder.HasMany(x => x.CameraAccounts)

View File

@@ -13,6 +13,7 @@ public class AdminResponseMapping : IEntityTypeConfiguration<AdminResponse>
builder.Property(x => x.Response).HasColumnType("ntext");
builder.Property(x => x.IsActiveString).HasMaxLength(5);
builder.HasMany(x => x.AdminResponseMedias).WithOne(x => x.AdminResponse).HasForeignKey(x => x.AdminResponseId);

View File

@@ -11,8 +11,13 @@ public class AssignMapping:IEntityTypeConfiguration<Assign>
builder.ToTable("Assigns");
builder.HasKey(x => x.id);
builder.Property(x => x.AssignedName).HasMaxLength(200);
builder.Property(x => x.RequestDate).IsRequired(false);
builder.Property(x => x.EndTaskDate).IsRequired();
builder.Property(x => x.CancelDescription).IsRequired(false).HasColumnType("ntext");
builder.Property(x => x.TimeRequestDescription).IsRequired(false).HasColumnType("ntext");
builder.Property(x => x.DoneDescription).IsRequired(false).HasColumnType("ntext");
builder.HasOne(x => x.Task).WithMany(x => x.Assigns).HasForeignKey(x => x.TaskId).IsRequired(false);
builder.HasOne(x => x.Task).WithMany(x => x.Assigns).HasForeignKey(x => x.TaskId).IsRequired(false);
}
}

View File

@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace AccountMangement.Infrastructure.EFCore.Mappings;
public class TaskMapping:IEntityTypeConfiguration<Tasks>
public class TaskMapping : IEntityTypeConfiguration<Tasks>
{
public void Configure(EntityTypeBuilder<Tasks> builder)
{
@@ -12,19 +12,20 @@ public class TaskMapping:IEntityTypeConfiguration<Tasks>
builder.HasKey(t => t.id);
builder.Property(x => x.RequestDate).IsRequired(false);
builder.Property(x => x.EndTaskDate).IsRequired();
builder.Property(x => x.Description).IsRequired(false).HasColumnType("ntext");
builder.Property(x => x.CancelDescription).IsRequired(false).HasColumnType("ntext");
builder.Property(x => x.TimeRequestDescription).IsRequired(false).HasColumnType("ntext");
builder.Property(x => x.Title).IsRequired().HasMaxLength(100);
builder.Property(x => x.IsActiveString).HasMaxLength(7);
builder.Property(x => x.ContractingPartyName).HasMaxLength(200);
builder.Property(x => x.DoneDescription).IsRequired(false).HasColumnType("ntext");
builder.Property(x => x.TicketId).IsRequired(false);
builder.Property(x => x.TaskScheduleId).IsRequired(false);
builder.Property(x => x.TicketId).IsRequired(false);
builder.HasMany(x => x.Assigns).WithOne(x => x.Task).HasForeignKey(x => x.TaskId).IsRequired(false).OnDelete(DeleteBehavior.Cascade);
builder.HasOne(x => x.TaskSchedule).WithMany(x => x.TasksList).HasForeignKey(x => x.TaskScheduleId)
.IsRequired(false).OnDelete(DeleteBehavior.Cascade);
builder.HasMany(x => x.Assigns).WithOne(x => x.Task).HasForeignKey(x => x.TaskId)
.IsRequired(false).OnDelete(DeleteBehavior.Cascade);
}
}

View File

@@ -0,0 +1,17 @@
using AccountManagement.Domain.TaskMessageAgg;
using AccountManagement.Domain.TaskMessageItemsAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace AccountMangement.Infrastructure.EFCore.Mappings;
public class TaskMessageItemsMapping: IEntityTypeConfiguration<TaskMessageItems>
{
public void Configure(EntityTypeBuilder<TaskMessageItems> builder)
{
builder.ToTable("TaskMessageItems");
builder.HasKey(x => x.id);
builder.HasOne(x => x.TaskMessage).WithMany(x => x.TaskMessageItemsList).HasForeignKey(x => x.TaskMessageId);
}
}

View File

@@ -0,0 +1,23 @@
using AccountManagement.Domain.AccountLeftWorkAgg;
using AccountManagement.Domain.TaskMessageAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace AccountMangement.Infrastructure.EFCore.Mappings;
public class TaskMessageMapping : IEntityTypeConfiguration<TaskMessage>
{
public void Configure(EntityTypeBuilder<TaskMessage> builder)
{
builder.ToTable("TaskMessages");
builder.HasKey(x => x.id);
builder.Property(x => x.TypeOfMessage).HasMaxLength(30);
builder.Property(x=>x.Message).HasColumnType("ntext");
builder.Property(x => x.RequestedDateFa).HasMaxLength(25);
builder.HasMany(x => x.TaskMessageItemsList).WithOne(x => x.TaskMessage).HasForeignKey(x => x.TaskMessageId);
builder.HasOne(x => x.Assign).WithMany(x => x.TaskMessageList).HasForeignKey(x => x.AssignId);
}
}

View File

@@ -0,0 +1,22 @@
using AccountManagement.Domain.TaskScheduleAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace AccountMangement.Infrastructure.EFCore.Mappings;
public class TaskScheduleMapping : IEntityTypeConfiguration<TaskSchedule>
{
public void Configure(EntityTypeBuilder<TaskSchedule> builder)
{
builder.ToTable("TaskSchedules");
builder.HasKey(x => x.id);
builder.Property(x => x.Count).HasMaxLength(10);
builder.Property(x => x.Type).HasMaxLength(12);
builder.Property(x => x.UnitNumber).HasMaxLength(10);
builder.Property(x => x.UnitType).HasMaxLength(10);
builder.HasMany(x => x.TasksList).WithOne(x => x.TaskSchedule)
.HasForeignKey(x => x.TaskScheduleId);
}
}

View File

@@ -0,0 +1,14 @@
using AccountManagement.Domain.TicketAccessAccountAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace AccountMangement.Infrastructure.EFCore.Mappings;
public class TicketAccessAccountMapping:IEntityTypeConfiguration<TicketAccessAccount>
{
public void Configure(EntityTypeBuilder<TicketAccessAccount> builder)
{
builder.ToTable("TicketAccessAccounts");
builder.HasKey(x => x.id);
}
}

View File

@@ -13,15 +13,12 @@ public class TicketMapping:IEntityTypeConfiguration<Ticket>
builder.ToTable("Tickets");
builder.Property(x => x.TaskId).IsRequired(false);
builder.Property(x => x.ContractingPartyName).HasMaxLength(155);
builder.Property(x => x.TicketType).HasMaxLength(50);
builder.Property(x => x.Title).HasMaxLength(200);
builder.Property(x => x.Description).HasColumnType("ntext");
builder.Property(x => x.Status).HasMaxLength(30);
builder.Property(x => x.TicketNumber).HasMaxLength(12);
builder.HasMany(x => x.ClientResponses).WithOne(x => x.Ticket).HasForeignKey(x => x.TicketId);
builder.HasMany(x => x.TicketMedias).WithOne(x => x.Ticket).HasForeignKey(x => x.MediaId);
builder.HasMany(x => x.AdminResponses).WithOne(x => x.Ticket).HasForeignKey(x => x.TicketId);

View File

@@ -0,0 +1,772 @@
// <auto-generated />
using System;
using AccountMangement.Infrastructure.EFCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace AccountMangement.Infrastructure.EFCore.Migrations
{
[DbContext(typeof(AccountContext))]
[Migration("20240821152830_AccountTableChanges")]
partial class AccountTableChanges
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("AccountManagement.Domain.AccountAgg.Account", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<string>("AdminAreaPermission")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<string>("ClientAriaPermission")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Email")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<string>("Fullname")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("IsActiveString")
.HasMaxLength(6)
.HasColumnType("nvarchar(6)");
b.Property<string>("Mobile")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("nvarchar(20)");
b.Property<string>("NationalCode")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<long?>("PositionId")
.HasMaxLength(10)
.HasColumnType("bigint");
b.Property<string>("PositionIsActive")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("ProfilePhoto")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<long>("RoleId")
.HasColumnType("bigint");
b.Property<string>("RoleName")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("VerifyCode")
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.HasKey("id");
b.HasIndex("PositionId");
b.HasIndex("RoleId");
b.ToTable("Accounts", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AccountLeftWorkAgg.AccountLeftWork", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("AccountId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<DateTime>("LeftWorkGr")
.HasColumnType("datetime2");
b.Property<DateTime>("StartWorkGr")
.HasColumnType("datetime2");
b.HasKey("id");
b.HasIndex("AccountId");
b.ToTable("AccountLeftWork", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseAgg.AdminResponse", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Response")
.HasColumnType("ntext");
b.Property<long>("TicketId")
.HasColumnType("bigint");
b.HasKey("id");
b.HasIndex("TicketId");
b.ToTable("AdminResponses", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseMediaAgg.AdminResponseMedia", b =>
{
b.Property<long>("AdminResponseId")
.HasColumnType("bigint");
b.Property<long>("MediaId")
.HasColumnType("bigint");
b.HasKey("AdminResponseId", "MediaId");
b.HasIndex("MediaId");
b.ToTable("AdminResponseMedias", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AssignAgg.Assign", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("AssignedId")
.HasColumnType("bigint");
b.Property<string>("AssignedName")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<int>("AssignedPositionValue")
.HasColumnType("int");
b.Property<long>("AssignerId")
.HasColumnType("bigint");
b.Property<int>("AssignerPositionValue")
.HasColumnType("int");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<long>("TaskId")
.HasColumnType("bigint");
b.HasKey("id");
b.HasIndex("TaskId");
b.ToTable("Assigns", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.CameraAccountAgg.CameraAccount", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("AccountId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("IsActiveSting")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("Mobile")
.HasMaxLength(11)
.HasColumnType("nvarchar(11)");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<long>("WorkshopId")
.HasColumnType("bigint");
b.Property<string>("WorkshopName")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("id");
b.HasIndex("AccountId");
b.ToTable("CameraAccounts", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseAgg.ClientResponse", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Response")
.HasColumnType("ntext");
b.Property<long>("TicketId")
.HasColumnType("bigint");
b.HasKey("id");
b.HasIndex("TicketId");
b.ToTable("ClientResponses", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseMediaAgg.ClientResponseMedia", b =>
{
b.Property<long>("ClientResponseId")
.HasColumnType("bigint");
b.Property<long>("MediaId")
.HasColumnType("bigint");
b.HasKey("ClientResponseId", "MediaId");
b.HasIndex("MediaId");
b.ToTable("ClientResponseMedias", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.MediaAgg.Media", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<string>("Category")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Path")
.HasColumnType("ntext");
b.Property<string>("Type")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.HasKey("id");
b.ToTable("Medias", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.RoleAgg.Role", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("id");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskAgg.Tasks", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<int>("AcceptedTimeRequest")
.HasColumnType("int");
b.Property<string>("CancelDescription")
.HasColumnType("ntext");
b.Property<string>("ContractingPartyName")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("ntext");
b.Property<string>("DoneDescription")
.HasColumnType("ntext");
b.Property<DateTime>("EndTaskDate")
.HasColumnType("datetime2");
b.Property<string>("IsActiveString")
.HasMaxLength(7)
.HasColumnType("nvarchar(7)");
b.Property<bool>("IsCancel")
.HasColumnType("bit");
b.Property<bool>("IsCanceledRequest")
.HasColumnType("bit");
b.Property<bool>("IsDone")
.HasColumnType("bit");
b.Property<bool>("IsDoneRequest")
.HasColumnType("bit");
b.Property<DateTime?>("RequestDate")
.HasColumnType("datetime2");
b.Property<long>("SenderId")
.HasColumnType("bigint");
b.Property<DateTime>("StartTaskDate")
.HasColumnType("datetime2");
b.Property<long?>("TicketId")
.HasColumnType("bigint");
b.Property<bool>("TimeRequest")
.HasColumnType("bit");
b.Property<string>("TimeRequestDescription")
.HasColumnType("ntext");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("id");
b.ToTable("TasksManager", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskMediaAgg.TaskMedia", b =>
{
b.Property<long>("MediaId")
.HasColumnType("bigint");
b.Property<long>("TaskId")
.HasColumnType("bigint");
b.HasKey("MediaId", "TaskId");
b.HasIndex("TaskId");
b.ToTable("TasksMedias", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskSubjectAgg.TaskSubject", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Subject")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("id");
b.ToTable("TaskSubjects", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TicketAgg.Ticket", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<string>("ContractingPartyName")
.HasMaxLength(155)
.HasColumnType("nvarchar(155)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("ntext");
b.Property<long>("SenderId")
.HasColumnType("bigint");
b.Property<string>("Status")
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.Property<long?>("TaskId")
.HasColumnType("bigint");
b.Property<string>("TicketType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Title")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("id");
b.ToTable("Tickets", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TicketMediasAgg.TicketMedia", b =>
{
b.Property<long>("TicketId")
.HasColumnType("bigint");
b.Property<long>("MediaId")
.HasColumnType("bigint");
b.HasKey("TicketId", "MediaId");
b.HasIndex("MediaId");
b.ToTable("TicketMedias", (string)null);
});
modelBuilder.Entity("TaskManager.Domain.PositionAgg.Position", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("PositionName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<int>("PositionValue")
.HasMaxLength(2)
.HasColumnType("int");
b.HasKey("id");
b.ToTable("Positions", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AccountAgg.Account", b =>
{
b.HasOne("TaskManager.Domain.PositionAgg.Position", "Position")
.WithMany("Accounts")
.HasForeignKey("PositionId");
b.HasOne("AccountManagement.Domain.RoleAgg.Role", "Role")
.WithMany("Accounts")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Position");
b.Navigation("Role");
});
modelBuilder.Entity("AccountManagement.Domain.AccountLeftWorkAgg.AccountLeftWork", b =>
{
b.HasOne("AccountManagement.Domain.AccountAgg.Account", "Account")
.WithMany("AccountLeftWorkList")
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Account");
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseAgg.AdminResponse", b =>
{
b.HasOne("AccountManagement.Domain.TicketAgg.Ticket", "Ticket")
.WithMany("AdminResponses")
.HasForeignKey("TicketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Ticket");
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseMediaAgg.AdminResponseMedia", b =>
{
b.HasOne("AccountManagement.Domain.AdminResponseAgg.AdminResponse", "AdminResponse")
.WithMany("AdminResponseMedias")
.HasForeignKey("AdminResponseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media")
.WithMany("AdminResponseMedias")
.HasForeignKey("MediaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AdminResponse");
b.Navigation("Media");
});
modelBuilder.Entity("AccountManagement.Domain.AssignAgg.Assign", b =>
{
b.HasOne("AccountManagement.Domain.TaskAgg.Tasks", "Task")
.WithMany("Assigns")
.HasForeignKey("TaskId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Task");
});
modelBuilder.Entity("AccountManagement.Domain.CameraAccountAgg.CameraAccount", b =>
{
b.HasOne("AccountManagement.Domain.AccountAgg.Account", "Account")
.WithMany("CameraAccounts")
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Account");
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseAgg.ClientResponse", b =>
{
b.HasOne("AccountManagement.Domain.TicketAgg.Ticket", "Ticket")
.WithMany("ClientResponses")
.HasForeignKey("TicketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Ticket");
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseMediaAgg.ClientResponseMedia", b =>
{
b.HasOne("AccountManagement.Domain.ClientResponseAgg.ClientResponse", "ClientResponse")
.WithMany("ClientResponseMedias")
.HasForeignKey("ClientResponseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media")
.WithMany("ClientResponseMedias")
.HasForeignKey("MediaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ClientResponse");
b.Navigation("Media");
});
modelBuilder.Entity("AccountManagement.Domain.RoleAgg.Role", b =>
{
b.OwnsMany("AccountManagement.Domain.RoleAgg.Permission", "Permissions", b1 =>
{
b1.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
b1.Property<int>("Code")
.HasColumnType("int");
b1.Property<long>("RoleId")
.HasColumnType("bigint");
b1.HasKey("Id");
b1.HasIndex("RoleId");
b1.ToTable("RolePermissions", (string)null);
b1.WithOwner("Role")
.HasForeignKey("RoleId");
b1.Navigation("Role");
});
b.Navigation("Permissions");
});
modelBuilder.Entity("AccountManagement.Domain.TaskMediaAgg.TaskMedia", b =>
{
b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media")
.WithMany("TaskMedias")
.HasForeignKey("MediaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AccountManagement.Domain.TaskAgg.Tasks", "Tasks")
.WithMany("TaskMedias")
.HasForeignKey("TaskId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Media");
b.Navigation("Tasks");
});
modelBuilder.Entity("AccountManagement.Domain.TicketMediasAgg.TicketMedia", b =>
{
b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media")
.WithMany("TicketMedias")
.HasForeignKey("MediaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AccountManagement.Domain.TicketAgg.Ticket", "Ticket")
.WithMany("TicketMedias")
.HasForeignKey("TicketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Media");
b.Navigation("Ticket");
});
modelBuilder.Entity("AccountManagement.Domain.AccountAgg.Account", b =>
{
b.Navigation("AccountLeftWorkList");
b.Navigation("CameraAccounts");
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseAgg.AdminResponse", b =>
{
b.Navigation("AdminResponseMedias");
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseAgg.ClientResponse", b =>
{
b.Navigation("ClientResponseMedias");
});
modelBuilder.Entity("AccountManagement.Domain.MediaAgg.Media", b =>
{
b.Navigation("AdminResponseMedias");
b.Navigation("ClientResponseMedias");
b.Navigation("TaskMedias");
b.Navigation("TicketMedias");
});
modelBuilder.Entity("AccountManagement.Domain.RoleAgg.Role", b =>
{
b.Navigation("Accounts");
});
modelBuilder.Entity("AccountManagement.Domain.TaskAgg.Tasks", b =>
{
b.Navigation("Assigns");
b.Navigation("TaskMedias");
});
modelBuilder.Entity("AccountManagement.Domain.TicketAgg.Ticket", b =>
{
b.Navigation("AdminResponses");
b.Navigation("ClientResponses");
b.Navigation("TicketMedias");
});
modelBuilder.Entity("TaskManager.Domain.PositionAgg.Position", b =>
{
b.Navigation("Accounts");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AccountMangement.Infrastructure.EFCore.Migrations
{
/// <inheritdoc />
public partial class AccountTableChanges : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "PositionIsActive",
table: "Accounts",
type: "nvarchar(5)",
maxLength: 5,
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PositionIsActive",
table: "Accounts");
}
}
}

View File

@@ -0,0 +1,896 @@
// <auto-generated />
using System;
using AccountMangement.Infrastructure.EFCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace AccountMangement.Infrastructure.EFCore.Migrations
{
[DbContext(typeof(AccountContext))]
[Migration("20240821154206_taskMessageTables_AssignChanges")]
partial class taskMessageTables_AssignChanges
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("AccountManagement.Domain.AccountAgg.Account", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<string>("AdminAreaPermission")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<string>("ClientAriaPermission")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Email")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<string>("Fullname")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("IsActiveString")
.HasMaxLength(6)
.HasColumnType("nvarchar(6)");
b.Property<string>("Mobile")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("nvarchar(20)");
b.Property<string>("NationalCode")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<long?>("PositionId")
.HasMaxLength(10)
.HasColumnType("bigint");
b.Property<string>("PositionIsActive")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("ProfilePhoto")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<long>("RoleId")
.HasColumnType("bigint");
b.Property<string>("RoleName")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("VerifyCode")
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.HasKey("id");
b.HasIndex("PositionId");
b.HasIndex("RoleId");
b.ToTable("Accounts", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AccountLeftWorkAgg.AccountLeftWork", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("AccountId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<DateTime>("LeftWorkGr")
.HasColumnType("datetime2");
b.Property<DateTime>("StartWorkGr")
.HasColumnType("datetime2");
b.HasKey("id");
b.HasIndex("AccountId");
b.ToTable("AccountLeftWork", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseAgg.AdminResponse", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Response")
.HasColumnType("ntext");
b.Property<long>("TicketId")
.HasColumnType("bigint");
b.HasKey("id");
b.HasIndex("TicketId");
b.ToTable("AdminResponses", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseMediaAgg.AdminResponseMedia", b =>
{
b.Property<long>("AdminResponseId")
.HasColumnType("bigint");
b.Property<long>("MediaId")
.HasColumnType("bigint");
b.HasKey("AdminResponseId", "MediaId");
b.HasIndex("MediaId");
b.ToTable("AdminResponseMedias", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AssignAgg.Assign", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<int>("AcceptedTimeRequest")
.HasColumnType("int");
b.Property<long>("AssignedId")
.HasColumnType("bigint");
b.Property<string>("AssignedName")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<int>("AssignedPositionValue")
.HasColumnType("int");
b.Property<long>("AssignerId")
.HasColumnType("bigint");
b.Property<int>("AssignerPositionValue")
.HasColumnType("int");
b.Property<string>("CancelDescription")
.HasColumnType("ntext");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("DoneDescription")
.HasColumnType("ntext");
b.Property<DateTime>("EndTaskDate")
.HasColumnType("datetime2");
b.Property<bool>("IsCancel")
.HasColumnType("bit");
b.Property<bool>("IsCanceledRequest")
.HasColumnType("bit");
b.Property<bool>("IsDone")
.HasColumnType("bit");
b.Property<bool>("IsDoneRequest")
.HasColumnType("bit");
b.Property<DateTime?>("RequestDate")
.HasColumnType("datetime2");
b.Property<long>("TaskId")
.HasColumnType("bigint");
b.Property<bool>("TimeRequest")
.HasColumnType("bit");
b.Property<string>("TimeRequestDescription")
.HasColumnType("ntext");
b.HasKey("id");
b.HasIndex("TaskId");
b.ToTable("Assigns", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.CameraAccountAgg.CameraAccount", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("AccountId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("IsActiveSting")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("Mobile")
.HasMaxLength(11)
.HasColumnType("nvarchar(11)");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<long>("WorkshopId")
.HasColumnType("bigint");
b.Property<string>("WorkshopName")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("id");
b.HasIndex("AccountId");
b.ToTable("CameraAccounts", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseAgg.ClientResponse", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Response")
.HasColumnType("ntext");
b.Property<long>("TicketId")
.HasColumnType("bigint");
b.HasKey("id");
b.HasIndex("TicketId");
b.ToTable("ClientResponses", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseMediaAgg.ClientResponseMedia", b =>
{
b.Property<long>("ClientResponseId")
.HasColumnType("bigint");
b.Property<long>("MediaId")
.HasColumnType("bigint");
b.HasKey("ClientResponseId", "MediaId");
b.HasIndex("MediaId");
b.ToTable("ClientResponseMedias", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.MediaAgg.Media", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<string>("Category")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Path")
.HasColumnType("ntext");
b.Property<string>("Type")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.HasKey("id");
b.ToTable("Medias", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.RoleAgg.Role", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("id");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskAgg.Tasks", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<int>("AcceptedTimeRequest")
.HasColumnType("int");
b.Property<string>("CancelDescription")
.HasColumnType("ntext");
b.Property<string>("ContractingPartyName")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("ntext");
b.Property<string>("DoneDescription")
.HasColumnType("ntext");
b.Property<DateTime>("EndTaskDate")
.HasColumnType("datetime2");
b.Property<string>("IsActiveString")
.HasMaxLength(7)
.HasColumnType("nvarchar(7)");
b.Property<bool>("IsCancel")
.HasColumnType("bit");
b.Property<bool>("IsCanceledRequest")
.HasColumnType("bit");
b.Property<bool>("IsDone")
.HasColumnType("bit");
b.Property<bool>("IsDoneRequest")
.HasColumnType("bit");
b.Property<DateTime?>("RequestDate")
.HasColumnType("datetime2");
b.Property<long>("SenderId")
.HasColumnType("bigint");
b.Property<DateTime>("StartTaskDate")
.HasColumnType("datetime2");
b.Property<long?>("TicketId")
.HasColumnType("bigint");
b.Property<bool>("TimeRequest")
.HasColumnType("bit");
b.Property<string>("TimeRequestDescription")
.HasColumnType("ntext");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("id");
b.ToTable("TasksManager", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskMediaAgg.TaskMedia", b =>
{
b.Property<long>("MediaId")
.HasColumnType("bigint");
b.Property<long>("TaskId")
.HasColumnType("bigint");
b.HasKey("MediaId", "TaskId");
b.HasIndex("TaskId");
b.ToTable("TasksMedias", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageAgg.TaskMessage", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("AssignId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Message")
.HasColumnType("ntext");
b.Property<string>("RequestedDateFa")
.HasMaxLength(25)
.HasColumnType("nvarchar(25)");
b.Property<string>("TypeOfMessage")
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.HasKey("id");
b.HasIndex("AssignId");
b.ToTable("TaskMessages", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageItemsAgg.TaskMessageItems", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<long>("ReceiverAccountId")
.HasColumnType("bigint");
b.Property<long>("SenderAccountId")
.HasColumnType("bigint");
b.Property<long>("TaskMessageId")
.HasColumnType("bigint");
b.HasKey("id");
b.HasIndex("TaskMessageId");
b.ToTable("TaskMessageItems", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskSubjectAgg.TaskSubject", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Subject")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("id");
b.ToTable("TaskSubjects", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TicketAgg.Ticket", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<string>("ContractingPartyName")
.HasMaxLength(155)
.HasColumnType("nvarchar(155)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("ntext");
b.Property<long>("SenderId")
.HasColumnType("bigint");
b.Property<string>("Status")
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.Property<long?>("TaskId")
.HasColumnType("bigint");
b.Property<string>("TicketType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Title")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("id");
b.ToTable("Tickets", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TicketMediasAgg.TicketMedia", b =>
{
b.Property<long>("TicketId")
.HasColumnType("bigint");
b.Property<long>("MediaId")
.HasColumnType("bigint");
b.HasKey("TicketId", "MediaId");
b.HasIndex("MediaId");
b.ToTable("TicketMedias", (string)null);
});
modelBuilder.Entity("TaskManager.Domain.PositionAgg.Position", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("PositionName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<int>("PositionValue")
.HasMaxLength(2)
.HasColumnType("int");
b.HasKey("id");
b.ToTable("Positions", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AccountAgg.Account", b =>
{
b.HasOne("TaskManager.Domain.PositionAgg.Position", "Position")
.WithMany("Accounts")
.HasForeignKey("PositionId");
b.HasOne("AccountManagement.Domain.RoleAgg.Role", "Role")
.WithMany("Accounts")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Position");
b.Navigation("Role");
});
modelBuilder.Entity("AccountManagement.Domain.AccountLeftWorkAgg.AccountLeftWork", b =>
{
b.HasOne("AccountManagement.Domain.AccountAgg.Account", "Account")
.WithMany("AccountLeftWorkList")
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Account");
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseAgg.AdminResponse", b =>
{
b.HasOne("AccountManagement.Domain.TicketAgg.Ticket", "Ticket")
.WithMany("AdminResponses")
.HasForeignKey("TicketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Ticket");
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseMediaAgg.AdminResponseMedia", b =>
{
b.HasOne("AccountManagement.Domain.AdminResponseAgg.AdminResponse", "AdminResponse")
.WithMany("AdminResponseMedias")
.HasForeignKey("AdminResponseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media")
.WithMany("AdminResponseMedias")
.HasForeignKey("MediaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AdminResponse");
b.Navigation("Media");
});
modelBuilder.Entity("AccountManagement.Domain.AssignAgg.Assign", b =>
{
b.HasOne("AccountManagement.Domain.TaskAgg.Tasks", "Task")
.WithMany("Assigns")
.HasForeignKey("TaskId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Task");
});
modelBuilder.Entity("AccountManagement.Domain.CameraAccountAgg.CameraAccount", b =>
{
b.HasOne("AccountManagement.Domain.AccountAgg.Account", "Account")
.WithMany("CameraAccounts")
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Account");
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseAgg.ClientResponse", b =>
{
b.HasOne("AccountManagement.Domain.TicketAgg.Ticket", "Ticket")
.WithMany("ClientResponses")
.HasForeignKey("TicketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Ticket");
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseMediaAgg.ClientResponseMedia", b =>
{
b.HasOne("AccountManagement.Domain.ClientResponseAgg.ClientResponse", "ClientResponse")
.WithMany("ClientResponseMedias")
.HasForeignKey("ClientResponseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media")
.WithMany("ClientResponseMedias")
.HasForeignKey("MediaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ClientResponse");
b.Navigation("Media");
});
modelBuilder.Entity("AccountManagement.Domain.RoleAgg.Role", b =>
{
b.OwnsMany("AccountManagement.Domain.RoleAgg.Permission", "Permissions", b1 =>
{
b1.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
b1.Property<int>("Code")
.HasColumnType("int");
b1.Property<long>("RoleId")
.HasColumnType("bigint");
b1.HasKey("Id");
b1.HasIndex("RoleId");
b1.ToTable("RolePermissions", (string)null);
b1.WithOwner("Role")
.HasForeignKey("RoleId");
b1.Navigation("Role");
});
b.Navigation("Permissions");
});
modelBuilder.Entity("AccountManagement.Domain.TaskMediaAgg.TaskMedia", b =>
{
b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media")
.WithMany("TaskMedias")
.HasForeignKey("MediaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AccountManagement.Domain.TaskAgg.Tasks", "Tasks")
.WithMany("TaskMedias")
.HasForeignKey("TaskId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Media");
b.Navigation("Tasks");
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageAgg.TaskMessage", b =>
{
b.HasOne("AccountManagement.Domain.AssignAgg.Assign", "Assign")
.WithMany("TaskMessageList")
.HasForeignKey("AssignId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Assign");
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageItemsAgg.TaskMessageItems", b =>
{
b.HasOne("AccountManagement.Domain.TaskMessageAgg.TaskMessage", "TaskMessage")
.WithMany("TaskMessageItemsList")
.HasForeignKey("TaskMessageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("TaskMessage");
});
modelBuilder.Entity("AccountManagement.Domain.TicketMediasAgg.TicketMedia", b =>
{
b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media")
.WithMany("TicketMedias")
.HasForeignKey("MediaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AccountManagement.Domain.TicketAgg.Ticket", "Ticket")
.WithMany("TicketMedias")
.HasForeignKey("TicketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Media");
b.Navigation("Ticket");
});
modelBuilder.Entity("AccountManagement.Domain.AccountAgg.Account", b =>
{
b.Navigation("AccountLeftWorkList");
b.Navigation("CameraAccounts");
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseAgg.AdminResponse", b =>
{
b.Navigation("AdminResponseMedias");
});
modelBuilder.Entity("AccountManagement.Domain.AssignAgg.Assign", b =>
{
b.Navigation("TaskMessageList");
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseAgg.ClientResponse", b =>
{
b.Navigation("ClientResponseMedias");
});
modelBuilder.Entity("AccountManagement.Domain.MediaAgg.Media", b =>
{
b.Navigation("AdminResponseMedias");
b.Navigation("ClientResponseMedias");
b.Navigation("TaskMedias");
b.Navigation("TicketMedias");
});
modelBuilder.Entity("AccountManagement.Domain.RoleAgg.Role", b =>
{
b.Navigation("Accounts");
});
modelBuilder.Entity("AccountManagement.Domain.TaskAgg.Tasks", b =>
{
b.Navigation("Assigns");
b.Navigation("TaskMedias");
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageAgg.TaskMessage", b =>
{
b.Navigation("TaskMessageItemsList");
});
modelBuilder.Entity("AccountManagement.Domain.TicketAgg.Ticket", b =>
{
b.Navigation("AdminResponses");
b.Navigation("ClientResponses");
b.Navigation("TicketMedias");
});
modelBuilder.Entity("TaskManager.Domain.PositionAgg.Position", b =>
{
b.Navigation("Accounts");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,197 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AccountMangement.Infrastructure.EFCore.Migrations
{
/// <inheritdoc />
public partial class taskMessageTables_AssignChanges : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "AcceptedTimeRequest",
table: "Assigns",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "CancelDescription",
table: "Assigns",
type: "ntext",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "DoneDescription",
table: "Assigns",
type: "ntext",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "EndTaskDate",
table: "Assigns",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<bool>(
name: "IsCancel",
table: "Assigns",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsCanceledRequest",
table: "Assigns",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsDone",
table: "Assigns",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsDoneRequest",
table: "Assigns",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<DateTime>(
name: "RequestDate",
table: "Assigns",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "TimeRequest",
table: "Assigns",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "TimeRequestDescription",
table: "Assigns",
type: "ntext",
nullable: true);
migrationBuilder.CreateTable(
name: "TaskMessages",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Message = table.Column<string>(type: "ntext", nullable: true),
TypeOfMessage = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
RequestedDateFa = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
AssignId = table.Column<long>(type: "bigint", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TaskMessages", x => x.id);
table.ForeignKey(
name: "FK_TaskMessages_Assigns_AssignId",
column: x => x.AssignId,
principalTable: "Assigns",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "TaskMessageItems",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
SenderAccountId = table.Column<long>(type: "bigint", nullable: false),
ReceiverAccountId = table.Column<long>(type: "bigint", nullable: false),
TaskMessageId = table.Column<long>(type: "bigint", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TaskMessageItems", x => x.id);
table.ForeignKey(
name: "FK_TaskMessageItems_TaskMessages_TaskMessageId",
column: x => x.TaskMessageId,
principalTable: "TaskMessages",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_TaskMessageItems_TaskMessageId",
table: "TaskMessageItems",
column: "TaskMessageId");
migrationBuilder.CreateIndex(
name: "IX_TaskMessages_AssignId",
table: "TaskMessages",
column: "AssignId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "TaskMessageItems");
migrationBuilder.DropTable(
name: "TaskMessages");
migrationBuilder.DropColumn(
name: "AcceptedTimeRequest",
table: "Assigns");
migrationBuilder.DropColumn(
name: "CancelDescription",
table: "Assigns");
migrationBuilder.DropColumn(
name: "DoneDescription",
table: "Assigns");
migrationBuilder.DropColumn(
name: "EndTaskDate",
table: "Assigns");
migrationBuilder.DropColumn(
name: "IsCancel",
table: "Assigns");
migrationBuilder.DropColumn(
name: "IsCanceledRequest",
table: "Assigns");
migrationBuilder.DropColumn(
name: "IsDone",
table: "Assigns");
migrationBuilder.DropColumn(
name: "IsDoneRequest",
table: "Assigns");
migrationBuilder.DropColumn(
name: "RequestDate",
table: "Assigns");
migrationBuilder.DropColumn(
name: "TimeRequest",
table: "Assigns");
migrationBuilder.DropColumn(
name: "TimeRequestDescription",
table: "Assigns");
}
}
}

View File

@@ -0,0 +1,951 @@
// <auto-generated />
using System;
using AccountMangement.Infrastructure.EFCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace AccountMangement.Infrastructure.EFCore.Migrations
{
[DbContext(typeof(AccountContext))]
[Migration("20240821171716_Task_TicketChanges")]
partial class Task_TicketChanges
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("AccountManagement.Domain.AccountAgg.Account", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<string>("AdminAreaPermission")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<string>("ClientAriaPermission")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Email")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<string>("Fullname")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("IsActiveString")
.HasMaxLength(6)
.HasColumnType("nvarchar(6)");
b.Property<string>("Mobile")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("nvarchar(20)");
b.Property<string>("NationalCode")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<long?>("PositionId")
.HasMaxLength(10)
.HasColumnType("bigint");
b.Property<string>("PositionIsActive")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("ProfilePhoto")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<long>("RoleId")
.HasColumnType("bigint");
b.Property<string>("RoleName")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("VerifyCode")
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.HasKey("id");
b.HasIndex("PositionId");
b.HasIndex("RoleId");
b.ToTable("Accounts", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AccountLeftWorkAgg.AccountLeftWork", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("AccountId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<DateTime>("LeftWorkGr")
.HasColumnType("datetime2");
b.Property<DateTime>("StartWorkGr")
.HasColumnType("datetime2");
b.HasKey("id");
b.HasIndex("AccountId");
b.ToTable("AccountLeftWork", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseAgg.AdminResponse", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("AdminAccountId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("IsActiveString")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("Response")
.HasColumnType("ntext");
b.Property<long>("TicketId")
.HasColumnType("bigint");
b.HasKey("id");
b.HasIndex("TicketId");
b.ToTable("AdminResponses", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseMediaAgg.AdminResponseMedia", b =>
{
b.Property<long>("AdminResponseId")
.HasColumnType("bigint");
b.Property<long>("MediaId")
.HasColumnType("bigint");
b.HasKey("AdminResponseId", "MediaId");
b.HasIndex("MediaId");
b.ToTable("AdminResponseMedias", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AssignAgg.Assign", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<int>("AcceptedTimeRequest")
.HasColumnType("int");
b.Property<long>("AssignedId")
.HasColumnType("bigint");
b.Property<string>("AssignedName")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<int>("AssignedPositionValue")
.HasColumnType("int");
b.Property<long>("AssignerId")
.HasColumnType("bigint");
b.Property<int>("AssignerPositionValue")
.HasColumnType("int");
b.Property<string>("CancelDescription")
.HasColumnType("ntext");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("DoneDescription")
.HasColumnType("ntext");
b.Property<DateTime>("EndTaskDate")
.HasColumnType("datetime2");
b.Property<bool>("IsCancel")
.HasColumnType("bit");
b.Property<bool>("IsCanceledRequest")
.HasColumnType("bit");
b.Property<bool>("IsDone")
.HasColumnType("bit");
b.Property<bool>("IsDoneRequest")
.HasColumnType("bit");
b.Property<DateTime?>("RequestDate")
.HasColumnType("datetime2");
b.Property<long>("TaskId")
.HasColumnType("bigint");
b.Property<bool>("TimeRequest")
.HasColumnType("bit");
b.Property<string>("TimeRequestDescription")
.HasColumnType("ntext");
b.HasKey("id");
b.HasIndex("TaskId");
b.ToTable("Assigns", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.CameraAccountAgg.CameraAccount", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("AccountId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("IsActiveSting")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("Mobile")
.HasMaxLength(11)
.HasColumnType("nvarchar(11)");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<long>("WorkshopId")
.HasColumnType("bigint");
b.Property<string>("WorkshopName")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("id");
b.HasIndex("AccountId");
b.ToTable("CameraAccounts", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseAgg.ClientResponse", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Response")
.HasColumnType("ntext");
b.Property<long>("TicketId")
.HasColumnType("bigint");
b.HasKey("id");
b.HasIndex("TicketId");
b.ToTable("ClientResponses", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseMediaAgg.ClientResponseMedia", b =>
{
b.Property<long>("ClientResponseId")
.HasColumnType("bigint");
b.Property<long>("MediaId")
.HasColumnType("bigint");
b.HasKey("ClientResponseId", "MediaId");
b.HasIndex("MediaId");
b.ToTable("ClientResponseMedias", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.MediaAgg.Media", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<string>("Category")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Path")
.HasColumnType("ntext");
b.Property<string>("Type")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.HasKey("id");
b.ToTable("Medias", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.RoleAgg.Role", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("id");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskAgg.Tasks", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<string>("ContractingPartyName")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("ntext");
b.Property<string>("IsActiveString")
.HasMaxLength(7)
.HasColumnType("nvarchar(7)");
b.Property<long>("SenderId")
.HasColumnType("bigint");
b.Property<DateTime>("StartTaskDate")
.HasColumnType("datetime2");
b.Property<long?>("TaskScheduleId")
.HasColumnType("bigint");
b.Property<long?>("TicketId")
.HasColumnType("bigint");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("id");
b.HasIndex("TaskScheduleId");
b.ToTable("TasksManager", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskMediaAgg.TaskMedia", b =>
{
b.Property<long>("MediaId")
.HasColumnType("bigint");
b.Property<long>("TaskId")
.HasColumnType("bigint");
b.HasKey("MediaId", "TaskId");
b.HasIndex("TaskId");
b.ToTable("TasksMedias", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageAgg.TaskMessage", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("AssignId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Message")
.HasColumnType("ntext");
b.Property<string>("RequestedDateFa")
.HasMaxLength(25)
.HasColumnType("nvarchar(25)");
b.Property<string>("TypeOfMessage")
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.HasKey("id");
b.HasIndex("AssignId");
b.ToTable("TaskMessages", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageItemsAgg.TaskMessageItems", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<long>("ReceiverAccountId")
.HasColumnType("bigint");
b.Property<long>("SenderAccountId")
.HasColumnType("bigint");
b.Property<long>("TaskMessageId")
.HasColumnType("bigint");
b.HasKey("id");
b.HasIndex("TaskMessageId");
b.ToTable("TaskMessageItems", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskScheduleAgg.TaskSchedule", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<string>("Count")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<DateTime>("LastEndTaskDate")
.HasColumnType("datetime2");
b.Property<string>("Type")
.HasMaxLength(12)
.HasColumnType("nvarchar(12)");
b.Property<string>("UnitNumber")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<string>("UnitType")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.HasKey("id");
b.ToTable("TaskSchedules", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskSubjectAgg.TaskSubject", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Subject")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("id");
b.ToTable("TaskSubjects", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TicketAccessAccountAgg.TicketAccessAccount", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("AccountId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.HasKey("id");
b.ToTable("TicketAccessAccounts", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TicketAgg.Ticket", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<string>("ContractingPartyName")
.HasMaxLength(155)
.HasColumnType("nvarchar(155)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("ntext");
b.Property<long>("SenderId")
.HasColumnType("bigint");
b.Property<string>("Status")
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.Property<long>("SubAccountSenderId")
.HasColumnType("bigint");
b.Property<string>("TicketNumber")
.HasMaxLength(12)
.HasColumnType("nvarchar(12)");
b.Property<string>("TicketType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Title")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<long>("WorkshopId")
.HasColumnType("bigint");
b.HasKey("id");
b.ToTable("Tickets", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TicketMediasAgg.TicketMedia", b =>
{
b.Property<long>("TicketId")
.HasColumnType("bigint");
b.Property<long>("MediaId")
.HasColumnType("bigint");
b.HasKey("TicketId", "MediaId");
b.HasIndex("MediaId");
b.ToTable("TicketMedias", (string)null);
});
modelBuilder.Entity("TaskManager.Domain.PositionAgg.Position", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("PositionName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<int>("PositionValue")
.HasMaxLength(2)
.HasColumnType("int");
b.HasKey("id");
b.ToTable("Positions", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.AccountAgg.Account", b =>
{
b.HasOne("TaskManager.Domain.PositionAgg.Position", "Position")
.WithMany("Accounts")
.HasForeignKey("PositionId");
b.HasOne("AccountManagement.Domain.RoleAgg.Role", "Role")
.WithMany("Accounts")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Position");
b.Navigation("Role");
});
modelBuilder.Entity("AccountManagement.Domain.AccountLeftWorkAgg.AccountLeftWork", b =>
{
b.HasOne("AccountManagement.Domain.AccountAgg.Account", "Account")
.WithMany("AccountLeftWorkList")
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Account");
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseAgg.AdminResponse", b =>
{
b.HasOne("AccountManagement.Domain.TicketAgg.Ticket", "Ticket")
.WithMany("AdminResponses")
.HasForeignKey("TicketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Ticket");
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseMediaAgg.AdminResponseMedia", b =>
{
b.HasOne("AccountManagement.Domain.AdminResponseAgg.AdminResponse", "AdminResponse")
.WithMany("AdminResponseMedias")
.HasForeignKey("AdminResponseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media")
.WithMany("AdminResponseMedias")
.HasForeignKey("MediaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AdminResponse");
b.Navigation("Media");
});
modelBuilder.Entity("AccountManagement.Domain.AssignAgg.Assign", b =>
{
b.HasOne("AccountManagement.Domain.TaskAgg.Tasks", "Task")
.WithMany("Assigns")
.HasForeignKey("TaskId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Task");
});
modelBuilder.Entity("AccountManagement.Domain.CameraAccountAgg.CameraAccount", b =>
{
b.HasOne("AccountManagement.Domain.AccountAgg.Account", "Account")
.WithMany("CameraAccounts")
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Account");
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseAgg.ClientResponse", b =>
{
b.HasOne("AccountManagement.Domain.TicketAgg.Ticket", "Ticket")
.WithMany("ClientResponses")
.HasForeignKey("TicketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Ticket");
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseMediaAgg.ClientResponseMedia", b =>
{
b.HasOne("AccountManagement.Domain.ClientResponseAgg.ClientResponse", "ClientResponse")
.WithMany("ClientResponseMedias")
.HasForeignKey("ClientResponseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media")
.WithMany("ClientResponseMedias")
.HasForeignKey("MediaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ClientResponse");
b.Navigation("Media");
});
modelBuilder.Entity("AccountManagement.Domain.RoleAgg.Role", b =>
{
b.OwnsMany("AccountManagement.Domain.RoleAgg.Permission", "Permissions", b1 =>
{
b1.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
b1.Property<int>("Code")
.HasColumnType("int");
b1.Property<long>("RoleId")
.HasColumnType("bigint");
b1.HasKey("Id");
b1.HasIndex("RoleId");
b1.ToTable("RolePermissions", (string)null);
b1.WithOwner("Role")
.HasForeignKey("RoleId");
b1.Navigation("Role");
});
b.Navigation("Permissions");
});
modelBuilder.Entity("AccountManagement.Domain.TaskAgg.Tasks", b =>
{
b.HasOne("AccountManagement.Domain.TaskScheduleAgg.TaskSchedule", "TaskSchedule")
.WithMany("TasksList")
.HasForeignKey("TaskScheduleId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("TaskSchedule");
});
modelBuilder.Entity("AccountManagement.Domain.TaskMediaAgg.TaskMedia", b =>
{
b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media")
.WithMany("TaskMedias")
.HasForeignKey("MediaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AccountManagement.Domain.TaskAgg.Tasks", "Tasks")
.WithMany("TaskMedias")
.HasForeignKey("TaskId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Media");
b.Navigation("Tasks");
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageAgg.TaskMessage", b =>
{
b.HasOne("AccountManagement.Domain.AssignAgg.Assign", "Assign")
.WithMany("TaskMessageList")
.HasForeignKey("AssignId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Assign");
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageItemsAgg.TaskMessageItems", b =>
{
b.HasOne("AccountManagement.Domain.TaskMessageAgg.TaskMessage", "TaskMessage")
.WithMany("TaskMessageItemsList")
.HasForeignKey("TaskMessageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("TaskMessage");
});
modelBuilder.Entity("AccountManagement.Domain.TicketMediasAgg.TicketMedia", b =>
{
b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media")
.WithMany("TicketMedias")
.HasForeignKey("MediaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AccountManagement.Domain.TicketAgg.Ticket", "Ticket")
.WithMany("TicketMedias")
.HasForeignKey("TicketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Media");
b.Navigation("Ticket");
});
modelBuilder.Entity("AccountManagement.Domain.AccountAgg.Account", b =>
{
b.Navigation("AccountLeftWorkList");
b.Navigation("CameraAccounts");
});
modelBuilder.Entity("AccountManagement.Domain.AdminResponseAgg.AdminResponse", b =>
{
b.Navigation("AdminResponseMedias");
});
modelBuilder.Entity("AccountManagement.Domain.AssignAgg.Assign", b =>
{
b.Navigation("TaskMessageList");
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseAgg.ClientResponse", b =>
{
b.Navigation("ClientResponseMedias");
});
modelBuilder.Entity("AccountManagement.Domain.MediaAgg.Media", b =>
{
b.Navigation("AdminResponseMedias");
b.Navigation("ClientResponseMedias");
b.Navigation("TaskMedias");
b.Navigation("TicketMedias");
});
modelBuilder.Entity("AccountManagement.Domain.RoleAgg.Role", b =>
{
b.Navigation("Accounts");
});
modelBuilder.Entity("AccountManagement.Domain.TaskAgg.Tasks", b =>
{
b.Navigation("Assigns");
b.Navigation("TaskMedias");
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageAgg.TaskMessage", b =>
{
b.Navigation("TaskMessageItemsList");
});
modelBuilder.Entity("AccountManagement.Domain.TaskScheduleAgg.TaskSchedule", b =>
{
b.Navigation("TasksList");
});
modelBuilder.Entity("AccountManagement.Domain.TicketAgg.Ticket", b =>
{
b.Navigation("AdminResponses");
b.Navigation("ClientResponses");
b.Navigation("TicketMedias");
});
modelBuilder.Entity("TaskManager.Domain.PositionAgg.Position", b =>
{
b.Navigation("Accounts");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,270 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AccountMangement.Infrastructure.EFCore.Migrations
{
/// <inheritdoc />
public partial class Task_TicketChanges : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "TaskId",
table: "Tickets");
migrationBuilder.DropColumn(
name: "AcceptedTimeRequest",
table: "TasksManager");
migrationBuilder.DropColumn(
name: "CancelDescription",
table: "TasksManager");
migrationBuilder.DropColumn(
name: "DoneDescription",
table: "TasksManager");
migrationBuilder.DropColumn(
name: "EndTaskDate",
table: "TasksManager");
migrationBuilder.DropColumn(
name: "IsCancel",
table: "TasksManager");
migrationBuilder.DropColumn(
name: "IsCanceledRequest",
table: "TasksManager");
migrationBuilder.DropColumn(
name: "IsDone",
table: "TasksManager");
migrationBuilder.DropColumn(
name: "IsDoneRequest",
table: "TasksManager");
migrationBuilder.DropColumn(
name: "RequestDate",
table: "TasksManager");
migrationBuilder.DropColumn(
name: "TimeRequest",
table: "TasksManager");
migrationBuilder.DropColumn(
name: "TimeRequestDescription",
table: "TasksManager");
migrationBuilder.AddColumn<long>(
name: "SubAccountSenderId",
table: "Tickets",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn<string>(
name: "TicketNumber",
table: "Tickets",
type: "nvarchar(12)",
maxLength: 12,
nullable: true);
migrationBuilder.AddColumn<long>(
name: "WorkshopId",
table: "Tickets",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn<long>(
name: "TaskScheduleId",
table: "TasksManager",
type: "bigint",
nullable: true);
migrationBuilder.AddColumn<long>(
name: "AdminAccountId",
table: "AdminResponses",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn<string>(
name: "IsActiveString",
table: "AdminResponses",
type: "nvarchar(5)",
maxLength: 5,
nullable: true);
migrationBuilder.CreateTable(
name: "TaskSchedules",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Count = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
Type = table.Column<string>(type: "nvarchar(12)", maxLength: 12, nullable: true),
UnitType = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
UnitNumber = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
LastEndTaskDate = table.Column<DateTime>(type: "datetime2", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TaskSchedules", x => x.id);
});
migrationBuilder.CreateTable(
name: "TicketAccessAccounts",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AccountId = table.Column<long>(type: "bigint", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TicketAccessAccounts", x => x.id);
});
migrationBuilder.CreateIndex(
name: "IX_TasksManager_TaskScheduleId",
table: "TasksManager",
column: "TaskScheduleId");
migrationBuilder.AddForeignKey(
name: "FK_TasksManager_TaskSchedules_TaskScheduleId",
table: "TasksManager",
column: "TaskScheduleId",
principalTable: "TaskSchedules",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_TasksManager_TaskSchedules_TaskScheduleId",
table: "TasksManager");
migrationBuilder.DropTable(
name: "TaskSchedules");
migrationBuilder.DropTable(
name: "TicketAccessAccounts");
migrationBuilder.DropIndex(
name: "IX_TasksManager_TaskScheduleId",
table: "TasksManager");
migrationBuilder.DropColumn(
name: "SubAccountSenderId",
table: "Tickets");
migrationBuilder.DropColumn(
name: "TicketNumber",
table: "Tickets");
migrationBuilder.DropColumn(
name: "WorkshopId",
table: "Tickets");
migrationBuilder.DropColumn(
name: "TaskScheduleId",
table: "TasksManager");
migrationBuilder.DropColumn(
name: "AdminAccountId",
table: "AdminResponses");
migrationBuilder.DropColumn(
name: "IsActiveString",
table: "AdminResponses");
migrationBuilder.AddColumn<long>(
name: "TaskId",
table: "Tickets",
type: "bigint",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "AcceptedTimeRequest",
table: "TasksManager",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "CancelDescription",
table: "TasksManager",
type: "ntext",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "DoneDescription",
table: "TasksManager",
type: "ntext",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "EndTaskDate",
table: "TasksManager",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<bool>(
name: "IsCancel",
table: "TasksManager",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsCanceledRequest",
table: "TasksManager",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsDone",
table: "TasksManager",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsDoneRequest",
table: "TasksManager",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<DateTime>(
name: "RequestDate",
table: "TasksManager",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "TimeRequest",
table: "TasksManager",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "TimeRequestDescription",
table: "TasksManager",
type: "ntext",
nullable: true);
}
}
}

View File

@@ -72,6 +72,10 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
.HasMaxLength(10)
.HasColumnType("bigint");
b.Property<string>("PositionIsActive")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("ProfilePhoto")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
@@ -136,9 +140,16 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("AdminAccountId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("IsActiveString")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("Response")
.HasColumnType("ntext");
@@ -175,6 +186,9 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<int>("AcceptedTimeRequest")
.HasColumnType("int");
b.Property<long>("AssignedId")
.HasColumnType("bigint");
@@ -191,12 +205,42 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.Property<int>("AssignerPositionValue")
.HasColumnType("int");
b.Property<string>("CancelDescription")
.HasColumnType("ntext");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("DoneDescription")
.HasColumnType("ntext");
b.Property<DateTime>("EndTaskDate")
.HasColumnType("datetime2");
b.Property<bool>("IsCancel")
.HasColumnType("bit");
b.Property<bool>("IsCanceledRequest")
.HasColumnType("bit");
b.Property<bool>("IsDone")
.HasColumnType("bit");
b.Property<bool>("IsDoneRequest")
.HasColumnType("bit");
b.Property<DateTime?>("RequestDate")
.HasColumnType("datetime2");
b.Property<long>("TaskId")
.HasColumnType("bigint");
b.Property<bool>("TimeRequest")
.HasColumnType("bit");
b.Property<string>("TimeRequestDescription")
.HasColumnType("ntext");
b.HasKey("id");
b.HasIndex("TaskId");
@@ -346,12 +390,6 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<int>("AcceptedTimeRequest")
.HasColumnType("int");
b.Property<string>("CancelDescription")
.HasColumnType("ntext");
b.Property<string>("ContractingPartyName")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
@@ -362,45 +400,21 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.Property<string>("Description")
.HasColumnType("ntext");
b.Property<string>("DoneDescription")
.HasColumnType("ntext");
b.Property<DateTime>("EndTaskDate")
.HasColumnType("datetime2");
b.Property<string>("IsActiveString")
.HasMaxLength(7)
.HasColumnType("nvarchar(7)");
b.Property<bool>("IsCancel")
.HasColumnType("bit");
b.Property<bool>("IsCanceledRequest")
.HasColumnType("bit");
b.Property<bool>("IsDone")
.HasColumnType("bit");
b.Property<bool>("IsDoneRequest")
.HasColumnType("bit");
b.Property<DateTime?>("RequestDate")
.HasColumnType("datetime2");
b.Property<long>("SenderId")
.HasColumnType("bigint");
b.Property<DateTime>("StartTaskDate")
.HasColumnType("datetime2");
b.Property<long?>("TicketId")
b.Property<long?>("TaskScheduleId")
.HasColumnType("bigint");
b.Property<bool>("TimeRequest")
.HasColumnType("bit");
b.Property<string>("TimeRequestDescription")
.HasColumnType("ntext");
b.Property<long?>("TicketId")
.HasColumnType("bigint");
b.Property<string>("Title")
.IsRequired()
@@ -409,6 +423,8 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.HasKey("id");
b.HasIndex("TaskScheduleId");
b.ToTable("TasksManager", (string)null);
});
@@ -427,6 +443,100 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.ToTable("TasksMedias", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageAgg.TaskMessage", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("AssignId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("Message")
.HasColumnType("ntext");
b.Property<string>("RequestedDateFa")
.HasMaxLength(25)
.HasColumnType("nvarchar(25)");
b.Property<string>("TypeOfMessage")
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.HasKey("id");
b.HasIndex("AssignId");
b.ToTable("TaskMessages", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageItemsAgg.TaskMessageItems", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<long>("ReceiverAccountId")
.HasColumnType("bigint");
b.Property<long>("SenderAccountId")
.HasColumnType("bigint");
b.Property<long>("TaskMessageId")
.HasColumnType("bigint");
b.HasKey("id");
b.HasIndex("TaskMessageId");
b.ToTable("TaskMessageItems", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskScheduleAgg.TaskSchedule", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<string>("Count")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<DateTime>("LastEndTaskDate")
.HasColumnType("datetime2");
b.Property<string>("Type")
.HasMaxLength(12)
.HasColumnType("nvarchar(12)");
b.Property<string>("UnitNumber")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<string>("UnitType")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.HasKey("id");
b.ToTable("TaskSchedules", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TaskSubjectAgg.TaskSubject", b =>
{
b.Property<long>("id")
@@ -448,6 +558,25 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.ToTable("TaskSubjects", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TicketAccessAccountAgg.TicketAccessAccount", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("AccountId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.HasKey("id");
b.ToTable("TicketAccessAccounts", (string)null);
});
modelBuilder.Entity("AccountManagement.Domain.TicketAgg.Ticket", b =>
{
b.Property<long>("id")
@@ -473,9 +602,13 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.Property<long?>("TaskId")
b.Property<long>("SubAccountSenderId")
.HasColumnType("bigint");
b.Property<string>("TicketNumber")
.HasMaxLength(12)
.HasColumnType("nvarchar(12)");
b.Property<string>("TicketType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
@@ -484,6 +617,9 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<long>("WorkshopId")
.HasColumnType("bigint");
b.HasKey("id");
b.ToTable("Tickets", (string)null);
@@ -639,7 +775,7 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
modelBuilder.Entity("AccountManagement.Domain.RoleAgg.Role", b =>
{
b.OwnsMany("AccountManagement.Domain.RoleAgg.Role.Permissions#AccountManagement.Domain.RoleAgg.Permission", "Permissions", b1 =>
b.OwnsMany("AccountManagement.Domain.RoleAgg.Permission", "Permissions", b1 =>
{
b1.Property<long>("Id")
.ValueGeneratedOnAdd()
@@ -668,6 +804,16 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.Navigation("Permissions");
});
modelBuilder.Entity("AccountManagement.Domain.TaskAgg.Tasks", b =>
{
b.HasOne("AccountManagement.Domain.TaskScheduleAgg.TaskSchedule", "TaskSchedule")
.WithMany("TasksList")
.HasForeignKey("TaskScheduleId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("TaskSchedule");
});
modelBuilder.Entity("AccountManagement.Domain.TaskMediaAgg.TaskMedia", b =>
{
b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media")
@@ -687,6 +833,28 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.Navigation("Tasks");
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageAgg.TaskMessage", b =>
{
b.HasOne("AccountManagement.Domain.AssignAgg.Assign", "Assign")
.WithMany("TaskMessageList")
.HasForeignKey("AssignId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Assign");
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageItemsAgg.TaskMessageItems", b =>
{
b.HasOne("AccountManagement.Domain.TaskMessageAgg.TaskMessage", "TaskMessage")
.WithMany("TaskMessageItemsList")
.HasForeignKey("TaskMessageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("TaskMessage");
});
modelBuilder.Entity("AccountManagement.Domain.TicketMediasAgg.TicketMedia", b =>
{
b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media")
@@ -718,6 +886,11 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.Navigation("AdminResponseMedias");
});
modelBuilder.Entity("AccountManagement.Domain.AssignAgg.Assign", b =>
{
b.Navigation("TaskMessageList");
});
modelBuilder.Entity("AccountManagement.Domain.ClientResponseAgg.ClientResponse", b =>
{
b.Navigation("ClientResponseMedias");
@@ -746,6 +919,16 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.Navigation("TaskMedias");
});
modelBuilder.Entity("AccountManagement.Domain.TaskMessageAgg.TaskMessage", b =>
{
b.Navigation("TaskMessageItemsList");
});
modelBuilder.Entity("AccountManagement.Domain.TaskScheduleAgg.TaskSchedule", b =>
{
b.Navigation("TasksList");
});
modelBuilder.Entity("AccountManagement.Domain.TicketAgg.Ticket", b =>
{
b.Navigation("AdminResponses");

View File

@@ -196,9 +196,8 @@ public class AccountRepository : RepositoryBase<long, Account>, IAccountReposito
PositionValue = x.Position.PositionValue,
PositionId = x.Position.id,
IsActiveString = x.IsActiveString,
Username = x.Username
Username = x.Username,
PositionIsActive = x.PositionIsActive
}).ToList();
}
@@ -209,7 +208,7 @@ public class AccountRepository : RepositoryBase<long, Account>, IAccountReposito
var assignerIds = _context.Assigns.Where(x => x.TaskId == taskId).Select(x => x.AssignerId).ToList();
return _context.Accounts.Include(x => x.Position).Where(x =>
x.Position.PositionValue > posValue && !assignerIds.Contains(x.id) && !assignedIds.Contains(x.id)).Select(
x.Position.PositionValue >= posValue && !assignerIds.Contains(x.id) && !assignedIds.Contains(x.id)).Select(
x => new AccountViewModel()
{
PositionValue = x.Position.PositionValue,
@@ -230,7 +229,7 @@ public class AccountRepository : RepositoryBase<long, Account>, IAccountReposito
var account = GetIncludePositions(int.Parse(_contextAccessor.HttpContext.User.FindFirst("AccountId").Value));
return _context.Accounts.Include(x => x.Position)
.Where(x => x.Position.PositionValue >= account.Position.PositionValue && x.IsActiveString == "true").Select(x => new AccountViewModel()
.Where(x => x.Position.PositionValue > account.Position.PositionValue && x.IsActiveString == "true").Select(x => new AccountViewModel()
{
PositionValue = x.Position.PositionValue,
Id = x.id,
@@ -270,24 +269,33 @@ public class AccountRepository : RepositoryBase<long, Account>, IAccountReposito
}).FirstOrDefault(x => x.Id == id);
}
public List<AccountViewModel> GetAccountsDeactivePositionValue(long Positionid)
{
return _context.Accounts.Where(x => x.PositionId == Positionid && x.PositionIsActive == "false").Select(x => new AccountViewModel()
{
Id = x.id,
Fullname = x.Fullname
}).ToList();
}
//public List<AccountViewModel> GetAdminAccounts()
//{
// return _context.Accounts.Where(x=>x.AdminAreaPermission == "true" && x.IsActiveString == "true").Select(x => new AccountViewModel()
// {
// Id = x.id,
// Fullname = x.Fullname,
// RoleName = x.RoleName,
// Username = x.Username,
// RoleId = x.RoleId,
// Mobile = x.Mobile,
// CreationDateGr = x.CreationDate,
// IsActiveString = x.IsActiveString,
// return _context.Accounts.Where(x=>x.AdminAreaPermission == "true" && x.IsActiveString == "true").Select(x => new AccountViewModel()
// {
// Id = x.id,
// Fullname = x.Fullname,
// RoleName = x.RoleName,
// Username = x.Username,
// RoleId = x.RoleId,
// Mobile = x.Mobile,
// CreationDateGr = x.CreationDate,
// IsActiveString = x.IsActiveString,
// }).ToList();
// }).ToList();
//}
#endregion
#endregion
}

View File

@@ -1,37 +1,65 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using _0_Framework.InfraStructure;
using AccountManagement.Application.Contracts.Assign;
using AccountManagement.Domain.AssignAgg;
using AccountMangement.Infrastructure.EFCore;
using Microsoft.EntityFrameworkCore;
namespace AccountMangement.Infrastructure.EFCore.Repository;
public class AssignRepository :RepositoryBase<long,Assign>,IAssignRepository
{
private readonly AccountContext _taskManagerContext;
public AssignRepository(AccountContext taskManagerContext) : base(taskManagerContext)
private readonly AccountContext _accountContext;
public AssignRepository(AccountContext accountContext) : base(accountContext)
{
_taskManagerContext = taskManagerContext;
_accountContext = accountContext;
}
public List<AssignViewModel> GetAssignsByTaskId(long id)
{
return _taskManagerContext.Assigns.Where(x=>x.TaskId==id).Select(x => new AssignViewModel()
return _accountContext.Assigns.Where(x=>x.TaskId==id).Select(x => new AssignViewModel()
{
AssignedId = _taskManagerContext.Assigns.Where(e=>e.TaskId==id&&e.AssignerId==x.AssignerId).Select(a=>a.AssignedId).ToList(),
AssignedId = x.AssignedId,
AssignerId = x.AssignerId,
AssignerPositionValue = x.AssignerPositionValue,
Id = x.id,
TaskId = x.TaskId,
AssignedName = x.AssignedName
AssignedName = x.AssignedName,
TimeRequest = x.TimeRequest,
IsCancel = x.IsCancel,
EndTaskDateGr = x.EndTaskDate,
IsDone = x.IsDone,
IsDoneRequest = x.IsDoneRequest,
IsCanceledRequest = x.IsCanceledRequest,
AcceptedTimeRequest = x.AcceptedTimeRequest,
RequestDate = x.RequestDate,
AssignedPositionValue = x.AssignedPositionValue,
CancelDescription = x.CancelDescription,
DoneDescription = x.DoneDescription,
TimeRequestDescription = x.TimeRequestDescription,
}).ToList();
}
public void RemoveRangeAssigns( long taskId)
{
var assigns= _taskManagerContext.Assigns.Where(x => x.TaskId == taskId);
_taskManagerContext.RemoveRange(assigns);
_taskManagerContext.SaveChanges();
var assigns= _accountContext.Assigns.Where(x => x.TaskId == taskId);
_accountContext.RemoveRange(assigns);
_accountContext.SaveChanges();
}
public List<long> GetAssignedIdsByTaskId(long taskId)
{
return _accountContext.Assigns.Where(x => x.TaskId == taskId).Select(x => x.AssignedId).ToList();
}
public Assign GetAssignByAssignedIdAndTaskId(long assignedId, long taskId)
{
return _accountContext.Assigns.Include(x=>x.Task).FirstOrDefault(x => x.TaskId == taskId && x.AssignedId == assignedId);
}
public Assign GetIncludeTask(long id)
{
return _accountContext.Assigns.Include(x=>x.Task).FirstOrDefault(x => x.id == id);
}
}

View File

@@ -30,7 +30,7 @@ public class PositionRepository : RepositoryBase<long, Position>, IPositionRepos
Value = x.PositionValue,
Id = x.id,
Name = x.PositionName,
CountUsers = _accountContext.Accounts.Count(a => a.PositionId == x.id)
CountUsers = _accountContext.Accounts.Count(a => a.PositionId == x.id &&a.PositionIsActive=="true")
@@ -47,6 +47,10 @@ public class PositionRepository : RepositoryBase<long, Position>, IPositionRepos
Value = x.PositionValue,
Id = x.id,
Name = x.PositionName
}).OrderBy(x => x.Value).ToList();
}
@@ -61,14 +65,14 @@ public class PositionRepository : RepositoryBase<long, Position>, IPositionRepos
public List<AccountViewModel> GetNoPositionAccounts()
{
return _accountContext.Accounts.Where(x => x.PositionId == null && x.IsActiveString == "true" && x.AdminAreaPermission == "true").Select(x => new AccountViewModel()
return _accountContext.Accounts.Where(x =>( x.PositionId == null || (x.PositionId !=null && x.PositionIsActive== "false"))&& x.IsActiveString == "true" && x.AdminAreaPermission == "true").Select(x => new AccountViewModel()
{
Id = x.id,
Fullname = x.Fullname
}).ToList();
}
public List<Account> GetAccountsByIds(List<long> ids)
public List<Account> GetAccountsByPositionIds(List<long> ids)
{
var res = _accountContext.Accounts.Include(x => x.Position).Where(x => x.PositionId != null);
return res.Where(x => ids.Contains((long)x.PositionId)).ToList();

View File

@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using AccountManagement.Application.Contracts.TaskMessage;
using AccountManagement.Domain.AccountAgg;
using AccountManagement.Domain.AccountLeftWorkAgg;
using AccountManagement.Domain.TaskMessageAgg;
using AccountManagement.Domain.TaskMessageItemsAgg;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
namespace AccountMangement.Infrastructure.EFCore.Repository;
public class TaskMessageRepository : RepositoryBase<long, TaskMessage>, ITaskMessageRepository
{
private readonly AccountContext _accountContext;
private readonly IHttpContextAccessor _contextAccessor;
private readonly IAccountRepository _accountRepository;
public TaskMessageRepository(AccountContext accountContext, IHttpContextAccessor contextAccessor, IAccountRepository accountRepository) : base(accountContext)
{
_accountContext = accountContext;
_contextAccessor = contextAccessor;
_accountRepository = accountRepository;
}
public void CreateTaskMessageItems(long senderId, long receiverId, long messageId)
{
var messageItems = new TaskMessageItems(senderId, receiverId, messageId);
_accountContext.Add(messageItems);
_accountContext.SaveChanges();
}
public List<TaskMessageViewModel> GetTaskMessages(long assignId)
{
var accountId = long.Parse(_contextAccessor.HttpContext.User.FindFirst("AccountId").Value);
var raw = _accountContext.TaskMessages.Include(x => x.TaskMessageItemsList).Include(x => x.Assign).Where(x =>
x.AssignId == assignId &&
x.TaskMessageItemsList.Any(x => x.ReceiverAccountId == accountId || x.SenderAccountId == accountId)).Select(
x => new TaskMessageViewModel()
{
SenderId = x.TaskMessageItemsList.First().SenderAccountId,
ReceiverId = x.TaskMessageItemsList.First().ReceiverAccountId,
CreationDate = $"{x.CreationDate.ToFarsi()} {x.CreationDate.DayOfWeek.DayOfWeeKToPersian()} {x.CreationDate.Hour}:{x.CreationDate.Minute}",
Message = x.Message,
TypeOfMessage = x.TypeOfMessage,
RequestedDateFa = x.RequestedDateFa
}).ToList();
List<TaskMessageViewModel> res = raw.Select(x => new TaskMessageViewModel()
{
SenderId = x.SenderId,
CreationDate = x.CreationDate,
Message = x.Message,
TypeOfMessage = x.TypeOfMessage,
ReceiverId = x.ReceiverId,
SenderName = _accountRepository.GetAccountViewModel(x.SenderId).Fullname
}).ToList();
return res;
}
}

View File

@@ -0,0 +1,41 @@
using System.Collections.Generic;
using System.Linq;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using AccountManagement.Application.Contracts.TicketAccessAccount;
using AccountManagement.Domain.TicketAccessAccountAgg;
namespace AccountMangement.Infrastructure.EFCore.Repository;
public class TicketAccessAccountRepository:RepositoryBase<long,TicketAccessAccount>, ITicketAccessAccountRepository
{
private readonly AccountContext _accountContext;
public TicketAccessAccountRepository(AccountContext accountContext):base(accountContext)
{
_accountContext = accountContext;
}
public bool HasTicketAccess(long accountId)
{
return _accountContext.TicketAccessAccounts.Any(x => x.AccountId == accountId);
}
public List<TicketAccessAccountViewModel> GetAllAccessedAccounts()
{
return _accountContext.TicketAccessAccounts.Select(x => new TicketAccessAccountViewModel()
{
CreateDateFa = x.CreationDate.ToFarsi(),
Name = _accountContext.Accounts.FirstOrDefault(a => a.id == x.AccountId).Fullname,
AccountId = x.AccountId,
Id = x.id
}).ToList();
}
public void Remove(long id)
{
var entity = Get(id);
_accountContext.Remove(entity);
}
}

View File

@@ -1,13 +1,17 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using AccountManagement.Application.Contracts.Account;
using AccountManagement.Application.Contracts.Media;
using AccountManagement.Application.Contracts.Ticket;
using AccountManagement.Domain.AdminResponseAgg;
using AccountManagement.Domain.ClientResponseAgg;
using AccountManagement.Domain.ClientResponseMediaAgg;
using AccountManagement.Domain.TicketAgg;
using Company.Domain.WorkshopAgg;
using Microsoft.EntityFrameworkCore;
namespace AccountMangement.Infrastructure.EFCore.Repository;
@@ -15,9 +19,15 @@ namespace AccountMangement.Infrastructure.EFCore.Repository;
public class TicketRepository : RepositoryBase<long, Ticket>, ITicketRepository
{
private readonly AccountContext _accountContext;
public TicketRepository(AccountContext accountContext) : base(accountContext)
private readonly IAuthHelper _authHelper;
private readonly IPasswordHasher _passwordHasher;
private readonly IWorkshopRepository _workshopRepository;
public TicketRepository(AccountContext accountContext, IAuthHelper authHelper, IPasswordHasher passwordHasher, IWorkshopRepository workshopRepository) : base(accountContext)
{
_accountContext = accountContext;
_authHelper = authHelper;
_passwordHasher = passwordHasher;
_workshopRepository = workshopRepository;
}
public List<TicketViewModel> GetAll(TicketSearchModel searchModel)
@@ -31,45 +41,92 @@ public class TicketRepository : RepositoryBase<long, Ticket>, ITicketRepository
Title = x.Title,
TicketType = x.TicketType,
Status = x.Status,
TaskId = x.TaskId,
CreationDateTimeGr = x.CreationDate,
CreationDateTime = x.CreationDate.ToFarsiFull(),
MediaViewModels = _accountContext.TicketMedias.Include(z => z.Media).Where(a => a.TicketId == x.id)
.Select(m => new MediaViewModel()
{
Id = m.Media.id,
Path = m.Media.Path,
Type = m.Media.Type,
}).ToList(),
AdminResponseViewModels = _accountContext.AdminResponses.Include(a => a.AdminResponseMedias)
.Where(a => a.TicketId == x.id).Select(a => new AdminResponseViewModel()
{
MediaViewModels = _accountContext.AdminResponseMedias.Include(d => d.Media)
.Where(d => d.AdminResponseId == a.id).Select(d => new MediaViewModel()
{
Id = d.Media.id,
Path = d.Media.Path,
Type = d.Media.Type,
}).ToList(),
Response = a.Response,
TicketId = a.TicketId
}).ToList(),
ClientResponseViewModels = _accountContext.ClientResponses.Include(a => a.ClientResponseMedias)
.Where(a => a.TicketId == x.id).Select(a => new ClientResponseViewModel()
{
MediaViewModels = _accountContext.ClientResponseMedias.Include(d => d.Media)
.Where(d => d.ClientResponseId == a.id).Select(d => new MediaViewModel()
{
Id = d.Media.id,
Path = d.Media.Path,
Type = d.Media.Type,
}).ToList(),
Response = a.Response,
TicketId = a.TicketId
}).ToList(),
TicketNumber = $"TKC_{x.TicketNumber}",
WorkshopName = _workshopRepository.Get(x.WorkshopId).WorkshopFullName,
HasTask = _accountContext.Tasks.Include(t => t.Assigns).Any(t => t.TicketId == x.id && t.Assigns.Any(a => !a.IsDone)),
WorkshopId = x.WorkshopId,
RawTicketNumber = x.TicketNumber
});
#region Search
if (!string.IsNullOrWhiteSpace(searchModel.Status))
{
query = query.Where(x => x.Status == searchModel.Status);
}
if (!(string.IsNullOrWhiteSpace(searchModel.StartDate) && string.IsNullOrWhiteSpace(searchModel.EndDate)))
{
if (string.IsNullOrWhiteSpace(searchModel.OneDay))
{
var startDate = searchModel.StartDate.ToGeorgianDateTime();
var endDate = searchModel.EndDate.ToGeorgianDateTime();
query = query.Where(x => startDate < x.CreationDateTimeGr && endDate > x.CreationDateTimeGr);
}
}
if (!string.IsNullOrWhiteSpace(searchModel.OneDay))
{
var oneDay = searchModel.OneDay.ToGeorgianDateTime();
query = query.Where(x =>x.CreationDateTimeGr.Date == oneDay.Date);
}
if (!string.IsNullOrWhiteSpace(searchModel.GeneralSearch))
{
query = query.Where(x => x.Title.Contains(searchModel.GeneralSearch) ||x.ContractingPartyName.Contains(searchModel.GeneralSearch)||x.WorkshopName.Contains(searchModel.GeneralSearch));
}
if (!string.IsNullOrWhiteSpace(searchModel.OneDay))
{
var day = searchModel.OneDay.ToGeorgianDateTime();
query = query.Where(x => x.CreationDateTimeGr.Date == day.Date);
}
if (!string.IsNullOrWhiteSpace(searchModel.ContractingPartyName))
{
query = query.Where(x => x.ContractingPartyName == searchModel.ContractingPartyName.Trim());
}
if (searchModel.WorkshopId>0)
{
query = query.Where(x => x.WorkshopId == searchModel.WorkshopId);
}
if (!string.IsNullOrWhiteSpace(searchModel.TicketNumber))
{
query = query.Where(x => x.RawTicketNumber == searchModel.TicketNumber);
}
if (!string.IsNullOrWhiteSpace(searchModel.Status))
{
query = query.Where(x => x.Status == searchModel.Status.Trim());
}
#endregion
return query.Skip(searchModel.PageIndex).Take(30).ToList();
}
public List<TicketViewModel> GetTicketsForClients(TicketSearchModel searchModel)
{
var accountId = _authHelper.CurrentAccountId();
var workshopSlug = _authHelper.GetWorkshopSlug();
var workshopId = _passwordHasher.SlugDecrypt(workshopSlug);
IQueryable<Ticket> query;
if (workshopId > 0)
{
query = _accountContext.Tickets.Where(x => x.SenderId == accountId && x.WorkshopId == workshopId);
}
else
{
query = _accountContext.Tickets.Where(x => x.SenderId == accountId);
}
if (!string.IsNullOrWhiteSpace(searchModel.ContractingPartyName))
{
query = query.Where(x => x.ContractingPartyName.Contains(searchModel.ContractingPartyName));
@@ -86,42 +143,49 @@ public class TicketRepository : RepositoryBase<long, Ticket>, ITicketRepository
{
var startDate = searchModel.StartDate.ToGeorgianDateTime();
var endDate = searchModel.EndDate.ToGeorgianDateTime();
query = query.Where(x => startDate < x.CreationDateTimeGr && endDate > x.CreationDateTimeGr);
query = query.Where(x => startDate < x.CreationDate && endDate > x.CreationDate);
}
}
if (!string.IsNullOrWhiteSpace(searchModel.Title))
if (!string.IsNullOrWhiteSpace(searchModel.GeneralSearch))
{
query = query.Where(x => x.Title.Contains(searchModel.Title));
query = query.Where(x => x.Title.Contains(searchModel.GeneralSearch));
}
if (!string.IsNullOrWhiteSpace(searchModel.TypeOfTicket))
if (!string.IsNullOrWhiteSpace(searchModel.Status))
{
query = query.Where(x => x.TicketType == searchModel.TypeOfTicket);
query = query.Where(x => x.Status == searchModel.Status);
}
if (!string.IsNullOrWhiteSpace(searchModel.OneDay))
{
var day = searchModel.OneDay.ToGeorgianDateTime();
query = query.Where(x => x.CreationDateTimeGr.Date == day.Date);
query = query.Where(x => x.CreationDate.Date == day.Date);
}
if (!string.IsNullOrWhiteSpace(searchModel.IsAssigned))
var res = query.OrderBy(x=>x.Status.Trim()=="بسته شده").ThenByDescending(x => x.CreationDate).Select(x => new TicketViewModel()
{
var isAssigned = bool.Parse(searchModel.IsAssigned);
if (isAssigned)
{
query.Where(x => x.TaskId != null);
}
else if (!isAssigned)
{
query.Where(x => x.TaskId == null);
}
}
return query.ToList();
Description = x.Description,
SenderId = x.SenderId,
ContractingPartyName = x.ContractingPartyName,
Id = x.id,
Title = x.Title,
TicketType = x.TicketType,
Status = x.Status,
CreationDateTimeGr = x.CreationDate,
CreationDateTime = x.CreationDate.ToFarsi(),
TicketNumber = $"TKC_{x.TicketNumber}",
WorkshopName = _workshopRepository.Get(x.WorkshopId).WorkshopFullName
});
return res.Skip(searchModel.PageIndex).Take(30).ToList();
}
public void CreateAdminResponse(AdminResponse command)
{
_accountContext.Add(command);
@@ -134,48 +198,203 @@ public class TicketRepository : RepositoryBase<long, Ticket>, ITicketRepository
public EditTicket GetDetails(long id)
{
return _accountContext.Tickets.Select(x => new EditTicket()
var query = _accountContext.Tickets.Select(x => new EditTicket()
{
ContractingPartyName = x.ContractingPartyName,
Description = x.Description,
Id = x.id,
SenderId = x.SenderId,
Sender = _accountContext.Accounts.Select(account => new AccountViewModel()
{
Id = account.id,
Fullname = account.Fullname,
}).Where(a => a.Id == x.SenderId).FirstOrDefault(),
TicketType = x.TicketType,
Title = x.Title,
CreationDateStr = x.CreationDate.ToFarsi(),
MediaViewModels = _accountContext.TicketMedias.Include(z => z.Media).Where(a => a.TicketId == x.id)
.Select(m => new MediaViewModel()
{
Id = m.Media.id,
Path = m.Media.Path,
Type = m.Media.Type,
Category = m.Media.Category,
}).ToList(),
ClientResponseViewModels = _accountContext.ClientResponses.Where(c => c.TicketId == x.id)
.Select(m => new ClientResponseViewModel()
{
Response = m.Response,
TicketId = m.TicketId,
MediaViewModels = _accountContext.ClientResponseMedias.Include(a => a.Media).Where(a => a.ClientResponseId == m.id).Select(cm => new MediaViewModel()
{
Category = cm.Media.Category,
Path = cm.Media.Path,
Id = cm.Media.id,
Type = cm.Media.Type,
}).ToList(),
MediaViewModels = _accountContext.ClientResponseMedias.Include(a => a.Media)
.Where(a => a.ClientResponseId == m.id).Select(cm => new MediaViewModel()
{
Category = cm.Media.Category,
Path = cm.Media.Path,
Id = cm.Media.id,
Type = cm.Media.Type,
}).ToList(),
CreationDate = m.CreationDate,
Id = m.id,
}).ToList(),
AdminResponseViewModels = _accountContext.AdminResponses.Where(c => c.TicketId == x.id)
.Select(m => new AdminResponseViewModel()
{
Response = m.Response,
FullName = _accountContext.Accounts.FirstOrDefault(ac => ac.id == m.AdminAccountId).Fullname,
TicketId = m.TicketId,
MediaViewModels = _accountContext.AdminResponseMedias.Include(a => a.Media).Where(a => a.AdminResponseId == m.id).Select(cm => new MediaViewModel()
{
Category = cm.Media.Category,
Path = cm.Media.Path,
Id = cm.Media.id,
Type = cm.Media.Type,
}).ToList(),
AdminAccountId = m.AdminAccountId,
MediaViewModels = _accountContext.AdminResponseMedias.Include(a => a.Media)
.Where(a => a.AdminResponseId == m.id).Select(cm => new MediaViewModel()
{
Category = cm.Media.Category,
Path = cm.Media.Path,
Id = cm.Media.id,
Type = cm.Media.Type,
}).ToList(),
CreationDate = m.CreationDate,
Id = m.id,
IsActive = m.IsActiveString,
}).ToList(),
WorkshopId = x.WorkshopId,
TicketNumber = $"TKC_{x.TicketNumber}",
Status = x.Status
}).FirstOrDefault(x => x.Id == id);
query.ResponseViewModels = MergeResponses(query.ClientResponseViewModels, query.AdminResponseViewModels);
return query;
}
public EditTicket GetDetailsForClient(long id)
{
var query = _accountContext.Tickets.Select(x => new EditTicket()
{
ContractingPartyName = x.ContractingPartyName,
Description = x.Description,
Id = x.id,
SenderId = x.SenderId,
Sender = _accountContext.Accounts.Select(account => new AccountViewModel()
{
Id = account.id,
Fullname = account.Fullname,
}).Where(a => a.Id == x.SenderId).FirstOrDefault(),
TicketType = x.TicketType,
Title = x.Title,
CreationDateStr = $"{x.CreationDate.ToFarsi()} {x.CreationDate.DayOfWeek.DayOfWeeKToPersian()}",
MediaViewModels = _accountContext.TicketMedias.Include(z => z.Media).Where(a => a.TicketId == x.id)
.Select(m => new MediaViewModel()
{
Id = m.Media.id,
Path = m.Media.Path,
Type = m.Media.Type,
Category = m.Media.Category,
}).ToList(),
ClientResponseViewModels = _accountContext.ClientResponses.Where(c => c.TicketId == x.id)
.Select(m => new ClientResponseViewModel()
{
Response = m.Response,
TicketId = m.TicketId,
MediaViewModels = _accountContext.ClientResponseMedias.Include(a => a.Media)
.Where(a => a.ClientResponseId == m.id).Select(cm => new MediaViewModel()
{
Category = cm.Media.Category,
Path = cm.Media.Path,
Id = cm.Media.id,
Type = cm.Media.Type,
}).ToList(),
CreationDate = m.CreationDate,
Id = m.id,
}).ToList(),
AdminResponseViewModels = _accountContext.AdminResponses.Where(c => c.TicketId == x.id && c.IsActiveString == "true")
.Select(m => new AdminResponseViewModel()
{
Response = m.Response,
TicketId = m.TicketId,
MediaViewModels = _accountContext.AdminResponseMedias.Include(a => a.Media)
.Where(a => a.AdminResponseId == m.id).Select(cm => new MediaViewModel()
{
Category = cm.Media.Category,
Path = cm.Media.Path,
Id = cm.Media.id,
Type = cm.Media.Type,
}).ToList(),
CreationDate = m.CreationDate,
Id = m.id,
IsActive = m.IsActiveString
}).ToList(),
WorkshopId = x.WorkshopId,
TicketNumber = $"TKC_{x.TicketNumber}",
Status = x.Status
}).FirstOrDefault(x => x.Id == id);
query.ResponseViewModels = MergeResponses(query.ClientResponseViewModels, query.AdminResponseViewModels);
return query;
}
public int GetLastTicketNumber()
{
var res = _accountContext.Tickets.Any(x => x.TicketNumber != null) ? _accountContext.Tickets.Max(x => Convert.ToInt32(x.TicketNumber)) : 0;
return res;
}
public AdminResponse GetAdminResponse(long adminResId)
{
return _accountContext.AdminResponses.FirstOrDefault(x => x.id == adminResId);
}
public ClientResponse GetClientResponse(long clientResId)
{
return _accountContext.ClientResponses.FirstOrDefault(x => x.id == clientResId);
}
public void RemoveAdminResponse(long adminResId)
{
var adminRes =_accountContext.AdminResponses.Include(x=>x.AdminResponseMedias).ThenInclude(x=>x.Media).FirstOrDefault(x => x.id == adminResId);
if (adminRes != null)
{
_accountContext.RemoveRange(adminRes.AdminResponseMedias);
_accountContext.Remove(adminRes);
}
}
public List<Response> MergeResponses(List<ClientResponseViewModel> clientResponseList, List<AdminResponseViewModel> adminResponseList)
{
var list = new List<Response>();
var adminList = adminResponseList.Select(x => new Response()
{
TicketId = x.TicketId,
ResponseMessage = x.Response,
IsClient = false,
IsAdmin = true,
IsActive = x.IsActive,
FullName = x.FullName,
CreationDate = x.CreationDate,
CreationDateStr =$"{x.CreationDate.ToFarsi()} {x.CreationDate.DayOfWeek.DayOfWeeKToPersian()} {x.CreationDate.Hour}:{x.CreationDate.Minute}" ,
MediaViewModels = x.MediaViewModels,
AdminResponseId = x.Id,
AdminAccountId = x.AdminAccountId
}).ToList();
var clientList = clientResponseList.Select(x => new Response()
{
TicketId = x.TicketId,
ResponseMessage = x.Response,
IsClient = true,
IsAdmin = false,
CreationDateStr = $"{x.CreationDate.ToFarsi()} {x.CreationDate.DayOfWeek.DayOfWeeKToPersian()} {x.CreationDate.Hour}:{x.CreationDate.Minute}",
CreationDate = x.CreationDate,
MediaViewModels = x.MediaViewModels,
ClientResponseId = x.Id
}).ToList();
list.Capacity = (adminList.Count + clientList.Count);
list.AddRange(adminList);
list.AddRange(clientList);
return list.OrderBy(x => x.CreationDate).ToList();
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CompanyManagment.App.Contracts.Error;
public class ErrorViewModel
{
public bool IsSuccedded { get; set; }
public string WorkshopFullName { get; set; }
public string Message { get; set; }
}

View File

@@ -10,6 +10,12 @@ public interface IHolidayItemApplication
OperationResult Edit(EditHolidayItem command);
EditHolidayItem GetDetails(long id);
List<string> GetHolidayItem(string year);
#region Mahan
bool IsHoliday(DateTime holidayCheck);
#endregion
bool GetHoliday(DateTime holidayCheck);
List<HolidayItemViewModel> Search(HolidayItemSearchModel searchModel);
}

View File

@@ -8,4 +8,24 @@ namespace CompanyManagment.App.Contracts.RollCallEmployee;
public class RollCallEmployeeViewModel : EditRollCallEmployee
{
public string NationalCode { get; set; }
public string ImagePath { get; set; }
// check the contract & checkout
public string PersonName { get; set; }
public bool ContractPerson { get; set; }
public bool InsurancePerson { get; set; }
public long WorkshopId { get; set; }
public long EmployeeId { get; set; }
public bool ContractLeft { get; set; }
public bool InsurancetLeft { get; set; }
public bool Black { get; set; }
public DateTime StartWork { get; set; }
public long PersonelCode { get; set; }
//نحوه محاسبه مزد مرخصی
public string ComputeOptions { get; set; }
//نحوه محاسبه عیدی
public string BonusesOptions { get; set; }
//نحوه محاسبه سنوات
public string YearsOptions { get; set; }
public string EmployeeSlug { get; set; }
}

View File

@@ -13,5 +13,6 @@ namespace CompanyManagment.App.Contracts.Workshop
public long EmployeeId { get; set; }
public string Name { get; set; }
public IFormFile ProfilePhoto { get; set; }
public bool HasPicture { get; set; }
}
}

View File

@@ -49,6 +49,11 @@ public class HolidayItemApplication : IHolidayItemApplication
return _holidayItemRepository.GetHolidayItem(year);
}
public bool IsHoliday(DateTime holidayCheck)
{
return _holidayItemRepository.GetHoliday(holidayCheck);
}
public bool GetHoliday(DateTime holidayCheck)
{
return _holidayItemRepository.GetHoliday(holidayCheck);

View File

@@ -42,7 +42,6 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
string SumWorkeTime = string.Empty;
var weeklyTime = new TimeSpan();
string shift1Hourse = "0";
string shift1Minuts = "0";
string overMandatoryHours = "0";
string overMandatoryMinuts = "0";
string shiftOver22Hours = "0";

View File

@@ -1,6 +1,9 @@
@using System.Reflection.Metadata
@using AccountManagement.Domain.TicketAccessAccountAgg
@using Microsoft.AspNetCore.Mvc.TagHelpers
@*@using _0_Framework.Infrastructure*@
@inject _0_Framework.Application.IAuthHelper AuthHelper;
@inject ITicketAccessAccountRepository TicketAccessAccount;
@{
<style>
@@ -269,7 +272,7 @@
</ul>
</li>
<li class="has_sub" permission="900">
<a class="waves-effect MainMenuItem">
<div class="menuTitle">
@@ -281,26 +284,55 @@
</span>
</a>
<ul class="list-unstyled sdf6">
<li permission="901"><a class="clik6" asp-area="AdminNew" asp-page="/Company/Task/Index">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
</svg>
وظایف
</a></li>
<li permission="903"><a class="clik6" asp-area="AdminNew" asp-page="/Company/Task/Create">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
</svg>
وظیفه جدید
</a></li>
<li permission="902"><a class="clik6" asp-area="AdminNew" asp-page="/Company/Task/Group">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
</svg>
گروهبندی
</a></li>
<li permission="901">
<a class="clik6" asp-area="AdminNew" asp-page="/Company/Task/Index">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
<circle cx="6.5" cy="6.5" r="6.5" fill="white" />
</svg>
وظایف
</a>
</li>
@* <li permission="903"><a class="clik6" asp-area="AdminNew" asp-page="/Company/Task/Create">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
</svg>
وظیفه جدید
</a></li> *@
<li permission="902">
<a class="clik6" asp-area="AdminNew" asp-page="/Company/Task/Group">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
<circle cx="6.5" cy="6.5" r="6.5" fill="white" />
</svg>
گروهبندی
</a>
</li>
</ul>
</li>
@if (TicketAccessAccount.HasTicketAccess(AuthHelper.CurrentAccountId()))
{
<li class="has_sub">
<a class="waves-effect MainMenuItem">
<div class="menuTitle">
<i class="md md-assignment"></i>
<span> مدیریت تیکت </span>
</div>
<span class="pull-right">
<i class="md md-add"></i>
</span>
</a>
<ul class="list-unstyled sdf9">
<li>
<a class="clik9" asp-area="AdminNew" asp-page="/Company/Ticket/Index">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
<circle cx="6.5" cy="6.5" r="6.5" fill="white" />
</svg>
لیست تیکت
</a>
</li>
</ul>
</li>
}
<li class="has_sub" permission="800">
<a class="waves-effect MainMenuItem">

View File

@@ -0,0 +1,469 @@
@page
@model ServiceHost.Areas.AdminNew.Pages.Company.ContractingParties.IndexModel
@{
ViewData["title"] = "- طرف حساب ها";
int i = 1;
string withOutContract = "withOutInstitutionContract";
}
@{string employerList = "";
<link href="~/admintheme/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet" />
<link href="~/AssetsAdminNew/ContractingParties/css/Index.css" rel="stylesheet" />
var selctedOption = "selectedOption";
}
<div class="row p-2">
<div class="col p-0 m-0 d-flex align-items-center justify-content-between">
<div class="col d-flex align-items-center justify-content-start">
<img src="~/AssetsClient/images/checkoutList.png" alt="" class="img-fluid me-2" style="width: 45px;" />
<div>
<h4 class="title d-flex align-items-center">لیست طرف حساب ها</h4>
</div>
</div>
<div>
<div class="d-flex">
<a href="#showmodal=@Url.Page("./Index", "Create")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 addActualEmployer"> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> ایجاد طرف حساب حقیقی </a>
<a permission="10110" href="#showmodal=@Url.Page("./Index", "Create")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 addActualEmployer"> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> ایجاد طرف حساب حقیقی </a>
<a href="#showmodal=@Url.Page("./Index", "InsertLegal")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 addLegalEmployer"> <i class="fa fa-group" style="padding-left: 3px; font-size: 14px; color: #1d92e5 !important "></i> ایجاد طرف حساب حقوقی </a>
<a permission="10111" href="#showmodal=@Url.Page("./Index", "InsertLegal")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 addLegalEmployer"> <i class="fa fa-group" style="padding-left: 3px; font-size: 14px; color: #1d92e5 !important "></i> ایجاد طرف حساب حقوقی </a>
<a asp-page="/Company/Workshop/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
</div>
</div>
</div>
<div class="row px-2">
<div class="search-box card border-0">
<div class="row">
<div class="col-lg-12">
<div permission="10112" class="panel-group panel-group-joined" id="accordion-test">
<h6 class="m-0">
جستجوی طرف حساب
</h6>
<div class="row">
<div class="col-md-12">
<form class="form-inline" role="form" method="get" autocomplete="off">
<div class="form-group col-xs-12">
<div class="row">
<div class="col-lg-4 col-md-6 col-xs-6 pull-right in-containers right-one">
<label class="sr-only"></label>
<input type="hidden" class="sendEmployeeId" asp-for="SearchModel2.id"/>
<input type="hidden" asp-for="SearchModel2.EmployeeName"/>
<input type="search" id="empSearch" value="@Model.LName" class="form-control @{if (!string.IsNullOrWhiteSpace(@Model.LName)){@selctedOption}}" autocomplete="off" placeholder="نام و نام خانوادگی / نام شرکت " style="width: 100%;position: relative">
<div id="emp" class="selectDiv" style="display: none;">
<ul class="searchResult m-t-10" style="list-style-type: none; padding: 5px">
</ul>
</div>
</div>
<div class="col-lg-4 col-md-6 col-xs-6 pull-right in-containers left-one">
<label class="sr-only"></label>
<input type="hidden" class="sendNationalcode" asp-for="SearchModel2.Nationalcode"/>
<input type="search" id="empSearchNationalcode" value="@Model.NationalCode" class="form-control @{if (!string.IsNullOrWhiteSpace(@Model.NationalCode)){@selctedOption}} " autocomplete="off" placeholder=" شماره / شناسه ملی " style="width: 100%;position: relative">
<div id="empNationalcode" class="selectDiv" style="display: none;">
<ul class="searchResultNationalcode m-t-10" style="list-style-type: none; padding: 5px">
</ul>
</div>
</div>
<div class="col-lg-4 col-md-12 col-sm-12 col-xs-12 pull-right in-containers">
<label class="sr-only"></label>
<input type="hidden" class="sendContractingPartyID" asp-for="SearchModel2.RepresentativeId"/>
<input type="hidden" asp-for="SearchModel2.RepresentativeName"/>
<input type="search" id="empSearchContractingPartyID" value="@Model.RepresentativeName" class="form-control @{if (!string.IsNullOrWhiteSpace(@Model.RepresentativeName)){@selctedOption}} " autocomplete="off" placeholder=" معرف " style="width: 100%;position: relative">
<div id="empContractingPartyID" class="selectDiv" style="display: none;">
<ul class="searchResultContractingPartyID m-t-10" style="list-style-type: none; padding: 5px">
</ul>
</div>
</div>
</div>
<hr style=" margin-top: 12px;margin-bottom: 12px;">
<div class="row" style="margin-top: 15px">
<div class="col-lg-8 col-xs-6" style="display: flex;padding-right: 0;">
<label class="sr-only" asp-for="SearchModel2.IsActiveString"></label>
<select id="activing" class="form-control" asp-for="SearchModel2.IsActiveString" style="background-color: #dddddd; border-radius: 25px; border: 1px solid #bfbfbf;">
<option selected="selected" value="true"> فعال </option>
<option value="false"> غیرفعال</option>
<option value="both"> هردو</option>
</select>
<label class="sr-only" asp-for="SearchModel2.IsLegal"></label>
<select class="form-control partyType" asp-for="SearchModel2.IsLegal">
<option value=""> نوع طرف حساب</option>
<option value="حقوقی"> حقوقی</option>
<option value="حقیقی"> حقیقی</option>
</select>
</div>
<div class="col-lg-4 col-xs-6" style="padding-left: 0;">
<a href="#" class="btn btn-searchContractingParties btn-success btn-rounded waves-effect waves-light searchFilter"> <i class="fa fa-search"></i> جستجو</a>
<button id="btnSearch" type="submit" style="display:none">جستجو</button>
<a class="btn btn-info btn-rounded waves-effect waves-light searchAll" asp-page="./Index">حذف فیلتر </a>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row px-lg-2 p-auto">
<div permission="10113" class="wrapper bg-white card border-0 my-2 list-box table-contracts">
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr class="sorting_asc_disabled sorting_desc_disabled">
<th class="sorting_asc_disabled sorting_desc_disabled" style="max-width: 20px;">#</th>
<th style="font-size: 14px !important;max-width:50px;text-align: center;" class="hidden-xs sorting_asc_disabled sorting_desc_disabled">کد طرف حساب</th>
<th style="font-size: 14px !important;max-width: 50px;text-align: center;" class="hidden-xs sorting_asc_disabled sorting_desc_disabled">کد ملی / شناسه ملی</th>
<th class="sorting_asc_disabled sorting_desc_disabled" style="font-size: 14px !important;text-align: center;max-width: 150px;">نام طرف حساب</th>
<th style="font-size: 14px !important;text-align: center;max-width: 500px;" class="hidden-xs sorting_asc_disabled sorting_desc_disabled">نام کارفرما</th>
@*<th>شمارهشناسنامه / شماره ثبت</th>*@
<th class="thh sorting_asc_disabled sorting_desc_disabled" style="display: none"> شماره شناسنامه </th>
<th class="thh sorting_asc_disabled sorting_desc_disabled" style="display: none"> شماره ثبت </th>
<th class="sorting_asc_disabled sorting_desc_disabled" style="font-size: 14px !important;max-width: 40px;">عملیات</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Personals)
{
employerList = "";
<tr class="@{if (@item.HasInstitutionContract != true){@withOutContract}} @(item.IsBlock == "true" ? "bgGray" : "")">
<td style="font-size: 14px !important; text-align: center;">@i </td>
<td style="font-family: 'IranSans' !important; font-size: 14px !important; text-align: center;max-width:80px" class="hidden-xs">
@item.ArchiveCode
</td>
<td style="font-family: 'IranText' !important; font-size: 14px !important; text-align: center;" class="hidden-xs">
@if (item.IsLegal == "حقیقی")
{
@item.Nationalcode
}
else
{
@item.NationalId
}
</td>
<td style="font-family: 'Web_Yekan' !important; text-align: right;" class="name-td">
<span class="ellipsed">
@if (item.IsLegal == "حقیقی")
{
@item.FName
<span>&nbsp;</span>
@item.LName
}
else
{
@item.LName
}
</span>
<div class="tooltipfull-container">
<p class="fulltext">
@if (item.IsLegal == "حقیقی")
{
@item.FName
<span>&nbsp;</span>
@item.LName
}
else
{
@item.LName
}
</p>
<span class="tooltipfull">
@if (item.IsLegal == "حقیقی")
{
@item.FName
<span>&nbsp;</span>
@item.LName
}
else
{
@item.LName
}
</span>
</div>
</td>
<td style="font-family: 'Web_Yekan' !important; text-align: right;" class="name-td hidden-xs">
<span class="ellipsed">
@if (item.EmployerList != null && item.EmployerList.Count > 0)
{
for (int j = 0; j < item.EmployerList.Count; j++)
{
employerList += "<span>" + item.EmployerList[j].FullName + "</span>";
if (j < item.EmployerList.Count - 1)
{
employerList += "<span> - </span>";
}
}
@Html.Raw(employerList)
}
</span>
<div class="tooltipfull-container">
<p class="fulltext">
@if (item.EmployerList != null && item.EmployerList.Count > 0)
{
@Html.Raw(employerList)
}
</p>
<span class="tooltipfull">
@if (item.EmployerList != null && item.EmployerList.Count > 0)
{
if (item.EmployerList.Count > 10)
{
<span>این طرف حساب بیشتر از 10 کارفرما دارد.</span>
}
else
{
@Html.Raw(employerList)
}
}
</span>
</div>
</td>
<td style="font-family: 'IranText' !important; font-size: 14px !important; display: none">@item.IdNumber</td>
<td style="font-family: 'IranText' !important; font-size: 14px !important; display: none">@item.RegisterId</td>
<td>
<div class="operation-td screen-view">
@if (item.IsActiveString == "true")
{
if (item.HasInstitutionContract)
{
<a permission="10114" onclick="removeHasInstitutionContract(@item.id,'@item.HasInstitutionContract',@item.EmployerList.Count())" class="@(item.IsBlock == "true" ? "disabled" : "") btn pull-left btn-danger btn-table">
<i class="fa fa-trash"></i>
</a>
}
else
{
<a permission="10114" onclick="remove(@item.id)" class="@(item.IsBlock == "true" ? "disabled" : "") btn pull-left btn-danger btn-table">
<i class="fa fa-trash"></i>
</a>
}
}
else
{
<a permission="10114" onclick="acitve(@item.id)" class="@(item.IsBlock == "true" ? "disabled" : "") btn pull-left btn-danger btn-table">
<i class="fa fa-rotate-left"></i>
</a>
}
@if (item.IsLegal == "حقیقی")
{
<a class="@(item.IsBlock == "true" ? "disabled" : "") btn btn-warning pull-left rad btn-table" permission="10114" style="margin-left:5px"
href="#showmodal=@Url.Page("./Index", "Edit", new { Id = item.id })">
<i class="fa faSize fa-edit"></i>
</a>
@if (item.IsBlock == "true")
{
<a onclick="disableBlock(@item.id,@item.BlockTimes)" class="btn btn-inverse pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
else if (item.BlockTimes == 2)
{
<a onclick="block(@item.id)" class="btn btn-inverse bgRed pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
else if (item.BlockTimes == 1)
{
<a onclick="block(@item.id)" class="btn btn-inverse bgOrange pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
else if (item.BlockTimes == 0 || item.IsBlock != "true")
{
<a onclick="block(@item.id)" class="btn btn-inverse bgGreen pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
<a class="btn pull-left rad btn-table" permission="10115" style="margin-left:5px;background-color: #176a0c;border: 1px solid #176a0c;color: white;"
href="#showmodal=@Url.Page("./Index", "Details", new { Id = item.id })">
<i class="fa faSize fa-info-circle"></i>
</a>
}
else
{
<a class="@(item.IsBlock == "true" ? "disabled" : "") btn btn-warning pull-left rad btn-table" permission="10114" style="margin-left:5px"
href="#showmodal=@Url.Page("./Index", "LegalEdit", new { Id = item.id })">
<i class="fa faSize fa-edit"></i>
</a>
@if (item.IsBlock == "true")
{
<a onclick="disableBlock(@item.id,@item.BlockTimes)" class="btn btn-inverse pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
else if (item.BlockTimes == 2)
{
<a onclick="block(@item.id)" class="btn btn-inverse bgRed pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
else if (item.BlockTimes == 1)
{
<a onclick="block(@item.id)" class="btn btn-inverse bgOrange pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
else if (item.BlockTimes == 0)
{
<a onclick="block(@item.id)" class="btn btn-inverse bgGreen pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
<a class="btn btn-info pull-left rad btn-table" permission="10115" style="margin-left:5px;background-color: #176a0c;border: 1px solid #176a0c;color: white;"
href="#showmodal=@Url.Page("./Index", "LegalDetails", new { Id = item.id })">
<i class="fa faSize fa-info-circle"></i>
</a>
}
</div>
<div class="flexible-div op-td mobile-view" style="justify-content: flex-end;">
<div class="more-buttons flexible-div">
<a class="btn pull-left rad employee-operations"><i class="fa fa-bars" aria-hidden="true"></i> </a>
<div class="buttons-container">
@if (item.IsLegal == "حقیقی")
{
<a class="btn pull-left rad btn-table" permission="10115" style="margin-left:5px;background-color: #176a0c;border: 1px solid #176a0c;color: white;"
href="#showmodal=@Url.Page("./Index", "Details", new { Id = item.id })">
<i class="fa faSize fa-info-circle"></i>
</a>
@if (item.IsBlock == "true")
{
<a onclick="disableBlock(@item.id,@item.BlockTimes)" class="btn btn-inverse pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
else if (item.BlockTimes == 2)
{
<a onclick="block(@item.id)" class="btn btn-inverse bgRed pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
else if (item.BlockTimes == 1)
{
<a onclick="block(@item.id)" class="btn btn-inverse bgOrange pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
else if (item.BlockTimes == 0 || item.IsBlock != "true")
{
<a onclick="block(@item.id)" class="btn btn-inverse bgGreen pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
<a class="btn btn-warning pull-left rad btn-table @(item.IsBlock == "true" ? "disabled" : "")" permission="10114" style="margin-left:5px"
href="#showmodal=@Url.Page("./Index", "Edit", new { Id = item.id })">
<i class="fa faSize fa-edit"></i>
</a>
}
else
{
<a class="btn btn-info pull-left rad btn-table" permission="10115" style="margin-left:5px;background-color: #176a0c;border: 1px solid #176a0c;color: white;"
href="#showmodal=@Url.Page("./Index", "LegalDetails", new { Id = item.id })">
<i class="fa faSize fa-info-circle"></i>
</a>
@if (item.IsBlock == "true")
{
<a onclick="disableBlock(@item.id,@item.BlockTimes)" class="btn btn-inverse pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
else if (item.BlockTimes == 2)
{
<a onclick="block(@item.id)" class="btn btn-inverse bgRed pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
else if (item.BlockTimes == 1)
{
<a onclick="block(@item.id)" class="btn btn-inverse bgOrange pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
else if (item.BlockTimes == 0)
{
<a onclick="block(@item.id)" class="btn btn-inverse bgGreen pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
<span class="blockCount">@item.BlockTimes</span>
<i class="fa fa-minus-circle"></i>
</a>
}
<a class="btn btn-warning pull-left rad btn-table" permission="10114" style="margin-left:5px"
href="#showmodal=@Url.Page("./Index", "LegalEdit", new { Id = item.id })">
<i class="fa faSize fa-edit"></i>
</a>
}
@if (item.IsActiveString == "true")
{
if (item.HasInstitutionContract)
{
<a permission="10114" onclick="removeHasInstitutionContract(@item.id,'@item.HasInstitutionContract',@item.EmployerList.Count())" class="@(item.IsBlock == "true" ? "disabled" : "") btn pull-left btn-danger btn-table">
<i class="fa fa-trash"></i>
</a>
}
else
{
<a permission="10114" onclick="remove(@item.id)" class="@(item.IsBlock == "true" ? "disabled" : "") btn pull-left btn-danger btn-table">
<i class="fa fa-trash"></i>
</a>
}
}
else
{
<a permission="10114" onclick="acitve(@item.id)" class="@(item.IsBlock == "true" ? "disabled" : "") btn pull-left btn-danger btn-table">
<i class="fa fa-rotate-left"></i>
</a>
}
</div>
</div>
</div>
</td>
</tr>
{
i++;
}
}
</tbody>
</table>
</div>
</div>
@section Script {
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
<script src="~/lib/select2/js/select2.js"></script>
<script src="~/lib/select2/js/i18n/fa.js"></script>
<script src="~/admintheme/assets/sweet-alert/sweet-alert.min.js"></script>
<script src="~/AssetsAdminNew/ContractingParties/js/Index.js"></script>
}

View File

@@ -0,0 +1,239 @@
using _0_Framework.Application;
using Company.Domain.ContarctingPartyAgg;
using CompanyManagment.App.Contracts.InstitutionContract;
using CompanyManagment.App.Contracts.PersonalContractingParty;
using CompanyManagment.App.Contracts.Representative;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Diagnostics.CodeAnalysis;
namespace ServiceHost.Areas.AdminNew.Pages.Company.ContractingParties
{
[Authorize]
public class IndexModel : PageModel
{
public PersonalContractingPartySearchModel SearchModel2;
public List<PersonalContractingPartyViewModel> Personals;
public List<CreatePersonalContractingParty> PersonCreate;
public string LName;
public string NationalCode;
public string RepresentativeName;
private readonly IPersonalContractingPartyApp _personalContractingPartyApp;
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository;
private readonly IRepresentativeApplication _representativeApplication;
public IndexModel(IPersonalContractingPartyApp personalContractingPartyApp, IPersonalContractingPartyRepository personalContractingPartyRepository, IRepresentativeApplication representativeApplication, IInstitutionContractApplication institutionContract)
{
_personalContractingPartyApp = personalContractingPartyApp;
_personalContractingPartyRepository = personalContractingPartyRepository;
_representativeApplication = representativeApplication;
}
public void OnGet(PersonalContractingPartySearchModel searchModel2)
{
if (searchModel2.IsActiveString == null)
{
searchModel2.IsActiveString = "true";
}
Personals = _personalContractingPartyApp.SearchForMain(searchModel2).OrderByDescending(x => x.IsBlock == "true").ThenBy(x => x.HasInstitutionContract).ToList();
if (!string.IsNullOrEmpty(searchModel2.Nationalcode) && searchModel2.Nationalcode.Length == 10)
{
NationalCode = Personals.Select(x => x.Nationalcode).FirstOrDefault();
}
else
{
NationalCode = searchModel2.Nationalcode;
}
if (searchModel2.id > 0)
{
var personnel = Personals.FirstOrDefault(x => x.id == searchModel2.id);
if (personnel != null)
LName = (personnel.IsLegal == "?????" ? (personnel.FName + " " + personnel.LName) : personnel.LName);
}
else
{
LName = searchModel2.EmployeeName;
}
if (searchModel2.RepresentativeId > 0)
{
var representative = _representativeApplication.GetDetails(searchModel2.RepresentativeId);
RepresentativeName = representative.FullName;
}
else
{
RepresentativeName = searchModel2.RepresentativeName;
}
}
public IActionResult OnGetCreate()
{
var command = new CreatePersonalContractingParty()
{
RepresentativeViewModels = _representativeApplication.GetRepresentatives(),
ArchiveCode = _personalContractingPartyApp.GetLastArchiveCode(),
};
return Partial("./Create", command);
}
public IActionResult OnGetInsertLegal()
{
var command = new CreatePersonalContractingParty()
{
RepresentativeViewModels = _representativeApplication.GetRepresentatives(),
ArchiveCode = _personalContractingPartyApp.GetLastArchiveCode(),
};
return Partial("./InsertLegal", command);
}
public IActionResult OnPostCreate(CreatePersonalContractingParty command)
{
command.NationalId = !string.IsNullOrWhiteSpace(command.NationalId) ? command.NationalId.ConvertToEnglish() : "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
command.Nationalcode = command.Nationalcode.ConvertToEnglish();
var result = _personalContractingPartyApp.Create(command);
return new JsonResult(result);
}
public IActionResult OnPostInsertLegal(CreatePersonalContractingParty command)
{
command.NationalId = command.NationalId.ConvertToEnglish();
command.RegisterId = command.RegisterId.ConvertToEnglish();
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
var result2 = _personalContractingPartyApp.CreateLegals(command);
return new JsonResult(result2);
}
public IActionResult OnGetEdit(long id)
{
var productCategory = _personalContractingPartyApp.GetDetailsToEdit(id);
productCategory.HasContract = _personalContractingPartyApp.GetHasContract(id);
productCategory.RepresentativeViewModels = _representativeApplication.GetRepresentatives();
return Partial("Edit", productCategory);
}
public IActionResult OnGetLegalEdit(long id)
{
var legaly = _personalContractingPartyApp.GetDetailsToEdit(id);
legaly.HasContract = _personalContractingPartyApp.GetHasContract(id);
legaly.RepresentativeViewModels = _representativeApplication.GetRepresentatives();
return Partial("LegalEdit", legaly);
}
public JsonResult OnPostEdit(EditPersonalContractingParty command)
{
if (ModelState.IsValid)
{
}
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
command.NationalId = !string.IsNullOrWhiteSpace(command.NationalId) ? command.NationalId.ConvertToEnglish() : "";
command.Nationalcode = command.Nationalcode.ConvertToEnglish();
var result = _personalContractingPartyApp.Edit(command);
return new JsonResult(result);
}
public JsonResult OnPostLegalEdit(EditPersonalContractingParty command)
{
if (ModelState.IsValid)
{
}
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
command.NationalId = command.NationalId.ConvertToEnglish();
command.RegisterId = command.RegisterId.ConvertToEnglish();
var result = _personalContractingPartyApp.EditLegal(command);
return new JsonResult(result);
}
public IActionResult OnGetDetails(long id)
{
var productCategory = _personalContractingPartyApp.GetDetails(id);
return Partial("Details", productCategory);
}
public IActionResult OnGetLegalDetails(long id)
{
var legaldetails = _personalContractingPartyApp.GetDetails(id);
return Partial("LegalDetails", legaldetails);
}
#region NewByHeydari
public IActionResult OnGetRepresentativeList(string searchText)
{
var result = _representativeApplication.GetRepresentativeListForSearchText(searchText);
result = result.OrderBy(x => x.FullName.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
public IActionResult OnGetPersonalContractingPartyNationalcode(string searchText)
{
var result = _personalContractingPartyApp.GetPersonalContractingPartiesForNationalcode(searchText);
result = result.OrderBy(x => x.Nationalcode.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
[SuppressMessage("ReSharper.DPA", "DPA0007: Large number of DB records", MessageId = "count: 276")]
public IActionResult OnGetContractPartyList(string searchText)
{
var res = _personalContractingPartyApp.GetPersonalContractingParties().OrderBy(x => x.FullName).ToList();
var result = res.Select(x => new PersonalContractingPartyViewModel()
{
id = x.id,
LName = x.LName,
FullName = x.FullName,
});
result = result.Where(x => x.FullName.Contains(searchText));
result = result.OrderBy(x => x.FullName.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
public IActionResult OnPostDeletePersonalContractingParties(long id)
{
var result = _personalContractingPartyApp.DeletePersonalContractingParties(id);
return new JsonResult(result);
}
public IActionResult OnPostActivePersonalContractingParties(long id)
{
var result = _personalContractingPartyApp.Active(id);
return new JsonResult(result);
}
public IActionResult OnPostBlockPersonalContractingParties(long id)
{
var result = _personalContractingPartyApp.Block(id);
return new JsonResult(result);
}
public IActionResult OnPostDisableBlockPersonalContractingParties(long id)
{
var result = _personalContractingPartyApp.DisableBlock(id);
return new JsonResult(result);
}
public IActionResult OnPostCheckHasContract(long id)
{
bool hasContract = _personalContractingPartyApp.GetHasContract(id);
if (hasContract)
return new JsonResult(new { isSuccedded = false, message = "" });
else
return new JsonResult(new { isSuccedded = true, message = "", });
}
#endregion
}
}

View File

@@ -0,0 +1,4 @@
@page
@model ServiceHost.Areas.AdminNew.Pages.Company.Employees.IndexModel
@{
}

View File

@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ServiceHost.Areas.AdminNew.Pages.Company.Employees
{
public class IndexModel : PageModel
{
public void OnGet()
{
}
}
}

View File

@@ -0,0 +1,153 @@
@page
@model ServiceHost.Areas.AdminNew.Pages.Company.Employers.IndexModel
@{
}
@{
//string colaps = "in";
//string act = "active";
int i = 1;
string withOutContractingParty = "withOutContractingParty";
}
@{
var selctedOption = "selectedOption";
string workshopList = "";
Layout = "Shared/_Layout";
ViewData["title"] = "کارفرما";
}
@section Styles
{
<link href="~/AssetsAdminNew/employers/css/index.css" rel="stylesheet" />
<link href="@Href("~/admintheme/css/moreBtnsPopup.css")" rel="stylesheet" />
}
<div class="row p-2">
<div class="col p-0 m-0 d-flex align-items-center justify-content-between">
<div class="col d-flex align-items-center justify-content-start">
<img src="~/AssetsClient/images/checkoutList.png" alt="" class="img-fluid me-2" style="width: 45px;" />
<div>
<h4 class="title d-flex align-items-center">لیست کارفرماها</h4>
</div>
</div>
<div>
<div class="d-flex">
<a permission="10210" href="#showmodal=@Url.Page("./Index", "Create")" class="btn btn-success waves-effect waves-light m-b-5 addActualEmployer"> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> ایجاد کارفرمای حقیقی </a>
<a href="#showmodal=@Url.Page("./Index", "Create")" class="addActualEmployer"> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> ایجاد کارفرمای حقیقی </a>
<a permission="10211" href="#showmodal=@Url.Page("./Index", "InsertLegal")" class="btn btn-success waves-effect waves-light m-b-5 addLegalEmployer"> <i class="fa fa-group" style="padding-left: 3px; font-size: 14px; color: #1d92e5 !important "></i> ایجاد کارفرمای حقوقی </a>
<a href="#showmodal=@Url.Page("./Index", "InsertLegal")" class="addLegalEmployer"> <i class="fa fa-group" style="padding-left: 3px; font-size: 14px; color: #1d92e5 !important "></i> ایجاد کارفرمای حقوقی </a>
<a asp-page="/Company/Workshop/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
</div>
</div>
</div>
<div class="row px-2">
<div class="search-box card border-0">
<div class="row">
<div class="col-lg-12">
<div permission="10212" class="panel-group panel-group-joined" id="accordion-test">
<h6 class="m-0">
جستجوی کارفرما
</h6>
<div class="row">
<div class="col-md-12">
<form class="form-inline" role="form" method="get" autocomplete="off">
<div class="form-group col-xs-12">
<div class="row">
<div class="col-md-3 col-sm-6 col-xs-6 pull-right right-one" style="height: 40px">
<input type="hidden" class="sendEmployeeId" asp-for="SearchModel.Id" />
<input type="hidden" asp-for="SearchModel.EmployerLName" />
<input type="search" id="empSearch" value="@Model.LName" class="form-control @{
if(!string.IsNullOrWhiteSpace(@Model.LName)){
@selctedOption
}
}" autocomplete="off" placeholder="نام و نام خانوادگی / نام شرکت " style="width: 100%;position: relative">
<div id="emp" class="selectDiv" style="display: none;">
<ul class="searchResult m-t-10" style="list-style-type: none; padding: 5px">
</ul>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-6 pull-right left-one" style="height: 40px">
<label class="sr-only" asp-for="SearchModel.Nationalcode"></label>
@* <input class="form-control inpt" asp-for="SearchModel.Nationalcode" placeholder="کد ملی / شناسه ملی " style="width: 100%;margin-bottom: 5px;"> *@
<input type="hidden" class="sendNationalcode" asp-for="SearchModel.Nationalcode" placeholder="کد ملی / شناسه ملی " style="width: 100%;margin-bottom: 5px;" />
<input type="search" id="empSearchNationalcode" value="@Model.Nationalcode" class="form-control @{
if(!string.IsNullOrWhiteSpace(@Model.Nationalcode)){
@selctedOption
}
} " autocomplete="off" placeholder=" کد ملی / شناسه ملی " style="width: 100%;position: relative">
<div id="empNationalcode" class="selectDiv" style="display: none;">
<ul class="searchResultNationalcode m-t-10" style="list-style-type: none; padding: 5px">
</ul>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-6 pull-right right-one" style="height: 40px">
<label class="sr-only" asp-for="SearchModel.IdNumber"></label>
<input type="hidden" class="sendIdNumber" asp-for="SearchModel.IdNumber" placeholder="کد ملی / شناسه ملی " style="width: 100%;margin-bottom: 5px;" />
<input type="search" id="empSearchIdNumber" value="@Model.IdNumber" class="form-control @{
if(!string.IsNullOrWhiteSpace(@Model.IdNumber)){
@selctedOption
}
} " autocomplete="off" placeholder=" شماره شناسنامه / شماره ثبت " style="width: 100%;position: relative">
<div id="empIdNumber" class="selectDiv" style="display: none;">
<ul class="searchResultIdNumber m-t-10" style="list-style-type: none; padding: 5px">
</ul>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-6 pull-right left-one">
<label class="sr-only"></label>
<input type="hidden" class="sendContractingPartyID" asp-for="SearchModel.ContractingPartyID" />
<input type="hidden" asp-for="SearchModel.ContactingPartyName" />
<input type="search" id="empSearchContractingPartyID" value="@Model.ContactingPartyName" class="form-control @{
if(!string.IsNullOrWhiteSpace(@Model.ContactingPartyName)){
@selctedOption
}
} " autocomplete="off" placeholder=" طرف حساب " style="width: 100%; margin-bottom:5px;">
<div id="empContractingPartyID" class="selectDiv" style="display: none;">
<ul class="searchResultContractingPartyID m-t-10" style="list-style-type: none; padding: 5px">
</ul>
</div>
</div>
</div>
<hr style=" margin-top: 12px;margin-bottom: 12px;">
<div class="row" style="margin-top: 15px">
<div class="col-lg-9 col-xs-6" style="display: flex;padding-right: 0;">
<label class="sr-only" asp-for="SearchModel.Address"></label>
<select id="activing" class="form-control" asp-for="SearchModel.Address" style="background-color: #dddddd; border-radius: 25px; border: 1px solid #bfbfbf;">
<option value=""> فعال </option>
<option value="false"> غیرفعال</option>
<option value="both"> هردو</option>
</select>
<label class="sr-only" asp-for="SearchModel.IsLegal"></label>
<select class="form-control employerType" asp-for="SearchModel.IsLegal" style="background-color: #dddddd; border-radius: 25px; border: 1px solid #bfbfbf;">
<option value=""> نوع کارفرما</option>
<option value="حقوقی"> حقوقی</option>
<option value="حقیقی"> حقیقی</option>
</select>
</div>
<div class="col-lg-3 col-xs-6" style="padding-left: 0;">
<a href="#" class="btn btn-success btn-searchEmployer btn-rounded waves-effect waves-light searchOne"> <i class="fa fa-search"></i> جستجو</a>
<button id="btnSearch" type="submit" style="display:none"> جستجو</button>
<a class="btn btn-info btn-rounded waves-effect waves-light searchAll" asp-page="./Index"> حذف فیلتر</a>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,259 @@
using _0_Framework.Application;
using Company.Domain.ContarctingPartyAgg;
using CompanyManagment.App.Contracts.Employer;
using CompanyManagment.App.Contracts.PersonalContractingParty;
using CompanyManagment.App.Contracts.Workshop;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace ServiceHost.Areas.AdminNew.Pages.Company.Employers
{
[Authorize]
public class IndexModel : PageModel
{
[TempData]
public string Message { get; set; }
public EmployerSearchModel SearchModel;
public List<EmployerViewModel> Employers;
public SelectList ContactingParties;
public string ContactingPartyName;
public string Nationalcode;
public string IdNumber;
public string LName;
private readonly IEmployerApplication _employerApplication;
private readonly IWorkshopApplication _workshopApplication;
private readonly IPersonalContractingPartyApp _personalContractingPartyApp;
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository2;
public IndexModel(IEmployerApplication employerApplication, IPersonalContractingPartyApp personalContractingPartyApp, IPersonalContractingPartyRepository personalContractingPartyRepository, IWorkshopApplication workshopApplication)
{
_employerApplication = employerApplication;
_personalContractingPartyApp = personalContractingPartyApp;
_personalContractingPartyRepository2 = personalContractingPartyRepository;
_workshopApplication = workshopApplication;
}
public void OnGet(EmployerSearchModel searchModel)
{
ContactingParties = new SelectList(_personalContractingPartyApp.GetPersonalContractingParties(), "id", "LName");
Employers = _employerApplication.Search(searchModel).OrderByDescending(x => x.HasBlockContractingParty == true).ThenByDescending(x => x.HasContractingParty).ToList();
//-----FName or LName-----
if (searchModel.Id > 0)
{
var employer = Employers.FirstOrDefault(x => x.Id == searchModel.Id);
if (employer != null)
LName = (employer.IsLegal == "?????" ? (employer.FName + " " + employer.LName) : employer.LName);
}
else
{
LName = searchModel.EmployerLName;
}
//-----RegisterId or IdNumber-----
if (!string.IsNullOrEmpty(searchModel.IdNumber))
{
IdNumber = searchModel.IdNumber;
}
//-----Nationalcode or NationalId-----
if (!string.IsNullOrEmpty(searchModel.Nationalcode))
{
Nationalcode = searchModel.Nationalcode;
}
//-----ContractingParty-----
if (searchModel.ContractingPartyID > 0)
{
var representative = _personalContractingPartyApp.GetDetails(searchModel.ContractingPartyID);
ContactingPartyName = representative.FullName;
}
else
{
ContactingPartyName = searchModel.ContactingPartyName;
}
}
public IActionResult OnGetCreate()
{
var command = new CreateEmployer
{
ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties()
};
return Partial("./Create", command);
}
public IActionResult OnGetInsertLegal()
{
var command = new CreateEmployer
{
ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties()
};
return Partial("./InsertLegal", command);
}
public IActionResult OnPostCreate(CreateEmployer command)
{
//var personalContractingParty = _personalContractingPartyRepository2.Get(command.ContractingPartyId);
//personalContractingParty.Edit2( "test");
command.IdNumber = !string.IsNullOrWhiteSpace(command.IdNumber) ? command.IdNumber.ConvertToEnglish() : "";
command.Nationalcode = !string.IsNullOrWhiteSpace(command.Nationalcode) ? command.Nationalcode.ConvertToEnglish() : "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
var result = _employerApplication.Create(command);
return new JsonResult(result);
}
public IActionResult OnPostInsertLegal(CreateEmployer command)
{
command.RegisterId = !string.IsNullOrWhiteSpace(command.RegisterId) ? command.RegisterId.ConvertToEnglish() : "";
command.NationalId = !string.IsNullOrWhiteSpace(command.NationalId) ? command.NationalId.ConvertToEnglish() : "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
var result2 = _employerApplication.CreateLegals(command);
return new JsonResult(result2);
}
public IActionResult OnGetEdit(long id)
{
var employer = _employerApplication.GetDetails(id);
employer.ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties();
var ids = new List<long>() { id };
employer.HasWorkshop = _workshopApplication.GetWorkshopsByEmployerId(ids).Count() > 0 ? true : false;
return Partial("Edit", employer);
}
public IActionResult OnGetLegalEdit(long id)
{
var employerlegaly = _employerApplication.GetDetails(id);
employerlegaly.ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties();
var ids = new List<long>() { id };
employerlegaly.HasWorkshop = _workshopApplication.GetWorkshopsByEmployerId(ids).Count() > 0 ? true : false;
return Partial("LegalEdit", employerlegaly);
}
public JsonResult OnPostEdit(EditEmployer command)
{
if (ModelState.IsValid)
{
}
command.IdNumber = !string.IsNullOrWhiteSpace(command.IdNumber) ? command.IdNumber.ConvertToEnglish() : "";
command.Nationalcode = !string.IsNullOrWhiteSpace(command.Nationalcode) ? command.Nationalcode.ConvertToEnglish() : "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
var result = _employerApplication.Edit(command);
return new JsonResult(result);
}
public JsonResult OnPostLegalEdit(EditEmployer command)
{
if (ModelState.IsValid)
{
}
command.RegisterId = !string.IsNullOrWhiteSpace(command.RegisterId) ? command.RegisterId.ConvertToEnglish() : "";
command.NationalId = !string.IsNullOrWhiteSpace(command.NationalId) ? command.NationalId.ConvertToEnglish() : "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
var result = _employerApplication.EditLegal(command);
return new JsonResult(result);
}
public IActionResult OnGetDetails(long id)
{
var emp = _employerApplication.GetDetails(id);
emp.ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties();
return Partial("Details", emp);
}
public IActionResult OnGetLegalDetails(long id)
{
var legaldetails = _employerApplication.GetDetails(id);
legaldetails.ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties();
return Partial("LegalDetails", legaldetails);
}
public IActionResult OnGetDeActive(long id)
{
var result = _employerApplication.DeActive(id);
if (result.IsSuccedded)
return RedirectToPage("./Index");
Message = result.Message;
return RedirectToPage("./Index");
}
public IActionResult OnGetIsActive(long id)
{
var result = _employerApplication.Active(id);
if (result.IsSuccedded)
return RedirectToPage("./Index");
Message = result.Message;
return RedirectToPage("./Index");
}
#region NewByHeydari
public IActionResult OnPostDeleteEmployer(long id)
{
var result = _employerApplication.DeleteEmployer(id);
return new JsonResult(result);
}
public IActionResult OnPostActiveEmployer(long id)
{
var result = _employerApplication.ActiveAll(id);
return new JsonResult(result);
}
public IActionResult OnGetContractPartyList(string searchText)
{
var res = _personalContractingPartyApp.GetPersonalContractingParties();
var result = res.Where(x => x.LName.Contains(searchText)).Take(200).ToList();
result = result.OrderBy(x => x.LName.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
public IActionResult OnGetEmployerNationalcode(string searchText)
{
var result = _employerApplication.GetEmployerWithNationalcodeOrNationalId(searchText);
result = result.OrderBy(x => x.Nationalcode.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
public IActionResult OnGetEmployerIdNumber(string searchText)
{
var result = _employerApplication.GetEmployerWithIdNumberOrRegisterId(searchText);
result = result.OrderBy(x => x.IdNumber.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
public IActionResult OnGetEmployerName(string searchText)
{
var result = _employerApplication.GetEmployerWithFNameOrLName(searchText);
result = result.OrderBy(x => x.LName.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
#endregion
}
}

View File

@@ -0,0 +1,88 @@
@page
@model ServiceHost.Areas.AdminNew.Pages.Company.RollCall.IndexModel
@{
}
<div class="row">
<div class="col-12">
<h6 class="mb-3">مدیریت حضور و غیاب</h6>
<div class="card mb-2">
<div class=" d-flex align-items-center justify-content-between">
<div class="d-flex align-items-center">
<div class="card-title">موسسه حقوقی نور دادمهر گستر کاسپین</div>
</div>
<div class="d-flex align-items-center">
<button>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.19194 13.3081C4.07473 13.1908 3.91576 13.125 3.75 13.125C3.58424 13.125 3.42527 13.1908 3.30806 13.3081C3.19085 13.4253 3.125 13.5842 3.125 13.75C3.125 13.9158 3.19085 14.0747 3.30806 14.1919L5.80806 16.6919C5.92527 16.8092 6.08424 16.875 6.25 16.875C6.41576 16.875 6.57473 16.8092 6.69194 16.6919L9.19171 14.1922C9.30892 14.075 9.375 13.9158 9.375 13.75C9.375 13.5842 9.30915 13.4253 9.19194 13.3081C9.07473 13.1908 8.91576 13.125 8.75 13.125C8.58424 13.125 8.42527 13.1908 8.30806 13.3081L6.25 15.3661L4.19194 13.3081Z" fill="white" />
<path d="M5.625 3.75V16.25C5.625 16.5952 5.90482 16.875 6.25 16.875C6.59518 16.875 6.875 16.5952 6.875 16.25V3.75C6.875 3.40482 6.59518 3.125 6.25 3.125C5.90482 3.125 5.625 3.40482 5.625 3.75Z" fill="white" />
<path d="M15.8077 6.69162C15.9249 6.80883 16.0842 6.875 16.25 6.875C16.4158 6.875 16.5747 6.80915 16.6919 6.69194C16.8092 6.57473 16.875 6.41576 16.875 6.25C16.875 6.08424 16.8092 5.92527 16.6919 5.80806L14.1919 3.30806C14.0747 3.19085 13.9158 3.125 13.75 3.125C13.5842 3.125 13.4253 3.19085 13.3081 3.30806L10.8081 5.80806C10.6908 5.92527 10.625 6.08424 10.625 6.25C10.625 6.26001 10.6252 6.27002 10.6257 6.28002C10.6332 6.43522 10.6982 6.58207 10.8081 6.69194C10.9253 6.80915 11.0842 6.875 11.25 6.875C11.4158 6.875 11.5747 6.80915 11.6919 6.69194L13.75 4.63388L15.8077 6.69162Z" fill="white" />
<path d="M14.375 16.25V3.75C14.375 3.40482 14.0952 3.125 13.75 3.125C13.4048 3.125 13.125 3.40482 13.125 3.75V16.25C13.125 16.5952 13.4048 16.875 13.75 16.875C14.0952 16.875 14.375 16.5952 14.375 16.25Z" fill="white" />
</svg>
</button>
<button>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.625 10C15.625 10.1658 15.5592 10.3247 15.4419 10.4419C15.3247 10.5592 15.1658 10.625 15 10.625H5C4.83424 10.625 4.67527 10.5592 4.55806 10.4419C4.44085 10.3247 4.375 10.1658 4.375 10C4.375 9.83424 4.44085 9.67527 4.55806 9.55806C4.67527 9.44085 4.83424 9.375 5 9.375H15C15.1658 9.375 15.3247 9.44085 15.4419 9.55806C15.5592 9.67527 15.625 9.83424 15.625 10ZM18.125 5.625H1.875C1.70924 5.625 1.55027 5.69085 1.43306 5.80806C1.31585 5.92527 1.25 6.08424 1.25 6.25C1.25 6.41576 1.31585 6.57473 1.43306 6.69194C1.55027 6.80915 1.70924 6.875 1.875 6.875H18.125C18.2908 6.875 18.4497 6.80915 18.5669 6.69194C18.6842 6.57473 18.75 6.41576 18.75 6.25C18.75 6.08424 18.6842 5.92527 18.5669 5.80806C18.4497 5.69085 18.2908 5.625 18.125 5.625ZM11.875 13.125H8.125C7.95924 13.125 7.80027 13.1908 7.68306 13.3081C7.56585 13.4253 7.5 13.5842 7.5 13.75C7.5 13.9158 7.56585 14.0747 7.68306 14.1919C7.80027 14.3092 7.95924 14.375 8.125 14.375H11.875C12.0408 14.375 12.1997 14.3092 12.3169 14.1919C12.4342 14.0747 12.5 13.9158 12.5 13.75C12.5 13.5842 12.4342 13.4253 12.3169 13.3081C12.1997 13.1908 12.0408 13.125 11.875 13.125Z" fill="white" />
</svg>
</button>
<button>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.625 4.375C10.625 4.02982 10.3452 3.75 10 3.75C9.65482 3.75 9.375 4.02982 9.375 4.375V9.375H4.375C4.02982 9.375 3.75 9.65482 3.75 10C3.75 10.3452 4.02982 10.625 4.375 10.625H9.375V15.625C9.375 15.9702 9.65482 16.25 10 16.25C10.3452 16.25 10.625 15.9702 10.625 15.625V10.625H15.625C15.9702 10.625 16.25 10.3452 16.25 10C16.25 9.65482 15.9702 9.375 15.625 9.375H10.625V4.375Z" fill="white" />
</svg>
</button>
<div class="search-table position-relative">
<input type="text" class="border-0" placeholder="جستجو">
<button class="position-absolute end-0 p-1">
<svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.35 14.3563C14.2566 14.4483 14.131 14.4999 14 14.5001C13.8672 14.4995 13.7397 14.4481 13.6437 14.3563L10.9437 11.6501C9.80659 12.6052 8.34462 13.0845 6.86273 12.9879C5.38083 12.8913 3.99343 12.2264 2.98988 11.1317C1.98633 10.0371 1.44412 8.59729 1.47633 7.1126C1.50855 5.62791 2.11269 4.21298 3.16277 3.1629C4.21286 2.11282 5.62779 1.50867 7.11248 1.47645C8.59717 1.44424 10.037 1.98645 11.1316 2.99C12.2263 3.99355 12.8912 5.38095 12.9878 6.86285C13.0844 8.34474 12.6051 9.80671 11.65 10.9438L14.35 13.6438C14.3972 13.6904 14.4347 13.7458 14.4603 13.807C14.486 13.8681 14.4991 13.9338 14.4991 14.0001C14.4991 14.0664 14.486 14.132 14.4603 14.1932C14.4347 14.2544 14.3972 14.3098 14.35 14.3563ZM7.24997 12.0001C8.18944 12.0001 9.1078 11.7215 9.88893 11.1996C10.6701 10.6776 11.2789 9.93579 11.6384 9.06784C11.9979 8.19989 12.092 7.24483 11.9087 6.32342C11.7254 5.40201 11.273 4.55564 10.6087 3.89134C9.94443 3.22704 9.09806 2.77465 8.17665 2.59137C7.25524 2.40809 6.30018 2.50215 5.43223 2.86167C4.56428 3.22119 3.82243 3.83001 3.30049 4.61114C2.77856 5.39227 2.49997 6.31064 2.49997 7.2501C2.50163 8.50937 3.0026 9.71659 3.89304 10.607C4.78348 11.4975 5.9907 11.9984 7.24997 12.0001Z" fill="white" />
</svg>
</button>
</div>
</div>
</div>
</div>
<div class="card p-0">
<div class="">
<div class="w-100">
<table class="table table-hover table-transparent">
<thead>
<tr>
<th scope="col">ردیف</th>
<th scope="col">نام پرسنل</th>
<th scope="col">شماره پرسنلی</th>
<th scope="col">ساعت ورود</th>
<th scope="col">ساعت خروج</th>
</tr>
</thead>
<tbody>
<tr>
<td scope="row">1</td>
<td>سعید اسلامی</td>
<td>1</td>
<td>08:00</td>
<td>16:30</td>
</tr>
<tr>
<td scope="row">1</td>
<td>سعید اسلامی</td>
<td>1</td>
<td>08:00</td>
<td>16:30</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ServiceHost.Areas.AdminNew.Pages.Company.RollCall
{
public class IndexModel : PageModel
{
public void OnGet()
{
}
}
}

View File

@@ -10,7 +10,8 @@
@section Styles {
<link href="~/assetsadminnew/tasks/css/task-manager-create.css?ver=@Version.AdminVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/select2.css?ver=@Version.AdminVersion" rel="stylesheet" />
<link href="~/assetsadminnew/tasks/css/create.css?ver=@Version.AdminVersion" rel="stylesheet" />
<link href="~/assetsadminnew/tasks/css/create.css?ver=@Version.AdminVersion" rel="stylesheet" />
<link href="~/assetsadminnew/libs/sweetalert2/sweetalert2.min.css" rel="stylesheet" />
}
@@ -82,34 +83,34 @@
<div class="col-12 col-lg-6 col-xl-4">
<div class="from-group position-relative">
<input type="text" asp-for="Command.ContractingPartyName" id="partyNameSearch" class="form-control" autocomplete="off" placeholder="طرف حساب" onkeyup="searchPartyNameTask()">
<div id="partyName" class="selectDiv">
<div id="partyName" class="selectDiv" style="display: none;">
<ul class="searchResult" id="searchResult">
</ul>
</div>
</div>
<div class="from-group my-1 position-relative">
<input type="text" asp-for="Command.Title" class="form-control m-0 TaskTitleSearch" placeholder="عنوان وظیفه" onkeyup="searchSubjectTask()">
<div permission="90313" class="position-absolute" style="top: 3px; left:3px; cursor: pointer;" onclick="taskSubjectModal()">
<div class="btn-add2">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 6L12 18" stroke="#ffffff" stroke-width="2" stroke-linecap="round" />
<path d="M18 12L6 12" stroke="#ffffff" stroke-width="2" stroke-linecap="round" />
</svg>
</div>
</div>
<div id="TaskTitle" class="selectTitleDiv">
<div permission="90313" class="position-absolute" style="top: 3px; left:3px; cursor: pointer;" onclick="taskSubjectModal()">
<div class="btn-add2">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 6L12 18" stroke="#ffffff" stroke-width="2" stroke-linecap="round" />
<path d="M18 12L6 12" stroke="#ffffff" stroke-width="2" stroke-linecap="round" />
</svg>
</div>
</div>
<div id="TaskTitle" class="selectTitleDiv" style="display: none;">
<ul id="searchTitleResult" class="searchTitleResult">
</ul>
</div>
</ul>
</div>
</div>
</div>
<div class="col-12 col-md-8 col-lg-6 col-xl-4">
<div class="row">
<div class="col-8">
<div class="from-group">
<div class="from-group position-relative">
@* <input asp-for="Command.EndTaskDate" type="text" id="EndTaskDate" value="@Model.DateFa" class="form-control text-center date" placeholder="تاریخ"> *@
<input asp-for="Command.EndTaskDate" type="text" id="EndTaskDate" value="" class="form-control text-center date" placeholder="تاریخ" onkeyup="CheckHoliday()">
<div class="w-100 text-center" id="HolidayError" style="display: none; font-size: 11px; color: red; ">اخطار: تاریخ وارد شده تعطیل رسمی است</div>
<div class="text-center" id="HolidayError" style="display: none; font-size: 11px; color: red; position: absolute;top: 7px;right: 40px;font-weight: 700; ">تعطیل</div>
</div>
<div class="row my-2">
@@ -256,7 +257,7 @@
</div>
</button>
@* <a href="#" id="save" class="btn-tm-save">ارسال</a> *@
</div>
</div> `
</div>
</form>
@@ -281,7 +282,9 @@
<script src="~/assetsclient/js/site.js?ver=@Version.StyleVersion"></script>
<script src="~/assetsclient/libs/jalaali-js/jalaali.js"></script>
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
<script src="~/assetsadminnew/libs/sweetalert2/sweetalert2.all.min.js"></script>
<script>
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
var createTaskSaveAjax = '@Url.Page("/Company/Task/Create", "CreateSaveTask")';
@@ -294,7 +297,7 @@
var deleteAllFilesAjax = '@Url.Page("./Create", "RemoveAllTempFiles")';
</script>
<script src="~/assetsadminnew/tasks/js/create.js?ver=@Version.StyleVersion"></script>
<script src="~/assetsadminnew/tasks/js/create.js"></script>

View File

@@ -16,6 +16,7 @@ using Microsoft.AspNetCore.Authorization;
using Company.Domain.HolidayAgg;
using CompanyManagment.App.Contracts.Employer;
using CompanyManagment.App.Contracts.Workshop;
using AccountManagement.Domain.TicketAgg;
namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
{
@@ -78,9 +79,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
else
{
return Forbid();
}
}
}
}
public IActionResult OnPostCreateSaveTask(CreateTask Command)
@@ -111,7 +111,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
return new JsonResult(new
{
isSuccess = true,
list = list.GroupBy(x=>x).Select(x=>x.First()),
list = list.GroupBy(x => x).Select(x => x.First()),
});
}
@@ -285,26 +285,26 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
}
var isFriday = (dateTime.DayOfWeek == DayOfWeek.Friday);
var isHoliday = _holidayItemApplication.GetHoliday(dateTime);
var isHoliday = _holidayItemApplication.IsHoliday(dateTime);
if (isFriday)
{
operation.Succcedded();
return new JsonResult(new
{
IsSuccedded = operation.IsSuccedded,
isHoliday=true
isHoliday = true
});
}
else
operation.Succcedded();
return new JsonResult(new
{
return new JsonResult(new
{
IsSuccedded = operation.IsSuccedded,
isHoliday
});
}
IsSuccedded = operation.IsSuccedded,
isHoliday=isHoliday
});
}
public IActionResult OnPostUploadFile(IFormFile media)

View File

@@ -10,12 +10,30 @@
.sweet-alert {
font-family: 'IranSans' !important
}
#CRUDTaskSubjectModal {
width: 100%;
background: #00000085;
position: fixed;
height: 100vh;
top: 0;
left: 0;
z-index: 1000;
}
.TaskSubjectSection {
position: absolute;
transform: translate(-50%, -50%) !important;
top: 50%;
left: 50%;
width: 100%;
}
</style>
<div class="modal-content">
<div class="modal-header d-block text-center position-relative">
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="btn-close position-absolute text-start" id="btnSubjectCancel"></button>
<h5 class="modal-title" id="morakhasiEstehghaghiModalLabel">لیست عنوان دلبخواه</h5>
</div>
@@ -40,7 +58,7 @@
</div>
<div class="col-12">
<div class="from-group position-relative">
<input type="text" id="SearchSubject" class="form-control" placeholder="جستجو" onkeyup="searchSubjectTask()">
<input type="text" id="SearchSubjectCRUD" class="form-control" placeholder="جستجو" onkeyup="searchSubjectTaskCRUD()">
<div class="position-absolute" style="top: 3px; left:3px;">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="11" cy="11" r="7" stroke="#33363F" stroke-width="2" />
@@ -50,7 +68,7 @@
</div>
</div>
<div class="col-12" id="loadSubjectList" style="height: 260px; overflow: auto;">
<div class="col-12" id="loadSubjectList" style="height: 360px; overflow: auto;">
</div>
</div>
@@ -58,7 +76,8 @@
</div>
</div>
<script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script>
@* <script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script> *@
<script>
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
var CreateTaskSubjectAjax = '@Url.Page("./Create", "CreateTaskSubject")';
@@ -66,5 +85,5 @@
var editTaskSubjectAjax = '@Url.Page("./Create", "EditTaskSubject")';
var RemoveTaskSubjectAjax = '@Url.Page("./Create", "RemoveTaskSubject")';
</script>
<script src="~/assetsadminnew/tasks/js/createcrudtasksubjectmodal.js"></script>
<script src="~/assetsadminnew/tasks/js/createcrudtasksubjectmodal.js?ver=959595"></script>

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