deleted OldTask
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.Task;
|
||||
|
||||
namespace Company.Domain.Task;
|
||||
|
||||
public interface ITaskRepository : IRepository<long, Task>
|
||||
{
|
||||
List<TaskViewModel> Search(TaskSearchModel searchModel);
|
||||
void Remove(long id);
|
||||
void UpdateTask(Task task);
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
using _0_Framework.Domain;
|
||||
using System;
|
||||
|
||||
namespace Company.Domain.Task;
|
||||
|
||||
public class Task : EntityBase
|
||||
{
|
||||
public Task(long commander_Id, long seniorUser_Id, string taskTitle,
|
||||
string customer, long customer_Id, DateTime? taskDate, string description)
|
||||
{
|
||||
Commander_Id = commander_Id;
|
||||
SeniorUser_Id = seniorUser_Id;
|
||||
TaskTitle = taskTitle;
|
||||
Customer = customer;
|
||||
Customer_Id = customer_Id;
|
||||
TaskDate = taskDate;
|
||||
Description = description;
|
||||
}
|
||||
|
||||
public long Commander_Id { get; private set; }
|
||||
public long SeniorUser_Id { get; private set; }
|
||||
//public long ReferralRecipient_Id { get; private set; }
|
||||
public string TaskTitle { get; private set; }
|
||||
public string Customer { get; private set; }
|
||||
public long Customer_Id { get; private set; }
|
||||
public DateTime? TaskDate { get; private set; }
|
||||
public string Description { get; private set; }
|
||||
|
||||
|
||||
public TaskStatus.TaskStatus TaskStatus { get; private set; }
|
||||
//public TaskTitle.TaskTitle TaskTitle { get; private set; }
|
||||
|
||||
|
||||
public void Edit(long commander_Id, long seniorUser_Id, string taskTitle,
|
||||
string customer, long customer_Id, DateTime? taskDate, string description)
|
||||
{
|
||||
Commander_Id = commander_Id;
|
||||
SeniorUser_Id = seniorUser_Id;
|
||||
TaskTitle = taskTitle;
|
||||
Customer = customer;
|
||||
Customer_Id = customer_Id;
|
||||
TaskDate = taskDate;
|
||||
Description = description;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.TaskStatus;
|
||||
|
||||
namespace Company.Domain.TaskStatus;
|
||||
|
||||
public interface ITaskStatusRepository : IRepository<long, TaskStatus>
|
||||
{
|
||||
List<EditTaskStatus> Search(TaskStatusSearchModel searchModel);
|
||||
|
||||
void CreateOrUpdateTaskStatus(EditTaskStatus editTaskStatus);
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
using _0_Framework.Domain;
|
||||
using System;
|
||||
|
||||
namespace Company.Domain.TaskStatus;
|
||||
|
||||
public class TaskStatus : EntityBase
|
||||
{
|
||||
public TaskStatus
|
||||
(
|
||||
short referralStatus,
|
||||
long referralUserId,
|
||||
DateTime? referralRegDate,
|
||||
long referralRegUserId,
|
||||
short deadlineExtentionStatus,
|
||||
DateTime? deadlineExtentionDate,
|
||||
DateTime? deadlineExtentionRegDate,
|
||||
long deadlineExtentionRegUserId,
|
||||
short impossibilityStatus,
|
||||
string impossibilityDescription,
|
||||
DateTime? impossibilityRegDate,
|
||||
long impossibilityRegUserId,
|
||||
short doneStatus,
|
||||
DateTime? doneRegDate,
|
||||
long doneRegUserId,
|
||||
long task_Id
|
||||
)
|
||||
{
|
||||
ReferralStatus = referralStatus;
|
||||
ReferralUserId = referralUserId;
|
||||
ReferralRegDate = referralRegDate;
|
||||
ReferralRegUserId = referralRegUserId;
|
||||
//DeadlineExtention = deadlineExtention;
|
||||
DeadlineExtentionStatus = deadlineExtentionStatus;
|
||||
DeadlineExtentionDate = deadlineExtentionDate;
|
||||
DeadlineExtentionRegDate = deadlineExtentionRegDate;
|
||||
DeadlineExtentionRegUserId = deadlineExtentionRegUserId;
|
||||
//Impossibility = impossibility;
|
||||
ImpossibilityStatus = impossibilityStatus;
|
||||
ImpossibilityDescription = impossibilityDescription;
|
||||
ImpossibilityRegDate = impossibilityRegDate;
|
||||
ImpossibilityRegUserId = impossibilityRegUserId;
|
||||
//Done = done;
|
||||
DoneStatus = doneStatus;
|
||||
DoneRegDate = doneRegDate;
|
||||
DoneRegUserId = doneRegUserId;
|
||||
Task_Id = task_Id;
|
||||
}
|
||||
|
||||
public short ReferralStatus { get; set; }
|
||||
public long ReferralUserId { get; private set; }
|
||||
public DateTime? ReferralRegDate { get; private set; }
|
||||
public long ReferralRegUserId { get; private set; }
|
||||
|
||||
//public int DeadlineExtention { get; private set; }
|
||||
public short DeadlineExtentionStatus { get; private set; }
|
||||
public DateTime? DeadlineExtentionDate { get; private set; }
|
||||
public DateTime? DeadlineExtentionRegDate { get; private set; }
|
||||
public long DeadlineExtentionRegUserId { get; private set; }
|
||||
|
||||
//public int Impossibility { get; private set; }
|
||||
public short ImpossibilityStatus { get; private set; }
|
||||
public string ImpossibilityDescription { get; private set; }
|
||||
public DateTime? ImpossibilityRegDate { get; private set; }
|
||||
public long ImpossibilityRegUserId { get; private set; }
|
||||
|
||||
//public int Done { get; private set; }
|
||||
public short DoneStatus { get; private set; }
|
||||
public DateTime? DoneRegDate { get; private set; }
|
||||
public long DoneRegUserId { get; private set; }
|
||||
public long Task_Id { get; private set; }
|
||||
|
||||
public Task.Task Task { get; private set; }
|
||||
|
||||
public void Edit
|
||||
(
|
||||
short referralStatus,
|
||||
long referralUserId,
|
||||
DateTime? referralRegDate,
|
||||
long referralRegUserId,
|
||||
short deadlineExtentionStatus,
|
||||
DateTime? deadlineExtentionDate,
|
||||
DateTime? deadlineExtentionRegDate,
|
||||
long deadlineExtentionRegUserId,
|
||||
short impossibilityStatus,
|
||||
string impossibilityDescription,
|
||||
DateTime? impossibilityRegDate,
|
||||
long impossibilityRegUserId,
|
||||
short doneStatus,
|
||||
DateTime? doneRegDate,
|
||||
long doneRegUserId,
|
||||
long task_Id
|
||||
)
|
||||
{
|
||||
ReferralStatus = referralStatus;
|
||||
ReferralUserId = referralUserId;
|
||||
ReferralRegDate = referralRegDate;
|
||||
ReferralRegUserId = referralRegUserId;
|
||||
//DeadlineExtention = deadlineExtention;
|
||||
DeadlineExtentionStatus = deadlineExtentionStatus;
|
||||
DeadlineExtentionDate = deadlineExtentionDate;
|
||||
DeadlineExtentionRegDate = deadlineExtentionRegDate;
|
||||
DeadlineExtentionRegUserId = deadlineExtentionRegUserId;
|
||||
//Impossibility = impossibility;
|
||||
ImpossibilityStatus = impossibilityStatus;
|
||||
ImpossibilityDescription = impossibilityDescription;
|
||||
ImpossibilityRegDate = impossibilityRegDate;
|
||||
ImpossibilityRegUserId = impossibilityRegUserId;
|
||||
//Done = done;
|
||||
DoneStatus = doneStatus;
|
||||
DoneRegDate = doneRegDate;
|
||||
DoneRegUserId = doneRegUserId;
|
||||
Task_Id = task_Id;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.TaskTitle;
|
||||
|
||||
namespace Company.Domain.TaskTitle;
|
||||
|
||||
public interface ITaskTitleRepository : IRepository<long, TaskTitle>
|
||||
{
|
||||
List<TaskTitleViewModel> Search(TaskTitleSearchModel searchModel);
|
||||
public EditTaskTitle GetDetails(long id);
|
||||
public void Remove(long id);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using _0_Framework.Domain;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Company.Domain.TaskTitle;
|
||||
|
||||
public class TaskTitle : EntityBase
|
||||
{
|
||||
public TaskTitle(string title)
|
||||
{
|
||||
Title = title;
|
||||
|
||||
TasksList = new List<Task.Task>();
|
||||
}
|
||||
|
||||
public string Title { get; private set; }
|
||||
|
||||
public List<Task.Task> TasksList { get; private set; }
|
||||
//public TaskStatus.TaskStatus TaskStatus { get; private set; }
|
||||
|
||||
public void Edit(string title)
|
||||
{
|
||||
Title = title;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Task;
|
||||
|
||||
public class CreateTask
|
||||
{
|
||||
public long Commander_Id { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "انتخاب کاربر الزامی است")]
|
||||
public long SeniorUser_Id { get; set; }
|
||||
public long ReferralRecipient_Id { get; set; }
|
||||
|
||||
//[Required(ErrorMessage = "انتخاب عنوان وظیفه الزامی است")]
|
||||
public string TaskTitle { get; set; }
|
||||
public string SelectTaskTitle { get; set; }
|
||||
public string Customer { get; set; }
|
||||
public long Customer_Id { get; set; }
|
||||
public string TaskDate { get; set; }
|
||||
public string TaskFromDate { get; set; }
|
||||
public int TaskDuration { get; set; }
|
||||
public string Description { get; set; }
|
||||
public bool IsEditMode { get; set; }
|
||||
|
||||
|
||||
//public TaskStatus. TaskStatus { get; private set; }
|
||||
//public TaskTitle.TaskTitle TaskTitle { get; private set; }
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.TaskTitle;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Task;
|
||||
|
||||
public class EditTask : CreateTask
|
||||
{
|
||||
public long Id { get; set; }
|
||||
//List<EmployeeViewModel> Commanders { get; set; }
|
||||
public List<AccountViewModel> SeniorUsers { get; set; }
|
||||
public List<AccountViewModel> ReferralRecipientUsers { get; set; }
|
||||
public List<EmployerViewModel> Customers { get; set; }
|
||||
//List<EmployeeViewModel> ReferralRecipients { get; set; }
|
||||
public List<TaskTitleViewModel> TaskTitles { get; set; }
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework_b.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Task;
|
||||
|
||||
public interface ITaskApplication
|
||||
{
|
||||
OperationResult Create(CreateTask command);
|
||||
OperationResult Edit(EditTask command);
|
||||
OperationResult Remove(long id);
|
||||
EditTask GetDetails(long id);
|
||||
string GetDate(int type);
|
||||
List<TaskViewModel> Search(TaskSearchModel searchModel);
|
||||
List<TaskViewModel> GetTaskDetails(List<TaskViewModel> tasks);
|
||||
List<TaskViewModel> FilterData(List<TaskViewModel> viewModels, TaskSearchModel searchModel);
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using CompanyManagment.App.Contracts.TaskTitle;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Task;
|
||||
|
||||
public class TaskSearchModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long AccountId { get; set; }
|
||||
public long RoleId { get; set; }
|
||||
public long Commander_Id { get; set; }
|
||||
public long SeniorUser_Id { get; set; }
|
||||
public string TaskTitle { get; set; }
|
||||
public string Customer { get; set; }
|
||||
public string TaskDateFrom { get; set; }
|
||||
public string TaskDateTo { get; set; }
|
||||
public short ReferralStatus { get; set; }
|
||||
public short DeadlineExtensionStatus { get; set; }
|
||||
public short ImpossibilityStatus { get; set; }
|
||||
public short DoneStatus { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
public List<AccountViewModel> Commanders { get; set; }
|
||||
public List<AccountViewModel> SeniorUsers { get; set; }
|
||||
//public List<TaskTitleViewModel> TaskTitles { get; set; }
|
||||
|
||||
public bool IsSearch { get; set; }
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using CompanyManagment.App.Contracts.TaskStatus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Task;
|
||||
|
||||
public class TaskViewModel
|
||||
{
|
||||
public TaskViewModel()
|
||||
{
|
||||
TaskStatus = new EditTaskStatus();
|
||||
}
|
||||
public long Id { get; set; }
|
||||
public long Commander_Id { get; set; }
|
||||
public string CommanderName { get; set; }
|
||||
public long SeniorUser_Id { get; set; }
|
||||
public string SeniorUserName { get; set; }
|
||||
public long ReferralRecipient_Id { get; set; }
|
||||
public string ReferralRecipientName { get; set; }
|
||||
//public long TaskTitle_Id { get; set; }
|
||||
public string TaskTitle { get; set; }
|
||||
public long Customer_Id { get; set; }
|
||||
public string CustomerName { get; set; }
|
||||
public string TaskDate { get; set; }
|
||||
public DateTime? TaskGDate { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
public EditTaskStatus TaskStatus { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TaskStatus;
|
||||
|
||||
public class CreateTaskStatus
|
||||
{
|
||||
public short ReferralStatus { get; set; }
|
||||
public DateTime? ReferralRegDate { get; set; }
|
||||
public long ReferralUserId { get; set; }
|
||||
public string ReferralUserFullName { get; set; }
|
||||
public long ReferralRegUserId { get; set; }
|
||||
public string ReferralRegUserFullName { get; set; }
|
||||
public short DeadlineExtentionStatus { get; set; }
|
||||
public DateTime? DeadlineExtentionDate { get; set; }
|
||||
public string DeadlineExtentionFarsiDate { get; set; }
|
||||
public DateTime? DeadlineExtentionRegDate { get; set; }
|
||||
public long DeadlineExtentionRegUserId { get; set; }
|
||||
public string DeadlineExtentionRegUserFullName { get; set; }
|
||||
public short ImpossibilityStatus { get; set; }
|
||||
public string ImpossibilityDescription { get; set; }
|
||||
public DateTime? ImpossibilityRegDate { get; set; }
|
||||
public long ImpossibilityRegUserId { get; set; }
|
||||
public string ImpossibilityRegUserFullName { get; set; }
|
||||
public short DoneStatus { get; set; }
|
||||
public DateTime? DoneRegDate { get; set; }
|
||||
public long DoneRegUserId { get; set; }
|
||||
public string DoneRegUserFullName { get; set; }
|
||||
public long Task_Id { get; set; }
|
||||
public bool IsApproval { get; set; }
|
||||
public bool Approval { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
//public Task.Task Task { get; set; }
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace CompanyManagment.App.Contracts.TaskStatus;
|
||||
|
||||
public class EditTaskStatus : CreateTaskStatus
|
||||
{
|
||||
public long Id { get; set; }
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework_b.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TaskStatus;
|
||||
|
||||
public interface ITaskStatusApplication
|
||||
{
|
||||
OperationResult Create(CreateTaskStatus command);
|
||||
OperationResult Edit(EditTaskStatus command);
|
||||
OperationResult Remove(long id);
|
||||
EditTaskStatus GetDetails(long id);
|
||||
EditTaskStatus GetDetails(long fileId, int boardTypeId);
|
||||
List<EditTaskStatus> Search(TaskStatusSearchModel searchModel);
|
||||
void CreateOrUpdateTaskStatus(EditTaskStatus editTaskStatus);
|
||||
OperationResult SetRefferal(EditTaskStatus editTaskStatus);
|
||||
OperationResult SetDeadline(EditTaskStatus editTaskStatus);
|
||||
OperationResult SetImpossibility(EditTaskStatus editTaskStatus);
|
||||
OperationResult SetDone(EditTaskStatus editTaskStatus);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TaskStatus;
|
||||
|
||||
public static class TaskStatusEnums
|
||||
{
|
||||
public const short NOTSET = 0;
|
||||
public const short UNAPPROVED = 1;
|
||||
public const short REJECTED = 2;
|
||||
public const short SENIOR_APPROVAL = 3;
|
||||
public const short MANAGER_APPROVAL = 4;
|
||||
public const short ALL = 5;
|
||||
|
||||
//public const short UNDONE = 5;
|
||||
//public const short DONE = 6;
|
||||
//public const short DONE_OR_UNDONE = 7;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace CompanyManagment.App.Contracts.TaskStatus;
|
||||
|
||||
public class TaskStatusSearchModel
|
||||
{
|
||||
public long TaskId { get; set; }
|
||||
public long ReferralUserId { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TaskStatus;
|
||||
|
||||
public class TaskStatusViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Description { get; set; }
|
||||
public long BoardType_Id { get; set; }
|
||||
public long File_Id { get; set; }
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TaskTitle;
|
||||
|
||||
public class CreateTaskTitle
|
||||
{
|
||||
[Required(ErrorMessage = "وارد کردن عنوان الزامیست")]
|
||||
public string Title { get; set; }
|
||||
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TaskTitle;
|
||||
|
||||
public class EditTaskTitle : CreateTaskTitle
|
||||
{
|
||||
public long Id { get; set; }
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework_b.Application;
|
||||
using MD.PersianDateTime;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TaskTitle;
|
||||
|
||||
public interface ITaskTitleApplication
|
||||
{
|
||||
OperationResult Create(CreateTaskTitle command);
|
||||
OperationResult Edit(EditTaskTitle command);
|
||||
OperationResult Remove(long id);
|
||||
EditTaskTitle GetDetails(long id);
|
||||
List<TaskTitleViewModel> Search(TaskTitleSearchModel searchModel);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace CompanyManagment.App.Contracts.TaskTitle;
|
||||
|
||||
public class TaskTitleSearchModel
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public long Id { get; set; }
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TaskTitle;
|
||||
|
||||
public class TaskTitleViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,305 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework_b.Application;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using Company.Domain.Task;
|
||||
using CompanyManagment.App.Contracts.File1;
|
||||
using CompanyManagment.App.Contracts.Task;
|
||||
using CompanyManagment.App.Contracts.TaskStatus;
|
||||
using CompanyManagment.App.Contracts.TaskTitle;
|
||||
using MD.PersianDateTime.Standard;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class TaskApplication : ITaskApplication
|
||||
{
|
||||
private readonly ITaskRepository _taskRepository;
|
||||
private readonly IFileApplication _fileApplication;
|
||||
private readonly ITaskTitleApplication _taskTitleApplication;
|
||||
private readonly IAccountApplication _accountApplication;
|
||||
private readonly ITaskStatusApplication _taskStatusApplication;
|
||||
private readonly _0_Framework.Application.IAuthHelper _authHelper;
|
||||
|
||||
public TaskApplication(
|
||||
ITaskRepository taskRepository,
|
||||
IFileApplication fileApplication,
|
||||
ITaskTitleApplication TaskTitleApplication,
|
||||
IAccountApplication accountApplication,
|
||||
ITaskStatusApplication taskStatusApplication,
|
||||
_0_Framework.Application.IAuthHelper authHelper
|
||||
)
|
||||
{
|
||||
_taskRepository = taskRepository;
|
||||
_fileApplication = fileApplication;
|
||||
_taskTitleApplication = TaskTitleApplication;
|
||||
_accountApplication = accountApplication;
|
||||
_taskStatusApplication = taskStatusApplication;
|
||||
_authHelper = authHelper;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateTask createTask)
|
||||
{
|
||||
var oprtaion = new OperationResult();
|
||||
|
||||
if (createTask.TaskDate != null)
|
||||
{
|
||||
var task = new Task(createTask.Commander_Id, createTask.SeniorUser_Id, createTask.TaskTitle,
|
||||
createTask.Customer, createTask.Customer_Id, createTask.TaskDate.ToGeorgianDateTime(), createTask.Description);
|
||||
|
||||
_taskRepository.Create(task);
|
||||
_taskRepository.SaveChanges();
|
||||
|
||||
var taskStatus = new EditTaskStatus
|
||||
{
|
||||
DeadlineExtentionDate = createTask.TaskDate.ToGeorgianDateTime(),
|
||||
DeadlineExtentionRegDate = DateTime.Now,
|
||||
DeadlineExtentionRegUserId = _authHelper.CurrentAccountId(),
|
||||
Task_Id = task.id
|
||||
};
|
||||
|
||||
_taskStatusApplication.CreateOrUpdateTaskStatus(taskStatus);
|
||||
|
||||
}
|
||||
|
||||
if (createTask.TaskFromDate != null)
|
||||
{
|
||||
for (var i = 0; i < createTask.TaskDuration; i++)
|
||||
{
|
||||
var task = new Task(createTask.Commander_Id, createTask.SeniorUser_Id, createTask.TaskTitle,
|
||||
createTask.Customer, createTask.Customer_Id, createTask.TaskFromDate.ToGeorgianDateTime().AddMonths(i), createTask.Description);
|
||||
|
||||
_taskRepository.Create(task);
|
||||
_taskRepository.SaveChanges();
|
||||
|
||||
|
||||
var taskStatus = new EditTaskStatus
|
||||
{
|
||||
DeadlineExtentionDate = createTask.TaskFromDate.ToGeorgianDateTime().AddMonths(i),
|
||||
DeadlineExtentionRegDate = DateTime.Now,
|
||||
DeadlineExtentionRegUserId = _authHelper.CurrentAccountId(),
|
||||
Task_Id = task.id
|
||||
};
|
||||
|
||||
if(createTask.ReferralRecipient_Id != 0)
|
||||
{
|
||||
taskStatus.ReferralUserId = createTask.ReferralRecipient_Id;
|
||||
taskStatus.ReferralRegDate = DateTime.Now;
|
||||
taskStatus.ReferralRegUserId = _authHelper.CurrentAccountId();
|
||||
taskStatus.ReferralStatus = TaskStatusEnums.MANAGER_APPROVAL;
|
||||
}
|
||||
|
||||
_taskStatusApplication.CreateOrUpdateTaskStatus(taskStatus);
|
||||
}
|
||||
}
|
||||
|
||||
return oprtaion.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult Edit(EditTask command)
|
||||
{
|
||||
var result = new OperationResult();
|
||||
|
||||
var task = _taskRepository.Get(command.Id);
|
||||
|
||||
task.Edit(command.Commander_Id, command.SeniorUser_Id, command.TaskTitle, command.Customer, command.Customer_Id, command.TaskDate.ToGeorgianDateTime(), command.Description);
|
||||
|
||||
_taskRepository.SaveChanges();
|
||||
|
||||
return result.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult Remove(long id)
|
||||
{
|
||||
var result = new OperationResult();
|
||||
|
||||
_taskRepository.Remove(id);
|
||||
|
||||
return result.Succcedded();
|
||||
}
|
||||
|
||||
public EditTask GetDetails(long id)
|
||||
{
|
||||
var task = _taskRepository.Get(id);
|
||||
var editTask = new EditTask
|
||||
{
|
||||
Id = task.id,
|
||||
Commander_Id = task.Commander_Id,
|
||||
SeniorUser_Id = task.SeniorUser_Id,
|
||||
Customer = task.Customer,
|
||||
Customer_Id = task.Customer_Id,
|
||||
Description = task.Description,
|
||||
TaskTitle = task.TaskTitle,
|
||||
TaskDate = task.TaskDate.ToFarsi(),
|
||||
|
||||
};
|
||||
|
||||
return editTask;
|
||||
}
|
||||
|
||||
public List<TaskViewModel> Search(TaskSearchModel searchModel)
|
||||
{
|
||||
var tasks = _taskRepository.Search(searchModel);
|
||||
|
||||
tasks.AddRange(GetReferralTasks(searchModel.AccountId));
|
||||
|
||||
tasks = tasks.OrderBy(x => x.TaskGDate).ToList();
|
||||
|
||||
foreach (var task in tasks)
|
||||
{
|
||||
task.CommanderName = _accountApplication.GetAccountBy(task.Commander_Id).Fullname;
|
||||
task.SeniorUserName = _accountApplication.GetAccountBy(task.SeniorUser_Id).Fullname;
|
||||
|
||||
if (task.CustomerName == null)
|
||||
task.CustomerName = _fileApplication.GetEmployerFullNameById(task.Customer_Id);
|
||||
|
||||
//task.TaskTitle = _taskTitleApplication.GetDetails(task.TaskTitle_Id).Title;
|
||||
|
||||
var statuses = _taskStatusApplication.Search(new TaskStatusSearchModel { TaskId = task.Id });
|
||||
|
||||
if (statuses.Count != 0)
|
||||
task.TaskStatus = statuses[0];
|
||||
|
||||
task.TaskStatus.DeadlineExtentionFarsiDate = task.TaskStatus.DeadlineExtentionDate.ToFarsi();
|
||||
|
||||
task.ReferralRecipientName = (task.TaskStatus.ReferralUserId != 0 && task.TaskStatus.ReferralStatus != TaskStatusEnums.REJECTED)
|
||||
? _accountApplication.GetAccountBy(task.TaskStatus.ReferralUserId).Fullname
|
||||
: null;
|
||||
}
|
||||
|
||||
|
||||
return tasks;
|
||||
}
|
||||
|
||||
public string GetDate(int type)
|
||||
{
|
||||
var persianDateTime = PersianDateTime.Today;
|
||||
switch (type)
|
||||
{
|
||||
case 0: //فردا
|
||||
return persianDateTime.AddDays(1).ToString();
|
||||
break;
|
||||
|
||||
case 1: //پسفردا
|
||||
return persianDateTime.AddDays(2).ToString();
|
||||
break;
|
||||
|
||||
case 2: //اول هفته
|
||||
return persianDateTime.AddDays(7).GetFirstDayOfWeek().ToString();
|
||||
break;
|
||||
|
||||
case 3: //آخر هفته
|
||||
return persianDateTime.GetFirstDayOfWeek().AddDays(6 + 7).ToString();
|
||||
break;
|
||||
|
||||
case 4: //وسط هفته
|
||||
return persianDateTime.GetFirstDayOfWeek().AddDays(3 + 7).ToString();
|
||||
break;
|
||||
|
||||
default:
|
||||
return persianDateTime.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<TaskViewModel> GetTaskDetails(List<TaskViewModel> tasks)
|
||||
{
|
||||
foreach (var task in tasks)
|
||||
{
|
||||
task.TaskStatus = _taskStatusApplication.Search(new TaskStatusSearchModel { TaskId = task.Id }).FirstOrDefault() ?? new EditTaskStatus();
|
||||
}
|
||||
|
||||
return tasks;
|
||||
}
|
||||
|
||||
public List<TaskViewModel> FilterData(List<TaskViewModel> viewModels, TaskSearchModel searchModel)
|
||||
{
|
||||
if (searchModel.Commander_Id != 0)
|
||||
viewModels = viewModels.Where(x => x.Commander_Id == searchModel.Commander_Id).ToList();
|
||||
|
||||
if (searchModel.SeniorUser_Id != 0)
|
||||
viewModels = viewModels.Where(x => x.SeniorUser_Id == searchModel.SeniorUser_Id || x.TaskStatus.ReferralUserId == searchModel.SeniorUser_Id).ToList();
|
||||
|
||||
//if (searchModel.TaskTitle_Id != 0)
|
||||
// viewModels = viewModels.Where(x => x.TaskTitle_Id == searchModel.TaskTitle_Id).ToList();
|
||||
if (searchModel.TaskTitle != null)
|
||||
viewModels = viewModels.Where(x => x.TaskTitle != null && x.TaskTitle.Contains(searchModel.TaskTitle)).ToList();
|
||||
|
||||
if (searchModel.Customer != null)
|
||||
viewModels = viewModels.Where(x => x.CustomerName != null && x.CustomerName.Contains(searchModel.Customer)).ToList();
|
||||
|
||||
if (searchModel.Description != null)
|
||||
viewModels = viewModels.Where(x => x.Description != null && x.Description.Contains(searchModel.Description)).ToList();
|
||||
|
||||
if (searchModel.TaskDateFrom != null)
|
||||
viewModels = viewModels.Where(x => x.TaskDate.ToGeorgianDateTime() >= searchModel.TaskDateFrom.ToGeorgianDateTime()).ToList();
|
||||
|
||||
if (searchModel.TaskDateTo != null)
|
||||
viewModels = viewModels.Where(x => x.TaskDate.ToGeorgianDateTime() <= searchModel.TaskDateTo.ToGeorgianDateTime()).ToList();
|
||||
|
||||
if (searchModel.ReferralStatus == TaskStatusEnums.NOTSET)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.ReferralStatus == TaskStatusEnums.NOTSET || x.TaskStatus.ReferralStatus == TaskStatusEnums.REJECTED).ToList();
|
||||
|
||||
if (searchModel.ReferralStatus == TaskStatusEnums.UNAPPROVED)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.ReferralStatus == TaskStatusEnums.UNAPPROVED).ToList();
|
||||
|
||||
if (searchModel.ReferralStatus == TaskStatusEnums.REJECTED)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.ReferralStatus == TaskStatusEnums.REJECTED).ToList();
|
||||
|
||||
if (searchModel.ReferralStatus == TaskStatusEnums.SENIOR_APPROVAL || searchModel.ReferralStatus == TaskStatusEnums.MANAGER_APPROVAL)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.ReferralStatus == TaskStatusEnums.SENIOR_APPROVAL || x.TaskStatus.ReferralStatus == TaskStatusEnums.MANAGER_APPROVAL).ToList();
|
||||
|
||||
if (searchModel.DeadlineExtensionStatus == TaskStatusEnums.NOTSET)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.DeadlineExtentionStatus == TaskStatusEnums.NOTSET || x.TaskStatus.DeadlineExtentionStatus == TaskStatusEnums.REJECTED).ToList();
|
||||
|
||||
if (searchModel.DeadlineExtensionStatus == TaskStatusEnums.UNAPPROVED)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.DeadlineExtentionStatus == TaskStatusEnums.UNAPPROVED).ToList();
|
||||
|
||||
if (searchModel.DeadlineExtensionStatus == TaskStatusEnums.REJECTED)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.DeadlineExtentionStatus == TaskStatusEnums.REJECTED).ToList();
|
||||
|
||||
if (searchModel.DeadlineExtensionStatus == TaskStatusEnums.SENIOR_APPROVAL || searchModel.DeadlineExtensionStatus == TaskStatusEnums.MANAGER_APPROVAL)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.DeadlineExtentionStatus == TaskStatusEnums.SENIOR_APPROVAL || x.TaskStatus.DeadlineExtentionStatus == TaskStatusEnums.MANAGER_APPROVAL).ToList();
|
||||
|
||||
if (searchModel.ImpossibilityStatus == TaskStatusEnums.NOTSET)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.ImpossibilityStatus == TaskStatusEnums.NOTSET || x.TaskStatus.ImpossibilityStatus == TaskStatusEnums.REJECTED).ToList();
|
||||
|
||||
if (searchModel.ImpossibilityStatus == TaskStatusEnums.UNAPPROVED)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.ImpossibilityStatus == TaskStatusEnums.UNAPPROVED).ToList();
|
||||
|
||||
if (searchModel.ImpossibilityStatus == TaskStatusEnums.REJECTED)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.ImpossibilityStatus == TaskStatusEnums.REJECTED).ToList();
|
||||
|
||||
if (searchModel.ImpossibilityStatus == TaskStatusEnums.SENIOR_APPROVAL || searchModel.ImpossibilityStatus == TaskStatusEnums.MANAGER_APPROVAL)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.ImpossibilityStatus == TaskStatusEnums.SENIOR_APPROVAL || x.TaskStatus.ImpossibilityStatus == TaskStatusEnums.MANAGER_APPROVAL).ToList();
|
||||
|
||||
if (searchModel.DoneStatus == TaskStatusEnums.NOTSET)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.DoneStatus == TaskStatusEnums.NOTSET || x.TaskStatus.DoneStatus == TaskStatusEnums.REJECTED).ToList();
|
||||
|
||||
if (searchModel.DoneStatus == TaskStatusEnums.UNAPPROVED)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.DoneStatus == TaskStatusEnums.UNAPPROVED).ToList();
|
||||
|
||||
if (searchModel.DoneStatus == TaskStatusEnums.REJECTED)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.DoneStatus == TaskStatusEnums.REJECTED).ToList();
|
||||
|
||||
if (searchModel.DoneStatus == TaskStatusEnums.SENIOR_APPROVAL || searchModel.DoneStatus == TaskStatusEnums.MANAGER_APPROVAL)
|
||||
viewModels = viewModels.Where(x => x.TaskStatus.DoneStatus == TaskStatusEnums.SENIOR_APPROVAL || x.TaskStatus.DoneStatus == TaskStatusEnums.MANAGER_APPROVAL).ToList();
|
||||
|
||||
return viewModels;
|
||||
}
|
||||
|
||||
|
||||
private List<TaskViewModel> GetReferralTasks(long accountId)
|
||||
{
|
||||
var referralTasks = new List<TaskViewModel>();
|
||||
|
||||
var referralTasksStatus = _taskStatusApplication.Search(new TaskStatusSearchModel { ReferralUserId = accountId });
|
||||
|
||||
foreach(var item in referralTasksStatus)
|
||||
{
|
||||
referralTasks.AddRange(_taskRepository.Search(new TaskSearchModel { Id = item.Task_Id }));
|
||||
}
|
||||
|
||||
return referralTasks;
|
||||
}
|
||||
}
|
||||
@@ -1,227 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework_b.Application;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using Company.Domain.Task;
|
||||
using Company.Domain.TaskStatus;
|
||||
using CompanyManagment.App.Contracts.TaskStatus;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class TaskStatusApplication : ITaskStatusApplication
|
||||
{
|
||||
private readonly ITaskRepository _taskRepository;
|
||||
private readonly ITaskStatusRepository _taskStatusRepository;
|
||||
private readonly IAccountApplication _accountApplication;
|
||||
private readonly _0_Framework.Application.IAuthHelper _authHelper;
|
||||
|
||||
public TaskStatusApplication
|
||||
(
|
||||
ITaskRepository taskRepository,
|
||||
ITaskStatusRepository taskStatusRepository,
|
||||
IAccountApplication accountApplication,
|
||||
_0_Framework.Application.IAuthHelper authHelper
|
||||
)
|
||||
{
|
||||
_taskRepository = taskRepository;
|
||||
_taskStatusRepository = taskStatusRepository;
|
||||
_accountApplication = accountApplication;
|
||||
_authHelper = authHelper;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateTaskStatus command)
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public OperationResult Edit(EditTaskStatus command)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public OperationResult Remove(long id)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public EditTaskStatus GetDetails(long id)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public EditTaskStatus GetDetails(long fileId, int boardTypeId)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<EditTaskStatus> Search(TaskStatusSearchModel searchModel)
|
||||
{
|
||||
var taskStatuses = _taskStatusRepository.Search(searchModel);
|
||||
|
||||
foreach(var taskStatus in taskStatuses)
|
||||
{
|
||||
taskStatus.ReferralUserFullName = taskStatus.ReferralUserId != 0
|
||||
? _accountApplication.GetAccountBy(taskStatus.ReferralUserId).Fullname
|
||||
: null;
|
||||
|
||||
taskStatus.ReferralRegUserFullName = taskStatus.ReferralRegUserId != 0
|
||||
? _accountApplication.GetAccountBy(taskStatus.ReferralRegUserId).Fullname
|
||||
: null;
|
||||
|
||||
taskStatus.DeadlineExtentionRegUserFullName = taskStatus.DeadlineExtentionRegUserId != 0
|
||||
? _accountApplication.GetAccountBy(taskStatus.DeadlineExtentionRegUserId).Fullname
|
||||
: null;
|
||||
|
||||
taskStatus.ImpossibilityRegUserFullName = taskStatus.ImpossibilityRegUserId != 0
|
||||
? _accountApplication.GetAccountBy(taskStatus.ImpossibilityRegUserId).Fullname
|
||||
: null;
|
||||
|
||||
taskStatus.DoneRegUserFullName = taskStatus.DoneRegUserId != 0
|
||||
? _accountApplication.GetAccountBy(taskStatus.DoneRegUserId).Fullname
|
||||
: null;
|
||||
}
|
||||
|
||||
return taskStatuses;
|
||||
}
|
||||
|
||||
|
||||
public OperationResult SetRefferal(EditTaskStatus editTaskStatus)
|
||||
{
|
||||
var result = new OperationResult();
|
||||
EditTaskStatus taskStatus = new EditTaskStatus();
|
||||
|
||||
var taskStatuses = _taskStatusRepository.Search(new TaskStatusSearchModel { TaskId = editTaskStatus.Task_Id });
|
||||
|
||||
if (taskStatuses.Count != 0)
|
||||
taskStatus = taskStatuses[0];
|
||||
|
||||
taskStatus.ReferralStatus = editTaskStatus.ReferralStatus;
|
||||
taskStatus.Task_Id = editTaskStatus.Task_Id;
|
||||
|
||||
if (!editTaskStatus.IsApproval)
|
||||
{
|
||||
taskStatus.ReferralUserId = editTaskStatus.ReferralUserId;
|
||||
taskStatus.ReferralRegUserId = _authHelper.CurrentAccountId();
|
||||
taskStatus.ReferralRegDate = DateTime.Now;
|
||||
}
|
||||
|
||||
_taskStatusRepository.CreateOrUpdateTaskStatus(taskStatus);
|
||||
//_taskRepository.UpdateTaskStatus(refferal.ReferralUserId, refferal.TaskId);
|
||||
|
||||
return result.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult SetDeadline(EditTaskStatus editTaskStatus)
|
||||
{
|
||||
var result = new OperationResult();
|
||||
EditTaskStatus taskStatus = new EditTaskStatus();
|
||||
|
||||
var taskStatuses = _taskStatusRepository.Search(new TaskStatusSearchModel { TaskId = editTaskStatus.Task_Id });
|
||||
|
||||
if (taskStatuses.Count != 0)
|
||||
taskStatus = taskStatuses[0];
|
||||
|
||||
if(CheckTaskHasUnapprovalStatus(taskStatus) &&
|
||||
editTaskStatus.DeadlineExtentionStatus != TaskStatusEnums.MANAGER_APPROVAL &&
|
||||
editTaskStatus.DeadlineExtentionStatus != TaskStatusEnums.SENIOR_APPROVAL)
|
||||
return result.Failed("این وظیفه اقدام تایید نشده دارد");
|
||||
|
||||
taskStatus.DeadlineExtentionStatus = editTaskStatus.DeadlineExtentionStatus;
|
||||
taskStatus.Task_Id = editTaskStatus.Task_Id;
|
||||
|
||||
if (!editTaskStatus.IsApproval)
|
||||
{
|
||||
taskStatus.DeadlineExtentionDate = editTaskStatus.DeadlineExtentionDate;
|
||||
taskStatus.DeadlineExtentionRegUserId = _authHelper.CurrentAccountId();
|
||||
taskStatus.DeadlineExtentionRegDate = DateTime.Now;
|
||||
}
|
||||
|
||||
_taskStatusRepository.CreateOrUpdateTaskStatus(taskStatus);
|
||||
|
||||
if (editTaskStatus.IsApproval && editTaskStatus.Approval)
|
||||
{
|
||||
var task = _taskRepository.Get(taskStatus.Task_Id);
|
||||
task.Edit(task.Commander_Id, task.SeniorUser_Id, task.TaskTitle, task.Customer, task.Customer_Id, taskStatus.DeadlineExtentionDate, task.Description);
|
||||
_taskRepository.SaveChanges();
|
||||
}
|
||||
|
||||
|
||||
return result.Succcedded();
|
||||
}
|
||||
|
||||
public void CreateOrUpdateTaskStatus(EditTaskStatus editTaskStatus)
|
||||
{
|
||||
_taskStatusRepository.CreateOrUpdateTaskStatus(editTaskStatus);
|
||||
}
|
||||
|
||||
public OperationResult SetImpossibility(EditTaskStatus editTaskStatus)
|
||||
{
|
||||
var result = new OperationResult();
|
||||
EditTaskStatus taskStatus = new EditTaskStatus();
|
||||
|
||||
var taskStatuses = _taskStatusRepository.Search(new TaskStatusSearchModel { TaskId = editTaskStatus.Task_Id });
|
||||
|
||||
if (taskStatuses.Count != 0)
|
||||
taskStatus = taskStatuses[0];
|
||||
|
||||
if (CheckTaskHasUnapprovalStatus(taskStatus) &&
|
||||
editTaskStatus.ImpossibilityStatus != TaskStatusEnums.MANAGER_APPROVAL &&
|
||||
editTaskStatus.ImpossibilityStatus != TaskStatusEnums.SENIOR_APPROVAL)
|
||||
return result.Failed("این وظیفه اقدام تایید نشده دارد");
|
||||
|
||||
taskStatus.ImpossibilityStatus = editTaskStatus.ImpossibilityStatus;
|
||||
taskStatus.Task_Id = editTaskStatus.Task_Id;
|
||||
|
||||
if (!editTaskStatus.IsApproval)
|
||||
{
|
||||
taskStatus.ImpossibilityDescription = editTaskStatus.ImpossibilityDescription;
|
||||
taskStatus.ImpossibilityRegUserId = _authHelper.CurrentAccountId();
|
||||
taskStatus.ImpossibilityRegDate = DateTime.Now;
|
||||
}
|
||||
|
||||
_taskStatusRepository.CreateOrUpdateTaskStatus(taskStatus);
|
||||
|
||||
return result.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult SetDone(EditTaskStatus editTaskStatus)
|
||||
{
|
||||
var result = new OperationResult();
|
||||
EditTaskStatus taskStatus = new EditTaskStatus();
|
||||
|
||||
var taskStatuses = _taskStatusRepository.Search(new TaskStatusSearchModel { TaskId = editTaskStatus.Task_Id });
|
||||
|
||||
if (taskStatuses.Count != 0)
|
||||
taskStatus = taskStatuses[0];
|
||||
|
||||
if (CheckTaskHasUnapprovalStatus(taskStatus) &&
|
||||
editTaskStatus.DoneStatus != TaskStatusEnums.MANAGER_APPROVAL &&
|
||||
editTaskStatus.DoneStatus != TaskStatusEnums.SENIOR_APPROVAL)
|
||||
return result.Failed("این وظیفه اقدام تایید نشده دارد");
|
||||
|
||||
taskStatus.DoneStatus = editTaskStatus.DoneStatus;
|
||||
taskStatus.Task_Id = editTaskStatus.Task_Id;
|
||||
|
||||
if (!editTaskStatus.IsApproval)
|
||||
{
|
||||
taskStatus.DoneRegUserId = _authHelper.CurrentAccountId();
|
||||
taskStatus.DoneRegDate = DateTime.Now;
|
||||
}
|
||||
|
||||
_taskStatusRepository.CreateOrUpdateTaskStatus(taskStatus);
|
||||
|
||||
return result.Succcedded();
|
||||
}
|
||||
|
||||
private bool CheckTaskHasUnapprovalStatus(EditTaskStatus taskStatus)
|
||||
{
|
||||
if(taskStatus.DeadlineExtentionStatus == TaskStatusEnums.UNAPPROVED ||
|
||||
taskStatus.DoneStatus == TaskStatusEnums.UNAPPROVED ||
|
||||
taskStatus.ImpossibilityStatus == TaskStatusEnums.UNAPPROVED)
|
||||
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework_b.Application;
|
||||
using Company.Domain.TaskTitle;
|
||||
using CompanyManagment.App.Contracts.TaskTitle;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class TaskTitleApplication : ITaskTitleApplication
|
||||
{
|
||||
private readonly ITaskTitleRepository _taskTitleRepository;
|
||||
|
||||
public TaskTitleApplication(ITaskTitleRepository taskTitleRepository)
|
||||
{
|
||||
_taskTitleRepository = taskTitleRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateTaskTitle command)
|
||||
{
|
||||
var result = new OperationResult();
|
||||
|
||||
_taskTitleRepository.Create(new TaskTitle(command.Title));
|
||||
_taskTitleRepository.SaveChanges();
|
||||
|
||||
return result.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult Edit(EditTaskTitle command)
|
||||
{
|
||||
var result = new OperationResult();
|
||||
|
||||
var taskTitle = _taskTitleRepository.Get(command.Id);
|
||||
|
||||
taskTitle.Edit(command.Title);
|
||||
|
||||
_taskTitleRepository.SaveChanges();
|
||||
|
||||
return result.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult Remove(long id)
|
||||
{
|
||||
var result = new OperationResult();
|
||||
|
||||
_taskTitleRepository.Remove(id);
|
||||
|
||||
return result.Succcedded();
|
||||
}
|
||||
|
||||
public EditTaskTitle GetDetails(long id)
|
||||
{
|
||||
return _taskTitleRepository.GetDetails(id);
|
||||
}
|
||||
|
||||
public List<TaskTitleViewModel> Search(TaskTitleSearchModel searchModel)
|
||||
{
|
||||
|
||||
return _taskTitleRepository.Search(searchModel);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -72,9 +72,6 @@ using Company.Domain.RollCallPlanAgg;
|
||||
using Company.Domain.RollCallServiceAgg;
|
||||
using Company.Domain.SmsResultAgg;
|
||||
using Company.Domain.SubtitleAgg;
|
||||
using Company.Domain.Task;
|
||||
using Company.Domain.TaskStatus;
|
||||
using Company.Domain.TaskTitle;
|
||||
using Company.Domain.TaxJobCategoryAgg;
|
||||
using Company.Domain.TaxLeftWorkCategoryAgg;
|
||||
using Company.Domain.TaxLeftWorkItemAgg;
|
||||
@@ -128,9 +125,9 @@ public class CompanyContext : DbContext
|
||||
public DbSet<FileState> FileStates { get; set; }
|
||||
public DbSet<FileAlert> FileAlerts { get; set; }
|
||||
//-------Task Manager----------------------------
|
||||
public DbSet<Task> Tasks { get; set; }
|
||||
public DbSet<TaskStatus> TaskStatuses { get; set; }
|
||||
public DbSet<TaskTitle> TaskTitles { get; set; }
|
||||
//public DbSet<Task> Tasks { get; set; }
|
||||
//public DbSet<TaskStatus> TaskStatuses { get; set; }
|
||||
//public DbSet<TaskTitle> TaskTitles { get; set; }
|
||||
//-------Main-Project----------------------------
|
||||
public DbSet<TaxLeftWorkItem> TaxLeftWorkItems { get; set; }
|
||||
public DbSet<TaxLeftWorkCategory> TaxLeftWorkCategories { get; set; }
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.ClassifiedSalaryAgg;
|
||||
using Company.Domain.ClassifiedSalaryAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.ContractingPartyAccountAgg;
|
||||
using Company.Domain.ContractingPartyAccountAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.EmployeeComputeOptionsAgg;
|
||||
using Company.Domain.EmployeeComputeOptionsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.GroupPlanJobItemAgg;
|
||||
using Company.Domain.GroupPlanJobItemAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.GroupPlanAgg;
|
||||
using Company.Domain.GroupPlanAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.InstitutionPlanAgg;
|
||||
using Company.Domain.InstitutionPlanAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.InsuranceYearlySalaryAgg;
|
||||
using Company.Domain.InsuranceYearlySalaryAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.PaymentToEmployeeItemAgg;
|
||||
using Company.Domain.PaymentToEmployeeItemAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.PaymentToEmployeeAgg;
|
||||
using Company.Domain.PaymentToEmployeeAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.RollCallAgg;
|
||||
using Company.Domain.RollCallAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.RollCallPlanAgg;
|
||||
using Company.Domain.RollCallPlanAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.RollCallServiceAgg;
|
||||
using Company.Domain.RollCallServiceAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
using Company.Domain.Task;
|
||||
using Company.Domain.TaskStatus;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class TaskMapping : IEntityTypeConfiguration<Task>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Task> builder)
|
||||
{
|
||||
builder.ToTable("Tasks");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
//TODO
|
||||
//add validations
|
||||
|
||||
//builder.HasOne(x => x.TaskTitle).WithMany(x => x.TasksList).HasForeignKey(x => x.TaskTitle_Id);
|
||||
builder.HasOne(x => x.TaskStatus).WithOne(x => x.Task).HasForeignKey<TaskStatus>(x => x.Task_Id);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using Company.Domain.TaskStatus;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class TaskStatusMapping : IEntityTypeConfiguration<TaskStatus>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<TaskStatus> builder)
|
||||
{
|
||||
builder.ToTable("TaskStatuses");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
//TODO
|
||||
//add validations
|
||||
|
||||
builder.HasOne(x => x.Task).WithOne(x => x.TaskStatus).HasForeignKey<TaskStatus>(x => x.Task_Id);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using Company.Domain.TaskTitle;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class TaskTitleMapping : IEntityTypeConfiguration<TaskTitle>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<TaskTitle> builder)
|
||||
{
|
||||
builder.ToTable("TaskTitles");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
//TODO
|
||||
//add validations
|
||||
|
||||
//builder.HasMany(x => x.TasksList).WithOne(x => x.TaskTitle).HasForeignKey(x => x.TaskTitle_Id);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.WorkshopPlanEmployeeAgg;
|
||||
using Company.Domain.WorkshopPlanEmployeeAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.WorkshopPlanAgg;
|
||||
using Company.Domain.WorkshopPlanAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
||||
5572
CompanyManagment.EFCore/Migrations/20240709155634_OlTaskRemoved.Designer.cs
generated
Normal file
5572
CompanyManagment.EFCore/Migrations/20240709155634_OlTaskRemoved.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class OlTaskRemoved : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "TaskStatuses");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Tasks");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "TaskTitles");
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TaskTitles",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Title = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TaskTitles", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tasks",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Commander_Id = table.Column<long>(type: "bigint", nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Customer = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Customer_Id = table.Column<long>(type: "bigint", nullable: false),
|
||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
SeniorUser_Id = table.Column<long>(type: "bigint", nullable: false),
|
||||
TaskDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
TaskTitle = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
TaskTitleid = table.Column<long>(type: "bigint", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Tasks", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Tasks_TaskTitles_TaskTitleid",
|
||||
column: x => x.TaskTitleid,
|
||||
principalTable: "TaskTitles",
|
||||
principalColumn: "id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TaskStatuses",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Task_Id = table.Column<long>(type: "bigint", nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DeadlineExtentionDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeadlineExtentionRegDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeadlineExtentionRegUserId = table.Column<long>(type: "bigint", nullable: false),
|
||||
DeadlineExtentionStatus = table.Column<short>(type: "smallint", nullable: false),
|
||||
DoneRegDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DoneRegUserId = table.Column<long>(type: "bigint", nullable: false),
|
||||
DoneStatus = table.Column<short>(type: "smallint", nullable: false),
|
||||
ImpossibilityDescription = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
ImpossibilityRegDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
ImpossibilityRegUserId = table.Column<long>(type: "bigint", nullable: false),
|
||||
ImpossibilityStatus = table.Column<short>(type: "smallint", nullable: false),
|
||||
ReferralRegDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
ReferralRegUserId = table.Column<long>(type: "bigint", nullable: false),
|
||||
ReferralStatus = table.Column<short>(type: "smallint", nullable: false),
|
||||
ReferralUserId = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TaskStatuses", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_TaskStatuses_Tasks_Task_Id",
|
||||
column: x => x.Task_Id,
|
||||
principalTable: "Tasks",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Tasks_TaskTitleid",
|
||||
table: "Tasks",
|
||||
column: "TaskTitleid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TaskStatuses_Task_Id",
|
||||
table: "TaskStatuses",
|
||||
column: "Task_Id",
|
||||
unique: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3070,6 +3070,14 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("TypeDestinationBankNumber")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("TypeSourceBankNumber")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<long>("WorkshopId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -3529,134 +3537,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("TextManager_Subtitle", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.Task.Task", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<long>("Commander_Id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Customer")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<long>("Customer_Id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<long>("SeniorUser_Id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime?>("TaskDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("TaskTitle")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<long?>("TaskTitleid")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("TaskTitleid");
|
||||
|
||||
b.ToTable("Tasks", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TaskStatus.TaskStatus", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DeadlineExtentionDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DeadlineExtentionRegDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long>("DeadlineExtentionRegUserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<short>("DeadlineExtentionStatus")
|
||||
.HasColumnType("smallint");
|
||||
|
||||
b.Property<DateTime?>("DoneRegDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long>("DoneRegUserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<short>("DoneStatus")
|
||||
.HasColumnType("smallint");
|
||||
|
||||
b.Property<string>("ImpossibilityDescription")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime?>("ImpossibilityRegDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long>("ImpossibilityRegUserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<short>("ImpossibilityStatus")
|
||||
.HasColumnType("smallint");
|
||||
|
||||
b.Property<DateTime?>("ReferralRegDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long>("ReferralRegUserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<short>("ReferralStatus")
|
||||
.HasColumnType("smallint");
|
||||
|
||||
b.Property<long>("ReferralUserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("Task_Id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("Task_Id")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("TaskStatuses", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TaskTitle.TaskTitle", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("TaskTitles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TaxJobCategoryAgg.TaxJobCategory", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -5276,24 +5156,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("EntityOriginalTitle");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.Task.Task", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.TaskTitle.TaskTitle", null)
|
||||
.WithMany("TasksList")
|
||||
.HasForeignKey("TaskTitleid");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TaskStatus.TaskStatus", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.Task.Task", "Task")
|
||||
.WithOne("TaskStatus")
|
||||
.HasForeignKey("Company.Domain.TaskStatus.TaskStatus", "Task_Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TaxLeftWorkCategoryAgg.TaxLeftWorkCategory", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop")
|
||||
@@ -5632,16 +5494,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("Subtitles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.Task.Task", b =>
|
||||
{
|
||||
b.Navigation("TaskStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TaskTitle.TaskTitle", b =>
|
||||
{
|
||||
b.Navigation("TasksList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TaxLeftWorkCategoryAgg.TaxLeftWorkCategory", b =>
|
||||
{
|
||||
b.Navigation("TaxLeftWorkItemList");
|
||||
|
||||
@@ -2,20 +2,14 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.ContractingPartyAccountAgg;
|
||||
using Company.Domain.empolyerAgg;
|
||||
using Company.Domain.InstitutionContractAgg;
|
||||
using Company.Domain.WorkshopAccountAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.FinancialStatment;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.LeftWorkInsurance;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PersianTools.Core;
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.PaymentToEmployeeItemAgg;
|
||||
using CompanyManagment.App.Contracts.PaymentToEmployee;
|
||||
using CompanyManagment.EFCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
|
||||
@@ -1,18 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Company.Domain.PaymentToEmployeeAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.PaymentToEmployee;
|
||||
using CompanyManagment.EFCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository
|
||||
{
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
using _0_Framework.Application;
|
||||
using AccountMangement.Infrastructure.EFCore;
|
||||
using Company.Domain.ReportClientAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.ReportClient;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
public class ReportClientRepository : IReportClientRepository
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
using MD.PersianDateTime.Standard;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
@@ -4,7 +4,6 @@ using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.RollCallPlanAgg;
|
||||
using CompanyManagment.App.Contracts.RollCallPlan;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.Task;
|
||||
using CompanyManagment.App.Contracts.Task;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class TaskRepository : RepositoryBase<long, Task>, ITaskRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
|
||||
public TaskRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public void Remove(long id)
|
||||
{
|
||||
var task = Get(id);
|
||||
|
||||
Remove(task);
|
||||
|
||||
SaveChanges();
|
||||
}
|
||||
|
||||
public List<TaskViewModel> Search(TaskSearchModel searchModel)
|
||||
{
|
||||
var query = _context.Tasks.Select(x => new TaskViewModel
|
||||
{
|
||||
Id = x.id,
|
||||
Commander_Id = x.Commander_Id,
|
||||
SeniorUser_Id = x.SeniorUser_Id,
|
||||
Customer_Id = x.Customer_Id,
|
||||
CustomerName = x.Customer,
|
||||
TaskTitle = x.TaskTitle,
|
||||
Description = x.Description,
|
||||
TaskDate = x.TaskDate.ToFarsi(),
|
||||
TaskGDate = x.TaskDate
|
||||
});
|
||||
|
||||
if (searchModel.Id != 0)
|
||||
{
|
||||
query = query.Where(x => x.Id == searchModel.Id);
|
||||
}
|
||||
|
||||
if (searchModel.RoleId != 0 && searchModel.RoleId != 1)
|
||||
{
|
||||
query = query.Where(x => x.SeniorUser_Id == searchModel.AccountId || x.Commander_Id == searchModel.AccountId);
|
||||
}
|
||||
|
||||
return query.OrderBy(x => x.TaskGDate).ToList();
|
||||
}
|
||||
|
||||
public void UpdateTask(Task editTask)
|
||||
{
|
||||
//var task = Get(editTask.id);
|
||||
|
||||
//task.Edit(editTask.Commander_Id, editTask.SeniorUser_Id, editTask.TaskTitle_Id, editTask.Customer, editTask.Customer_Id, editTask.TaskDate.ToGeorgianDateTime(), editTask.Description);
|
||||
|
||||
//SaveChanges();
|
||||
}
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.TaskStatus;
|
||||
using CompanyManagment.App.Contracts.TaskStatus;
|
||||
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class TaskStatusRepository : RepositoryBase<long, TaskStatus>, ITaskStatusRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
public TaskStatusRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public EditTaskStatus GetDetails(long id)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public EditTaskStatus GetDetails(long fileId, int boardTypeId)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Remove(long id)
|
||||
{
|
||||
}
|
||||
|
||||
public List<EditTaskStatus> Search(TaskStatusSearchModel searchModel)
|
||||
{
|
||||
var query = _context.TaskStatuses.Select(x => new EditTaskStatus
|
||||
{
|
||||
Id = x.id,
|
||||
ReferralStatus = x.ReferralStatus,
|
||||
ReferralUserId = x.ReferralUserId,
|
||||
ReferralRegDate = x.ReferralRegDate,
|
||||
ReferralRegUserId = x.ReferralRegUserId,
|
||||
DeadlineExtentionStatus = x.DeadlineExtentionStatus,
|
||||
DeadlineExtentionDate = x.DeadlineExtentionDate,
|
||||
DeadlineExtentionRegDate = x.DeadlineExtentionDate,
|
||||
DeadlineExtentionRegUserId = x.DeadlineExtentionRegUserId,
|
||||
ImpossibilityStatus = x.ImpossibilityStatus,
|
||||
ImpossibilityDescription = x.ImpossibilityDescription,
|
||||
ImpossibilityRegDate = x.ImpossibilityRegDate,
|
||||
ImpossibilityRegUserId = x.ImpossibilityRegUserId,
|
||||
DoneStatus = x.DoneStatus,
|
||||
DoneRegDate = x.DoneRegDate,
|
||||
DoneRegUserId = x.DoneRegUserId,
|
||||
Task_Id = x.Task_Id
|
||||
});
|
||||
|
||||
if (searchModel.TaskId != 0)
|
||||
{
|
||||
query = query.Where(x => x.Task_Id == searchModel.TaskId);
|
||||
}
|
||||
|
||||
if (searchModel.ReferralUserId != 0)
|
||||
{
|
||||
query = query.Where(x => x.ReferralUserId == searchModel.ReferralUserId);
|
||||
}
|
||||
|
||||
return query.ToList();
|
||||
|
||||
}
|
||||
|
||||
public void CreateOrUpdateTaskStatus(EditTaskStatus editTaskStatus)
|
||||
{
|
||||
if (editTaskStatus.Id == 0)
|
||||
{
|
||||
var taskStatus = new TaskStatus
|
||||
(
|
||||
editTaskStatus.ReferralStatus,
|
||||
editTaskStatus.ReferralUserId,
|
||||
editTaskStatus.ReferralRegDate,
|
||||
editTaskStatus.ReferralRegUserId,
|
||||
editTaskStatus.DeadlineExtentionStatus,
|
||||
editTaskStatus.DeadlineExtentionDate,
|
||||
editTaskStatus.DeadlineExtentionRegDate,
|
||||
editTaskStatus.DeadlineExtentionRegUserId,
|
||||
editTaskStatus.ImpossibilityStatus,
|
||||
editTaskStatus.ImpossibilityDescription,
|
||||
editTaskStatus.ImpossibilityRegDate,
|
||||
editTaskStatus.ImpossibilityRegUserId,
|
||||
editTaskStatus.DoneStatus,
|
||||
editTaskStatus.DoneRegDate,
|
||||
editTaskStatus.DoneRegUserId,
|
||||
editTaskStatus.Task_Id
|
||||
);
|
||||
|
||||
Create(taskStatus);
|
||||
}
|
||||
else
|
||||
{
|
||||
var savedTaskStatus = Get(editTaskStatus.Id);
|
||||
|
||||
savedTaskStatus.Edit
|
||||
(
|
||||
editTaskStatus.ReferralStatus,
|
||||
editTaskStatus.ReferralUserId,
|
||||
editTaskStatus.ReferralRegDate,
|
||||
editTaskStatus.ReferralRegUserId,
|
||||
editTaskStatus.DeadlineExtentionStatus,
|
||||
editTaskStatus.DeadlineExtentionDate,
|
||||
editTaskStatus.DeadlineExtentionRegDate,
|
||||
editTaskStatus.DeadlineExtentionRegUserId,
|
||||
editTaskStatus.ImpossibilityStatus,
|
||||
editTaskStatus.ImpossibilityDescription,
|
||||
editTaskStatus.ImpossibilityRegDate,
|
||||
editTaskStatus.ImpossibilityRegUserId,
|
||||
editTaskStatus.DoneStatus,
|
||||
editTaskStatus.DoneRegDate,
|
||||
editTaskStatus.DoneRegUserId,
|
||||
editTaskStatus.Task_Id
|
||||
);
|
||||
}
|
||||
SaveChanges();
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.TaskTitle;
|
||||
using CompanyManagment.App.Contracts.TaskTitle;
|
||||
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class TaskTitleRepository : RepositoryBase<long, TaskTitle>, ITaskTitleRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
public TaskTitleRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public EditTaskTitle GetDetails(long id)
|
||||
{
|
||||
return _context.TaskTitles.Select(x => new EditTaskTitle
|
||||
{
|
||||
Id = x.id,
|
||||
Title = x.Title
|
||||
}).FirstOrDefault(x => x.Id == id);
|
||||
}
|
||||
|
||||
public void Remove(long id)
|
||||
{
|
||||
var taskTitle = Get(id);
|
||||
|
||||
Remove(taskTitle);
|
||||
|
||||
SaveChanges();
|
||||
}
|
||||
|
||||
public List<TaskTitleViewModel> Search(TaskTitleSearchModel searchModel)
|
||||
{
|
||||
var query = _context.TaskTitles.Select(x => new TaskTitleViewModel
|
||||
{
|
||||
Id = x.id,
|
||||
Title = x.Title
|
||||
});
|
||||
|
||||
//TODO if
|
||||
if (!string.IsNullOrEmpty(searchModel.Title))
|
||||
{
|
||||
query = query.Where(x => x.Title.Contains(searchModel.Title));
|
||||
}
|
||||
|
||||
return query.OrderByDescending(x => x.Id).ToList();
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,6 @@ using _0_Framework.InfraStructure;
|
||||
using Company.Domain.TaxJobCategoryAgg;
|
||||
using CompanyManagment.App.Contracts.TaxJobCategory;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class TaxJobCategoryRepository : RepositoryBase<long, TaxJobCategory>, ITaxJobCategoryRepository
|
||||
|
||||
@@ -7,7 +7,6 @@ using Company.Domain.TaxLeftWorkCategoryAgg;
|
||||
using CompanyManagment.App.Contracts.TaxLeftWorkCategory;
|
||||
using CompanyManagment.App.Contracts.TaxLeftWorkItem;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.TaxLeftWorkItemAgg;
|
||||
using CompanyManagment.App.Contracts.TaxLeftWorkItem;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.WorkingHoursItemsAgg;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.WorkingHoursItems;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
@@ -21,9 +21,7 @@ using Company.Domain.FileEmployerAgg;
|
||||
using Company.Domain.FileState;
|
||||
using Company.Domain.FileTiming;
|
||||
using Company.Domain.FileTitle;
|
||||
using Company.Domain.Task;
|
||||
using Company.Domain.TaskStatus;
|
||||
using Company.Domain.TaskTitle;
|
||||
|
||||
using Company.Domain.HolidayAgg;
|
||||
using Company.Domain.HolidayItemAgg;
|
||||
using Company.Domain.JobAgg;
|
||||
@@ -49,9 +47,6 @@ using Company.Domain.YearlySalaryItemsAgg;
|
||||
using Company.Domain.YearlysSalaryTitleAgg;
|
||||
using CompanyManagment.App.Contracts.Board;
|
||||
using CompanyManagment.App.Contracts.Chapter;
|
||||
using CompanyManagment.App.Contracts.Task;
|
||||
using CompanyManagment.App.Contracts.TaskStatus;
|
||||
using CompanyManagment.App.Contracts.TaskTitle;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Contact2;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
@@ -177,14 +172,14 @@ public class PersonalBootstrapper
|
||||
{
|
||||
//----Task-Manager-Project---------------------------------
|
||||
|
||||
services.AddTransient<ITaskApplication, TaskApplication>();
|
||||
services.AddTransient<ITaskRepository, TaskRepository>();
|
||||
//services.AddTransient<ITaskApplication, TaskApplication>();
|
||||
//services.AddTransient<ITaskRepository, TaskRepository>();
|
||||
|
||||
services.AddTransient<ITaskStatusApplication, TaskStatusApplication>();
|
||||
services.AddTransient<ITaskStatusRepository, TaskStatusRepository>();
|
||||
//services.AddTransient<ITaskStatusApplication, TaskStatusApplication>();
|
||||
//services.AddTransient<ITaskStatusRepository, TaskStatusRepository>();
|
||||
|
||||
services.AddTransient<ITaskTitleApplication, TaskTitleApplication>();
|
||||
services.AddTransient<ITaskTitleRepository, TaskTitleRepository>();
|
||||
//services.AddTransient<ITaskTitleApplication, TaskTitleApplication>();
|
||||
//services.AddTransient<ITaskTitleRepository, TaskTitleRepository>();
|
||||
//------MAIN-PROJECT----------------
|
||||
services.AddTransient<IPersonalContractingPartyApp, PersonalContractingPartyApplication>();
|
||||
services.AddTransient<IPersonalContractingPartyRepository, PersonalContractingPartyRepository>();
|
||||
|
||||
@@ -1,312 +0,0 @@
|
||||
@model CompanyManagment.App.Contracts.Task.EditTask
|
||||
@inject _0_Framework.Application.IAuthHelper AuthHelper;
|
||||
@{
|
||||
var currentAccount = AuthHelper.CurrentAccountInfo();
|
||||
}
|
||||
@{
|
||||
<style>
|
||||
.Width--200 {
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.select2-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
border-top: unset !important;
|
||||
}
|
||||
|
||||
.modal .modal-dialog .modal-content .modal-footer {
|
||||
padding-top: unset !important;
|
||||
}
|
||||
|
||||
p {
|
||||
direction: ltr !important;
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
input[type=radio]:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.error {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
<style>
|
||||
.datemonth {
|
||||
margin: auto;
|
||||
margin-top: 12px;
|
||||
background-color: #dcdcdc;
|
||||
border-radius: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
.textmonth {
|
||||
color: #000;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.rowmonth{
|
||||
vertical-align: middle !important;
|
||||
line-height: 36px;
|
||||
}
|
||||
.transparent-background {
|
||||
background-color: rgba(255, 0, 0, 0);
|
||||
border-color: rgba(255, 0, 0, 0);
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<div class="modal-header" style="text-align:center">
|
||||
<button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
|
||||
<form asp-page="./Index" asp-page-handler="CreateOrEdit" id="taskForm" autocomplete="off" method="post" data-ajax="true" data-callback="" data-action="Refresh">
|
||||
<input type="text" asp-for="Commander_Id" value="@currentAccount.Id" hidden>
|
||||
<input type="text" asp-for="Id" value="@Model.Id" hidden>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
|
||||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> ایجاد وظیفه </legend>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> انتخاب کاربر </label>
|
||||
|
||||
<select class="form-control select-city js-placeholder" asp-for="SeniorUser_Id">
|
||||
<option value="">لطفا انتخاب کنید ...</option>
|
||||
@foreach (var item in Model.SeniorUsers)
|
||||
{
|
||||
<option value="@item.Id">@item.Fullname</option>
|
||||
}
|
||||
</select>
|
||||
|
||||
<span asp-validation-for="SeniorUser_Id" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<label class="control-label" asp-for="Customer"> طرف وظیفه </label>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" asp-for="Customer" onfocusout="removeExtraData()">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select class="form-control select-city js-placeholder" asp-for="Customer_Id" onchange="removeExtraData()">
|
||||
<option value="0">لطفا انتخاب کنید ...</option>
|
||||
@foreach (var item in Model.Customers)
|
||||
{
|
||||
<option value="@item.Id">@item.FullName</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label class="control-label" asp-for="Customer"> عنوان وظیفه </label>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" asp-for="TaskTitle" onfocusout="removeExtraData()">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select class="form-control select-city" asp-for="SelectTaskTitle" onchange="removeExtraData()">
|
||||
<option value="0">لطفا انتخاب کنید ...</option>
|
||||
@foreach (var item in Model.TaskTitles)
|
||||
{
|
||||
<option value="@item.Title">@item.Title</option>
|
||||
}
|
||||
</select>
|
||||
<span asp-validation-for="SelectTaskTitle" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label asp-for="Description" class="control-label"> توضیحات </label>
|
||||
<textarea class="form-control" asp-for="Description" style="width: 100%; max-width: 100% !important"></textarea>
|
||||
<span asp-validation-for="Description" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> تاریخ: </label>
|
||||
<input type="text" class="form-control date taskDate" dir="ltr" maxlength="10" onchange="validDate(this);" onfocusout="removeExtraData()" style="width: 100%; text-align: center" asp-for="TaskDate">
|
||||
<span asp-validation-for="TaskDate" class="error"></span>
|
||||
</div>
|
||||
<a class="btn btn-success btn-rounded waves-effect waves-light" onclick="UpdateDate(9)" style="width: 47%;">امروز</a>
|
||||
<a class="btn btn-success btn-rounded waves-effect waves-light" onclick="UpdateDate(0)" style="width: 47%;">فردا</a>
|
||||
<a class="btn btn-success btn-rounded waves-effect waves-light m-t-5" onclick="UpdateDate(1)" style="width: 47%;">پسفردا</a>
|
||||
<a class="btn btn-success btn-rounded waves-effect waves-light m-t-5" onclick="UpdateDate(2)" style="width: 47%;">اول هفته</a>
|
||||
<a class="btn btn-success btn-rounded waves-effect waves-light m-t-5" onclick="UpdateDate(4)" style="width: 47%;">اواسط هفته</a>
|
||||
<a class="btn btn-success btn-rounded waves-effect waves-light m-t-5" onclick="UpdateDate(3)" style="width: 47%;">اواخر هغته</a>
|
||||
|
||||
@if(!Model.IsEditMode)
|
||||
{
|
||||
<div class="datemonth">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon transparent-background" id="basic-addon2">از تاریخ</span>
|
||||
<input type="text" class="form-control date taskDate" maxlength="10" onchange="validDate(this);" onfocusout="removeExtraData()" aria-describedby="basic-addon2" style="width: 100%; text-align: center; border-radius:10px;" asp-for="TaskFromDate">
|
||||
</div>
|
||||
<div class="input-group m-t-5">
|
||||
<span class="input-group-addon transparent-background" id="basic-addon2">به مدت</span>
|
||||
@*<input type="number" class="form-control date" maxlength="10" aria-describedby="basic-addon2" style="width: 100%; text-align: center; border-radius:10px;" asp-for="TaskDate">*@
|
||||
<select class="form-control select-city" asp-for="TaskDuration">
|
||||
@for (var i = 1; i <= 60; i++)
|
||||
{
|
||||
<option value="@i">@i</option>
|
||||
}
|
||||
</select>
|
||||
<span class="input-group-addon transparent-background" id="basic-addon2">ماه</span>
|
||||
</div>
|
||||
<div class="col-md-12"></div>
|
||||
<div class="form-group m-t-5 m-b-0">
|
||||
<label class="control-label" style="float: right"> ارجاع به </label>
|
||||
<select class="form-control select-city js-placeholder" asp-for="ReferralRecipient_Id">
|
||||
<option value="0">لطفا انتخاب کنید ...</option>
|
||||
@foreach (var item in Model.ReferralRecipientUsers)
|
||||
{
|
||||
<option value="@item.Id">@item.Fullname</option>
|
||||
}
|
||||
</select>
|
||||
|
||||
<span asp-validation-for="ReferralRecipient_Id" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light pull-left">ذخیره</button>
|
||||
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5 pull-left" data-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$('.modal-dialog').addClass('modal-sm');
|
||||
$('.select-city').trigger('change');
|
||||
$('#TaskFromDate').persianDatepicker({
|
||||
//format: 'YYYY/MM/DD',
|
||||
//initialValueType: 'persian',
|
||||
initialValue: false,
|
||||
altField: '#TaskFromDate',
|
||||
//changeDay: true,
|
||||
//changeMonth: true,
|
||||
//changeYear: true,
|
||||
//'position': [-270, 25],
|
||||
autoClose: true,
|
||||
|
||||
calendar: {
|
||||
persian: {
|
||||
locale: 'fa'
|
||||
//leapYearMode: 'astronomical'
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#TaskDate').persianDatepicker({
|
||||
format: 'YYYY/MM/DD',
|
||||
//initialValueType: 'persian',
|
||||
initialValue: false,
|
||||
//format: 'YYYY/MM/DD',
|
||||
//initialValueType: 'persian',
|
||||
//initialValue: false,
|
||||
//altField: '#TaskDate',
|
||||
//'position': [-270, 25],
|
||||
autoClose: true,
|
||||
|
||||
calendar: {
|
||||
persian: {
|
||||
locale: 'fa'
|
||||
//leapYearMode: 'astronomical'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
$('.modal').on('hidden.bs.modal', function() {
|
||||
$('.modal-dialog').removeClass('modal-lg');
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function UpdateDate(type = null) {
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("./Index", "Date")',
|
||||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||||
data: { "type": type },
|
||||
|
||||
success: function(response) {
|
||||
$('#TaskDate').val(response.date);
|
||||
$('#TaskDate').css('background-color', '#fff')
|
||||
$('#taskForm button[type=submit]').attr('disabled', false)
|
||||
},
|
||||
failure: function(response) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function removeExtraData() {
|
||||
|
||||
$('#TaskDate').focusout(function() {
|
||||
|
||||
if ($(this).val() != null || $(this).val() != 0) {
|
||||
|
||||
$('#TaskFromDate').val("")
|
||||
}
|
||||
})
|
||||
|
||||
$('#TaskFromDate').focusout(function() {
|
||||
|
||||
if ($(this).val() != null || $(this).val() != 0) {
|
||||
|
||||
$('#TaskDate').val("")
|
||||
}
|
||||
})
|
||||
|
||||
$('#Customer').focusout(function() {
|
||||
|
||||
if ($(this).val() != null) {
|
||||
|
||||
$('#Customer_Id').val("0").trigger('change')
|
||||
}
|
||||
})
|
||||
|
||||
$('#Customer_Id').change(function() {
|
||||
console.log($(this).val())
|
||||
if ($(this).val() != "0") {
|
||||
|
||||
$('#Customer').val("")
|
||||
}
|
||||
})
|
||||
|
||||
$('#TaskTitle').focusout(function() {
|
||||
|
||||
if ($(this).val() != null) {
|
||||
|
||||
$('#SelectTaskTitle').val("0").trigger('change')
|
||||
}
|
||||
})
|
||||
|
||||
$('#SelectTaskTitle').change(function() {
|
||||
|
||||
if ($(this).val() != "0") {
|
||||
|
||||
$('#TaskTitle').val("")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -1,104 +0,0 @@
|
||||
@model CompanyManagment.App.Contracts.TaskTitle.EditTaskTitle
|
||||
@inject _0_Framework.Application.IAuthHelper AuthHelper;
|
||||
|
||||
@{
|
||||
<style>
|
||||
.Width--200 {
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.select2-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
border-top: unset !important;
|
||||
}
|
||||
|
||||
.modal .modal-dialog .modal-content .modal-footer {
|
||||
padding-top: unset !important;
|
||||
}
|
||||
|
||||
p {
|
||||
direction: ltr !important;
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
input[type=radio]:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.error {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
<style>
|
||||
.datemonth {
|
||||
margin: auto;
|
||||
margin-top: 12px;
|
||||
background-color: #dcdcdc;
|
||||
border-radius: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
.textmonth {
|
||||
color: #000;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.rowmonth{
|
||||
vertical-align: middle !important;
|
||||
line-height: 36px;
|
||||
}
|
||||
.transparent-background {
|
||||
background-color: rgba(255, 0, 0, 0);
|
||||
border-color: rgba(255, 0, 0, 0);
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<div class="modal-header" style="text-align:center">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
|
||||
<form asp-page="./TaskTitle" asp-page-handler="CreateOrEditTaskTitle" id="taskForm" autocomplete="off" method="post" data-ajax="true" data-callback="" data-action="Refresh">
|
||||
<input type="text" asp-for="Id" hidden>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
|
||||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> عنوان وظیفه جدید </legend>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<label class="control-label" asp-for="Title"> عنوان وظیفه </label>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" asp-for="Title">
|
||||
<span asp-validation-for="Title" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
|
||||
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$('.modal-dialog').addClass('modal-sm');
|
||||
})
|
||||
|
||||
$('.modal').on('hidden.bs.modal', function() {
|
||||
$('.modal-dialog').removeClass('modal-lg');
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,295 +0,0 @@
|
||||
using _0_Framework_b.Application;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using CompanyManagment.App.Contracts.File1;
|
||||
using CompanyManagment.App.Contracts.Task;
|
||||
using CompanyManagment.App.Contracts.TaskStatus;
|
||||
using CompanyManagment.App.Contracts.TaskTitle;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http.Extensions;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Pages.Company.TaskManager
|
||||
{
|
||||
public class IndexModel : PageModel
|
||||
{
|
||||
public TaskSearchModel searchModel;
|
||||
public List<TaskViewModel> viewModels;
|
||||
public List<AccountViewModel> refferalUsers;
|
||||
|
||||
private readonly IFileApplication _fileApplication;
|
||||
private readonly ITaskTitleApplication _taskTitleApplication;
|
||||
private readonly ITaskApplication _taskApplication;
|
||||
private readonly ITaskStatusApplication _taskStatusApplication;
|
||||
private readonly IAccountApplication _accountApplication;
|
||||
private readonly _0_Framework.Application.IAuthHelper _authHelper;
|
||||
|
||||
public IndexModel(
|
||||
IFileApplication fileApplication,
|
||||
ITaskTitleApplication taskTitleApplication,
|
||||
ITaskApplication taskApplication,
|
||||
ITaskStatusApplication taskStatusApplication,
|
||||
IAccountApplication accountApplication,
|
||||
_0_Framework.Application.IAuthHelper authHelper)
|
||||
{
|
||||
_fileApplication = fileApplication;
|
||||
_taskTitleApplication = taskTitleApplication;
|
||||
_taskApplication = taskApplication;
|
||||
_taskStatusApplication = taskStatusApplication;
|
||||
_accountApplication = accountApplication;
|
||||
_authHelper = authHelper;
|
||||
_accountApplication = accountApplication;
|
||||
}
|
||||
|
||||
public void OnGet(TaskSearchModel searchModel)
|
||||
{
|
||||
var currentAccount = _authHelper.CurrentAccountInfo();
|
||||
|
||||
this.searchModel = new TaskSearchModel();
|
||||
|
||||
this.searchModel = searchModel;
|
||||
|
||||
var accounts = _accountApplication.Search(new AccountSearchModel());
|
||||
|
||||
this.searchModel.Commanders = accounts.Where(x => x.RoleId == 1).ToList();
|
||||
this.searchModel.SeniorUsers = accounts.Where(x => x.RoleId != 1).ToList();
|
||||
//this.searchModel.TaskTitles = _taskTitleApplication.Search(new TaskTitleSearchModel());
|
||||
|
||||
|
||||
if (searchModel.IsSearch)
|
||||
{
|
||||
viewModels = _taskApplication.Search(new TaskSearchModel { AccountId = currentAccount.Id, RoleId = currentAccount.RoleId });
|
||||
viewModels = _taskApplication.FilterData(viewModels, searchModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
viewModels = _taskApplication.Search(new TaskSearchModel { AccountId = currentAccount.Id, RoleId = currentAccount.RoleId });
|
||||
viewModels = viewModels.Where(x => !(
|
||||
x.TaskStatus.DoneStatus == TaskStatusEnums.SENIOR_APPROVAL ||
|
||||
x.TaskStatus.DoneStatus == TaskStatusEnums.MANAGER_APPROVAL))
|
||||
.Take(100).ToList();
|
||||
}
|
||||
|
||||
refferalUsers = _accountApplication.GetAccounts();
|
||||
}
|
||||
|
||||
|
||||
public IActionResult OnGetCreateOrEdit(long? Id)
|
||||
{
|
||||
var editTask = new EditTask();
|
||||
|
||||
if (Id != null)
|
||||
{
|
||||
editTask = _taskApplication.GetDetails((long) Id);
|
||||
editTask.IsEditMode = true;
|
||||
}
|
||||
|
||||
editTask.SeniorUsers = _accountApplication.GetAccounts().Where(x => x.RoleId != 1).ToList();
|
||||
editTask.ReferralRecipientUsers = editTask.SeniorUsers;
|
||||
editTask.Customers = _fileApplication.GetAllEmployers();
|
||||
editTask.TaskTitles = _taskTitleApplication.Search(new TaskTitleSearchModel());
|
||||
return Partial("./CreateOrEdit", editTask);
|
||||
}
|
||||
|
||||
public IActionResult OnPostCreateOrEdit(EditTask createTask)
|
||||
{
|
||||
var result = new OperationResult();
|
||||
|
||||
if (createTask.TaskFromDate == null && createTask.TaskDate == null)
|
||||
return new JsonResult(result.Failed("هردو فیلد تاریخ نباید خالی باشد"));
|
||||
|
||||
if (createTask.Customer == null && createTask.Customer_Id == 0)
|
||||
return new JsonResult(result.Failed("طرف وظیفه را وارد کنید"));
|
||||
|
||||
if (createTask.TaskTitle == null && createTask.SelectTaskTitle == "0")
|
||||
return new JsonResult(result.Failed("عنوان وظیفه را وارد کنید"));
|
||||
|
||||
if (createTask.TaskTitle == null)
|
||||
createTask.TaskTitle = createTask.SelectTaskTitle;
|
||||
|
||||
if (createTask.Id == 0)
|
||||
result = _taskApplication.Create(createTask);
|
||||
|
||||
else
|
||||
{
|
||||
//var task = _taskApplication.GetDetails(createTask.Id);
|
||||
result = _taskApplication.Edit(createTask);
|
||||
}
|
||||
|
||||
return new JsonResult(result.Succcedded());
|
||||
}
|
||||
|
||||
public JsonResult OnPostDeleteTask(int id)
|
||||
{
|
||||
var result = _taskApplication.Remove(id);
|
||||
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
public JsonResult OnPostDeleteTasks(List<int> taskIds)
|
||||
{
|
||||
foreach(var id in taskIds)
|
||||
{
|
||||
_taskApplication.Remove(id);
|
||||
}
|
||||
|
||||
return new JsonResult(new OperationResult().Succcedded());
|
||||
|
||||
}
|
||||
|
||||
public JsonResult OnPostDate(int type)
|
||||
{
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
date = _taskApplication.GetDate(type).Substring(0, 10)
|
||||
});
|
||||
}
|
||||
|
||||
public JsonResult OnPostSetRefferalUser(int refferalUserId, int taskId)
|
||||
{
|
||||
var taskStatus = new EditTaskStatus
|
||||
{
|
||||
ReferralStatus = TaskStatusEnums.MANAGER_APPROVAL,
|
||||
ReferralUserId = refferalUserId,
|
||||
ReferralRegDate = DateTime.Now,
|
||||
ReferralRegUserId = _authHelper.CurrentAccountId(),
|
||||
Task_Id = taskId
|
||||
};
|
||||
|
||||
|
||||
var result = _taskStatusApplication.SetRefferal(taskStatus);
|
||||
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
public JsonResult OnPostSetRefferalUserApproval(int taskId, bool approval)
|
||||
{
|
||||
var taskStatus = new EditTaskStatus
|
||||
{
|
||||
ReferralStatus = approval == true ? TaskStatusEnums.MANAGER_APPROVAL : TaskStatusEnums.REJECTED,
|
||||
Task_Id = taskId,
|
||||
IsApproval = true
|
||||
};
|
||||
|
||||
if (approval == false)
|
||||
taskStatus.ReferralUserId = 0;
|
||||
|
||||
var result = _taskStatusApplication.SetRefferal(taskStatus);
|
||||
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
public JsonResult OnPostSetDeadlineDate(int taskId, string date)
|
||||
{
|
||||
try
|
||||
{
|
||||
var dateTime = date.ToGeorgianDateTime();
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
var ex = new JsonResult(new OperationResult().Failed("لطفا تاریخ را صحیح وارد کنید"));
|
||||
ex.StatusCode = 410;
|
||||
|
||||
return ex;
|
||||
}
|
||||
|
||||
var taskStatus = new EditTaskStatus
|
||||
{
|
||||
DeadlineExtentionStatus = TaskStatusEnums.UNAPPROVED,
|
||||
DeadlineExtentionDate = date.ToGeorgianDateTime(),
|
||||
Task_Id = taskId,
|
||||
};
|
||||
|
||||
var result = _taskStatusApplication.SetDeadline(taskStatus);
|
||||
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
public JsonResult OnPostSetDeadlineExtentionApproval(int taskId, bool approval)
|
||||
{
|
||||
var taskStatus = new EditTaskStatus
|
||||
{
|
||||
DeadlineExtentionStatus = approval == true ? TaskStatusEnums.MANAGER_APPROVAL : TaskStatusEnums.REJECTED,
|
||||
Task_Id = taskId,
|
||||
IsApproval = true,
|
||||
Approval = approval
|
||||
};
|
||||
|
||||
//if (approval == false)
|
||||
// taskStatus.DeadlineExtentionDate = null;
|
||||
|
||||
var result = _taskStatusApplication.SetDeadline(taskStatus);
|
||||
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
|
||||
public JsonResult OnPostSetImpossibility(string impossibilityDescription, int taskId)
|
||||
{
|
||||
var taskStatus = new EditTaskStatus
|
||||
{
|
||||
ImpossibilityStatus = TaskStatusEnums.UNAPPROVED,
|
||||
ImpossibilityDescription = impossibilityDescription,
|
||||
ImpossibilityRegDate = DateTime.Now,
|
||||
ImpossibilityRegUserId = _authHelper.CurrentAccountId(),
|
||||
Task_Id = taskId
|
||||
};
|
||||
|
||||
|
||||
var result = _taskStatusApplication.SetImpossibility(taskStatus);
|
||||
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
public JsonResult OnPostSetImpossibilityApproval(int taskId, bool approval)
|
||||
{
|
||||
var taskStatus = new EditTaskStatus
|
||||
{
|
||||
ImpossibilityStatus = approval == true ? TaskStatusEnums.MANAGER_APPROVAL : TaskStatusEnums.REJECTED,
|
||||
Task_Id = taskId,
|
||||
IsApproval = true,
|
||||
Approval = approval
|
||||
};
|
||||
|
||||
var result = _taskStatusApplication.SetImpossibility(taskStatus);
|
||||
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
public JsonResult OnPostSetDone(int taskId)
|
||||
{
|
||||
var taskStatus = new EditTaskStatus
|
||||
{
|
||||
DoneStatus = TaskStatusEnums.UNAPPROVED,
|
||||
DoneRegDate = DateTime.Now,
|
||||
DoneRegUserId = _authHelper.CurrentAccountId(),
|
||||
Task_Id = taskId
|
||||
};
|
||||
|
||||
|
||||
var result = _taskStatusApplication.SetDone(taskStatus);
|
||||
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
public JsonResult OnPostSetDoneApproval(int taskId, bool approval)
|
||||
{
|
||||
var taskStatus = new EditTaskStatus
|
||||
{
|
||||
DoneStatus = approval == true ? TaskStatusEnums.MANAGER_APPROVAL : TaskStatusEnums.REJECTED,
|
||||
Task_Id = taskId,
|
||||
IsApproval = true,
|
||||
Approval = approval
|
||||
};
|
||||
|
||||
var result = _taskStatusApplication.SetDone(taskStatus);
|
||||
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
@page
|
||||
@using _0_Framework.Application
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.TaskManager.TaskTitleModel
|
||||
@{
|
||||
Layout = "Shared/_AdminLayout";
|
||||
ViewData["title"] = "مدیریت وظایف";
|
||||
}
|
||||
<style>
|
||||
table tbody > tr > td p {
|
||||
font-size: 12px !important;
|
||||
text-align: center !important;
|
||||
vertical-align: middle;
|
||||
|
||||
}
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
}
|
||||
</style>
|
||||
<div>
|
||||
<div>
|
||||
<div class="col-sm-12 m-r-10">
|
||||
<p>
|
||||
<a id="btnPopModal" href="#showmodal=@Url.Page("/Company/TaskManager/TaskTitle", "CreateOrEditTaskTitle")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #0f9500; font-family: 'Web_Yekan' !important; color: #0f9500 !important; margin-right: 10px "> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> افزودن عنوان جدید </a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="panel-group panel-group-joined" id="accordion-test">
|
||||
|
||||
<div class="panel panel-default" style="border-radius: 15px !important;">
|
||||
<div class="panel-heading" style="background-color: #545353 !important">
|
||||
<h4 class="panel-title" style="color: #edebeb !important; display: inline;">
|
||||
<a data-toggle="collapse" data-parent="#accordion-test" href="#collapseOne" class="collapsed" style="display: inline;">
|
||||
جستجوی عناوین وظیفه
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
</div>
|
||||
<div id="collapseOne" class="panel-collapse collapse in ">
|
||||
<div class="panel-body" style="padding-top: 15px; padding-bottom: 15px;">
|
||||
@*===================================================================================================================*@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<form class="form-inline" role="form" asp-action="./taskTitle" method="GET" name="search-theme-form" id="search-theme-form" autocomplete="off">
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-4 pull-right m-b-15">
|
||||
<input asp-for="searchModel.Title" class="form-control" style="width: 100%" placeholder="عنوان وظیفه">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-top: 15px">
|
||||
|
||||
|
||||
<div class="col-lg-9">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3">
|
||||
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style="border-bottom-left-radius: 0px; border-top-left-radius: 0px; background-color: #950000; border-color: #950000; font-family: 'Web_Yekan' !important; margin-left: -3px"> <i class="fa fa-search" style="padding-left: 3px; font-size: 14px;"></i> جستجو</button>
|
||||
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5" style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #545353; border-color: #545353; font-family: 'Web_Yekan' !important;" asp-page="./TaskTitle">مشاهده همه</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست عناوین وظیفه </h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-sm-12 col-xs-12">
|
||||
<table id="datatable" class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
|
||||
<th style=" font-size: 10px; text-align: center"> عنوان وظیفه </th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@{ var i = 1; }
|
||||
@foreach(var item in Model.viewModels)
|
||||
{
|
||||
<tr>
|
||||
<td>@i</td>
|
||||
<td>
|
||||
<p>@item.Title</p>
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-warning pull-left m-rl-5 rad deact" href="#showmodal=@Url.Page("./TaskTitle", "CreateOrEditTaskTitle", new { Id = @item.Id })">
|
||||
<i class="fa fa-edit ionSize"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger pull-left m-rl-5 rad deact" onclick="DeleteTaskTitle(@item.Id)">
|
||||
<i class="fa faSize fa-trash"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
i++;
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@section Script {
|
||||
<script src="~/AdminTheme/assets/js/site4.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
|
||||
<script>
|
||||
|
||||
function DeleteTaskTitle(id) {
|
||||
|
||||
swal({
|
||||
title: "",
|
||||
text: "آیا از حذف وظیفه اطمینان دارید؟",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: true
|
||||
}, function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("./TaskTitle", "DeleteTaskTitle")',
|
||||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||||
data: { "id" : id },
|
||||
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
|
||||
setTimeout(function() {
|
||||
|
||||
location.reload();
|
||||
}, 1200)
|
||||
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response)
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
using _0_Framework_b.Application;
|
||||
using CompanyManagment.App.Contracts.TaskTitle;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Pages.Company.TaskManager
|
||||
{
|
||||
public class TaskTitleModel : PageModel
|
||||
{
|
||||
public List<TaskTitleViewModel> viewModels;
|
||||
public TaskTitleSearchModel searchModel;
|
||||
|
||||
public ITaskTitleApplication _taskTitleApplication { get; }
|
||||
|
||||
public TaskTitleModel(ITaskTitleApplication taskTitleApplication)
|
||||
{
|
||||
_taskTitleApplication = taskTitleApplication;
|
||||
}
|
||||
|
||||
|
||||
public void OnGet(TaskTitleSearchModel searchModel)
|
||||
{
|
||||
viewModels = _taskTitleApplication.Search(searchModel);
|
||||
}
|
||||
|
||||
public IActionResult OnGetCreateOrEditTaskTitle(long? Id)
|
||||
{
|
||||
var editTaskTitle = new EditTaskTitle();
|
||||
|
||||
if (Id != null)
|
||||
{
|
||||
editTaskTitle = _taskTitleApplication.GetDetails((long)Id);
|
||||
}
|
||||
|
||||
return Partial("CreateOrEditTaskTitle", editTaskTitle);
|
||||
}
|
||||
|
||||
public IActionResult OnPostCreateOrEditTaskTitle(EditTaskTitle createTaskTitle)
|
||||
{
|
||||
var result = new OperationResult();
|
||||
|
||||
if (createTaskTitle.Id == 0)
|
||||
result = _taskTitleApplication.Create(createTaskTitle);
|
||||
|
||||
else
|
||||
{
|
||||
//var task = _taskApplication.GetDetails(createTask.Id);
|
||||
result = _taskTitleApplication.Edit(createTaskTitle);
|
||||
}
|
||||
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
public IActionResult OnPostDeleteTaskTitle(long Id)
|
||||
{
|
||||
var result = _taskTitleApplication.Remove(Id);
|
||||
|
||||
return new JsonResult(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,333 +0,0 @@
|
||||
@model CompanyManagment.App.Contracts.TextManager.CreateTextManager
|
||||
@{
|
||||
}
|
||||
@{
|
||||
<style>
|
||||
.modal-dialog {
|
||||
width: 60% !important;
|
||||
}
|
||||
|
||||
.select2-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
border-top: unset !important;
|
||||
}
|
||||
|
||||
.modal .modal-dialog .modal-content .modal-footer {
|
||||
padding-top: unset !important;
|
||||
}
|
||||
|
||||
p {
|
||||
direction: ltr !important;
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
input[type=radio]:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.error {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
|
||||
textarea {
|
||||
overflow-y: scroll;
|
||||
resize: none; /* Remove this if you want the user to resize the textarea */
|
||||
}
|
||||
</style>
|
||||
}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<form asp-page="./Index" asp-page-handler="Create" autocomplete="off"
|
||||
method="post"
|
||||
data-ajax="true"
|
||||
data-callback=""
|
||||
data-action="Refresh"
|
||||
enctype="multipart/form-data">
|
||||
<div class="modal-body">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
|
||||
<legend style="top: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> تعریف متن </legend>
|
||||
<div class="col-md-12" style="border: 1px solid burlywood;border-radius: 11px;margin-bottom: 5px;padding: 10px;">
|
||||
<div class="form-group">
|
||||
<label class="control-label">ماژول ها :</label>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="button-group-pills text-center" data-toggle="buttons">
|
||||
@foreach (var item in Model.drpModule)
|
||||
{
|
||||
<label class="btn btn-default">
|
||||
<input type="checkbox" name="ModuleIds" value="@item.Value">
|
||||
<div>@item.Text</div>
|
||||
</label>
|
||||
}
|
||||
<span asp-validation-for="ModuleIds" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label asp-for="OriginalTitle_Id" class="control-label"> عنوان: </label>
|
||||
<select class="form-control select-city" asp-for="OriginalTitle_Id" asp-items='@Model.OriginalTitleViewModels' id="originalTitle1">
|
||||
<option value="-1"> عنوان را انتخاب کنید ... </option>
|
||||
</select>
|
||||
<span asp-validation-for="OriginalTitle_Id" class="error"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label asp-for="Subtitle_Id" class="control-label"> بخش: </label>
|
||||
<select class="form-control select-city" asp-for="Subtitle_Id" asp-items='@Model.SubtitleViewModels' id="subtitle1">
|
||||
<option value="0"> بخش</option>
|
||||
</select>
|
||||
<span asp-validation-for="Subtitle_Id" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label asp-for="NoteNumber" class="control-label"> فصل: </label>
|
||||
<select class="form-control select-city" asp-for="Chapter_Id" asp-items='@Model.ChapterViewModels' id="chapter1">
|
||||
<option value="0"> فصل</option>
|
||||
</select>
|
||||
<span asp-validation-for="Chapter_Id" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
|
||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||
<label asp-for="NoteNumber" class="control-label"> ماده: </label>
|
||||
<input type="text" class="form-control" asp-for="NoteNumber" placeholder="ماده">
|
||||
<span asp-validation-for="NoteNumber" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6" style="margin-bottom:20px;">
|
||||
<div class="form-group">
|
||||
|
||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||
<label asp-for="NoteNumber" class="control-label"> موضوع: </label>
|
||||
<input type="text" class="form-control" asp-for="SubjectTextManager" placeholder="موضوع">
|
||||
<span asp-validation-for="SubjectTextManager" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 m-b-30">
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||
<label asp-for="NumberTextManager" class="control-label"> تاریخ: </label>
|
||||
<input type="text" class="form-control" asp-for="DateTextManager" placeholder=" تاریخ" onkeyup="validDate1(this)" maxlength="10">
|
||||
<span id="spanmsg"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||
<label asp-for="NumberTextManager" class="control-label"> شماره: </label>
|
||||
<input type="text" class="form-control" asp-for="NumberTextManager" placeholder="شماره">
|
||||
<span asp-validation-for="NumberTextManager" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
|
||||
<textarea type="text" class="form-control" placeholder="نگارش متن" asp-for="Description" style=" height: 300px;"></textarea>
|
||||
<span asp-validation-for="Description" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<textarea type="text" class="form-control" asp-for="Paragraph" placeholder="نگارش محشا /پی نوشت" style=" height: 100px;"></textarea>
|
||||
<span asp-validation-for="Paragraph" class="error"></span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
|
||||
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<style>
|
||||
.button-group-pills .btn {
|
||||
border-radius: 20px;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 15px;
|
||||
margin-left: 10px;
|
||||
border-color: #bbbbbb;
|
||||
background-color: #FFF;
|
||||
color: #14a4be;
|
||||
}
|
||||
|
||||
.button-group-pills .btn.active {
|
||||
border-color: #14a4be;
|
||||
background-color: #14a4be;
|
||||
color: #FFF;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.button-group-pills .btn:hover {
|
||||
border-color: #158b9f;
|
||||
background-color: #158b9f;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
|
||||
button.multiselect.dropdown-toggle.btn.btn-default {
|
||||
border: -3px solid !important;
|
||||
border-color: black;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("#originalTitle1").change(function () {
|
||||
$("#subtitle1").empty();
|
||||
$("#chapter1").empty();
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/Admin/Company/TextManager?handler=SubtitleList',
|
||||
dataType: 'json',
|
||||
data: { OriginalTitle_Id: $("#originalTitle1").val() },
|
||||
success: function (result) {
|
||||
$("#subtitle1").append(' <option value="' + -1 + '">' +
|
||||
"نام بخش را انتخاب کنید" + '</option>');
|
||||
$.each(result, function (i, result) {
|
||||
$("#subtitle1").append(' <option value="' + result.id + '">' +
|
||||
result.subtitle + '</option>');
|
||||
});
|
||||
},
|
||||
error: function (ex) {
|
||||
alert('Error');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
$("#subtitle1").change(function () {
|
||||
$("#chapter1").empty();
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/Admin/Company/TextManager?handler=ChptereList',
|
||||
dataType: 'json',
|
||||
data: { Subtitle_Id: $("#subtitle1").val() },
|
||||
success: function (results) {
|
||||
$("#chapter1").append(' <option value="' + -1 + '">' +
|
||||
"فصل را انتخاب کنید" + '</option>');
|
||||
$.each(results, function (i, result) {
|
||||
$("#chapter1").append(' <option value="' + result.value + '">' +
|
||||
result.text + '</option>');
|
||||
});
|
||||
},
|
||||
error: function (ex) {
|
||||
alert('ffff');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
function keyupphoneNo() {
|
||||
/^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(event.key) ? ($("#spanmsg").html("شماره تماس صحیح است"), $("#spanmsg").css({
|
||||
color: "green"
|
||||
}
|
||||
)) : ($("#spanmsg").html("شماره تماس صحیح نیست"), $("#spanmsg").css({
|
||||
color: "red"
|
||||
}
|
||||
)), 11 != $("#phoneNo").val().length && ($("#spanmsg").html("شماره تماس صحیح نیست"), $("#spanmsg").css({
|
||||
color: "red"
|
||||
}
|
||||
))
|
||||
}
|
||||
function validDate1(inputField) {
|
||||
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function (str) {
|
||||
if (typeof str === 'string') {
|
||||
for (var i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField.value;
|
||||
var m1, m2;
|
||||
var y1, y2, y3, y4;
|
||||
var d1, d2;
|
||||
var s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
}
|
||||
var yRes = y1 + y2 + y3 + y4;
|
||||
var year = parseInt(yRes);
|
||||
var mRes = m1 + m2;
|
||||
var month = parseInt(mRes);
|
||||
var dRes = d1 + d2;
|
||||
var day = parseInt(dRes);
|
||||
var FixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
var isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(FixResult);
|
||||
if (isValid) {
|
||||
$("#spanmsg").empty();
|
||||
validCheck = true;
|
||||
|
||||
} else {
|
||||
$("#spanmsg").html("لطفا تاریخ را بصورت صحیح وارد کنید"), $("#spanmsg").css({
|
||||
color: "red"
|
||||
});
|
||||
|
||||
validCheck = false;
|
||||
|
||||
}
|
||||
return validCheck;
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -1,313 +0,0 @@
|
||||
@using _0_Framework.Application
|
||||
@using System.Security.Cryptography.X509Certificates
|
||||
@model CompanyManagment.App.Contracts.TextManager.EditTextManager
|
||||
@{
|
||||
<style>
|
||||
.modal .modal-dialog .modal-content {
|
||||
background-color: white !important;
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
max-width: 100%;
|
||||
width: 22.4cm;
|
||||
}
|
||||
/* @@page {
|
||||
size: 7in 9.25in;
|
||||
margin: 27mm 16mm 27mm 16mm;
|
||||
}*/
|
||||
@@page {
|
||||
size: A4;
|
||||
margin: 0mm;
|
||||
page-break-after: auto;
|
||||
}
|
||||
|
||||
@@media screen {
|
||||
#printSection {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.print:last-child {
|
||||
page-break-after: auto !important;
|
||||
}
|
||||
|
||||
@@media print {
|
||||
|
||||
body * {
|
||||
visibility: hidden;
|
||||
page-break-after: auto;
|
||||
|
||||
}
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
overflow: hidden;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#printSection, #printSection * {
|
||||
visibility: visible;
|
||||
page-break-after: auto;
|
||||
}
|
||||
|
||||
footer {
|
||||
page-break-after: auto;
|
||||
display: none;
|
||||
}
|
||||
|
||||
header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#printSection {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
page-break-after: auto;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.head {
|
||||
background-color: #cccccc !important;
|
||||
-webkit-print-color-adjust: exact;
|
||||
}
|
||||
|
||||
.radio-info input[type="radio"]:checked + label::after {
|
||||
background-color: black !important;
|
||||
-webkit-print-color-adjust: exact;
|
||||
}
|
||||
}
|
||||
|
||||
.col-xs-4, .col-xs-3, .col-xs-9,
|
||||
.col-xs-2, .col-xs-10, .col-xs-6,
|
||||
.col-xs-8, .col-xs-5, .col-xs-7,
|
||||
.col-xs-offset-1 {
|
||||
float: right !important;
|
||||
}
|
||||
|
||||
h5, h6 {
|
||||
margin: 5px 0px !important;
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.radio {
|
||||
display: inline-block;
|
||||
margin-top: -10px !important;
|
||||
}
|
||||
|
||||
.radio input[type=radio] {
|
||||
position: unset !important;
|
||||
}
|
||||
|
||||
textarea.form-control {
|
||||
height: 100px !important;
|
||||
}
|
||||
|
||||
.fontBold {
|
||||
font-family: IranYekanEXBold !important;
|
||||
}
|
||||
|
||||
.fontNumber {
|
||||
font-family: IranText !important;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
height: 99%;
|
||||
}
|
||||
|
||||
.row {
|
||||
margin-right: -10px !important;
|
||||
margin-left: -10px !important;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
<div class="modal-header" style="border-bottom: unset">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
<form asp-page="./Index" asp-page-handler="Details"
|
||||
method="post"
|
||||
data-ajax="true"
|
||||
data-callback=""
|
||||
data-action="Refresh"
|
||||
enctype="multipart/form-data">
|
||||
<div class="modal-body print" id="printThis" >
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<fieldset style="border: 1px solid black;
|
||||
padding: revert;
|
||||
border-radius: 10px;
|
||||
height: 28cm;
|
||||
margin: 3mm 5mm 0 5mm; ">
|
||||
|
||||
|
||||
<div class="row m-t-5">
|
||||
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">مشخصات کارفرما</h6></fieldset>
|
||||
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
|
||||
|
||||
|
||||
<legend style="top: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> تعریف بخش </legend>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label">ماژول ها :</label>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="button-group-pills text-center" data-toggle="buttons">
|
||||
@foreach (var item in Model.drpModule)
|
||||
{
|
||||
bool result = Model.ModuleIds.ToList().Contains(Convert.ToInt64(item.Value));
|
||||
<label class="btn btn-default @(result== true ? "active" : "") ">
|
||||
@if (result)
|
||||
{
|
||||
<input type="checkbox" name="ModuleIds" checked="checked" value="@item.Value">
|
||||
<div>@item.Text</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" name="ModuleIds" value="@item.Value">
|
||||
<div>@item.Text</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
</label>
|
||||
}
|
||||
<span asp-validation-for="ModuleIds" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="control-label">انتخاب عنوان: </label>
|
||||
<select class="form-control select-city" asp-for="OriginalTitle_Id" asp-items='@Model.OriginalTitleViewModels' id="originalTitle1">
|
||||
<option value="-1"> بخش را انتخاب کنید ... </option>
|
||||
</select>
|
||||
<span asp-validation-for="OriginalTitle_Id" class="error"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> انتخاب بخش :</label>
|
||||
<select class="form-control select-city" asp-for="Subtitle_Id" asp-items='@Model.SubtitleViewModels' id="subtitle1">
|
||||
<option value="0"> بخش</option>
|
||||
</select>
|
||||
<span asp-validation-for="Subtitle_Id" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> انتخاب فصل :</label>
|
||||
<select class="form-control select-city" asp-for="Chapter_Id" asp-items='@Model.ChapterViewModels' id="chapter1">
|
||||
<option value="0"> فصل</option>
|
||||
</select>
|
||||
<span asp-validation-for="Chapter_Id" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label asp-for="NoteNumber" class="control-label col-md-3 col-sm-3 col-xs-12">ماده : </label>
|
||||
<div class="col-md-9 col-sm-9 col-xs-12">
|
||||
<input type="text" class="form-control" asp-for="NoteNumber">
|
||||
<span asp-validation-for="NoteNumber" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label asp-for="SubjectTextManager" class="control-label col-md-3 col-sm-3 col-xs-12">موضوع : </label>
|
||||
<div class="col-md-9 col-sm-9 col-xs-12">
|
||||
<input type="text" class="form-control" asp-for="SubjectTextManager">
|
||||
<span asp-validation-for="SubjectTextManager" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 m-4" style="margin: 10px 0px 10px 0px; ">
|
||||
<div class="form-group">
|
||||
<label asp-for="DateTextManager" class="control-label col-md-7 col-sm-7 col-xs-12"> تاریخ : </label>
|
||||
<div class="col-md-5 col-sm-5 col-xs-12">
|
||||
<input type="text" class="form-control" asp-for="DateTextManager">
|
||||
<span asp-validation-for="DateTextManager" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 m-4" style="margin-top: 10px;">
|
||||
<div class="form-group">
|
||||
<label asp-for="NumberTextManager" class="control-label col-md-3 col-sm-3 col-xs-12"> شماره : </label>
|
||||
<div class="col-md-9 col-sm-9 col-xs-12">
|
||||
<input type="text" class="form-control" asp-for="NumberTextManager">
|
||||
<span asp-validation-for="NumberTextManager" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
|
||||
<textarea type="text" class="form-control" placeholder="نگارش متن" asp-for="Description" style=" height: 300px;"></textarea>
|
||||
<span asp-validation-for="Description" class="error"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<textarea type="text" class="form-control" asp-for="Paragraph" placeholder="نگارش محشا /پی نوشت" style=" height: 100px;"></textarea>
|
||||
<span asp-validation-for="Paragraph" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<input type="hidden" asp-for="Id" value="@Model.Id" />
|
||||
|
||||
<div class="modal-footer" style="border-top: unset; padding: 1px 15px 10px;">
|
||||
|
||||
<button id="btnPrint" type="button" class="btn btn-success btn-rounded waves-effect waves-light">پرینت قرارداد </button>
|
||||
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal">بستن فرم</button>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
document.getElementById("btnPrint").onclick = function () {
|
||||
printElement(document.getElementById("printThis"));
|
||||
}
|
||||
|
||||
function printElement(elem) {
|
||||
var domClone = elem.cloneNode(true);
|
||||
|
||||
var $printSection = document.getElementById("printSection");
|
||||
|
||||
if (!$printSection) {
|
||||
$printSection = document.createElement("div");
|
||||
$printSection.id = "printSection";
|
||||
document.body.appendChild($printSection);
|
||||
}
|
||||
|
||||
$printSection.innerHTML = "";
|
||||
$printSection.appendChild(domClone);
|
||||
window.print();
|
||||
}
|
||||
</script>
|
||||
@@ -1,330 +0,0 @@
|
||||
@model CompanyManagment.App.Contracts.TextManager.EditTextManager
|
||||
@{
|
||||
}
|
||||
@{
|
||||
<style>
|
||||
.modal-dialog {
|
||||
width: 60% !important;
|
||||
}
|
||||
|
||||
.select2-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
border-top: unset !important;
|
||||
}
|
||||
|
||||
.modal .modal-dialog .modal-content .modal-footer {
|
||||
padding-top: unset !important;
|
||||
}
|
||||
|
||||
p {
|
||||
direction: ltr !important;
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
input[type=radio]:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.error {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
|
||||
textarea {
|
||||
overflow-y: scroll;
|
||||
resize: none; /* Remove this if you want the user to resize the textarea */
|
||||
}
|
||||
</style>
|
||||
}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<form asp-page="./Index" asp-page-handler="Edit" autocomplete="off"
|
||||
method="post"
|
||||
data-ajax="true"
|
||||
data-callback=""
|
||||
data-action="Refresh"
|
||||
enctype="multipart/form-data">
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
|
||||
<legend style="top: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> تعریف بخش </legend>
|
||||
<div class="col-md-12" style="border: 1px solid burlywood;border-radius: 11px;margin-bottom: 5px;padding: 10px;">
|
||||
<div class="form-group">
|
||||
<label class="control-label">ماژول ها :</label>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="button-group-pills text-center" data-toggle="buttons">
|
||||
@foreach (var item in Model.drpModule)
|
||||
{
|
||||
bool result = Model.ModuleIds.ToList().Contains(Convert.ToInt64(item.Value));
|
||||
<label class="btn btn-default @(result== true ? "active" : "") ">
|
||||
@if (result)
|
||||
{
|
||||
<input type="checkbox" name="ModuleIds" checked="checked" value="@item.Value">
|
||||
<div>@item.Text</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" name="ModuleIds" value="@item.Value">
|
||||
<div>@item.Text</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
</label>
|
||||
}
|
||||
<span asp-validation-for="ModuleIds" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label asp-for="OriginalTitle_Id" class="control-label"> عنوان: </label>
|
||||
<select class="form-control select-city" asp-for="OriginalTitle_Id" asp-items='@Model.OriginalTitleViewModels' id="originalTitle1">
|
||||
<option value="-1"> عنوان را انتخاب کنید ... </option>
|
||||
</select>
|
||||
<span asp-validation-for="OriginalTitle_Id" class="error"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label asp-for="Subtitle_Id" class="control-label"> بخش: </label>
|
||||
<select class="form-control select-city" asp-for="Subtitle_Id" asp-items='@Model.SubtitleViewModels' id="subtitle1">
|
||||
<option value="0"> بخش</option>
|
||||
</select>
|
||||
<span asp-validation-for="Subtitle_Id" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label asp-for="NoteNumber" class="control-label"> فصل: </label>
|
||||
<select class="form-control select-city" asp-for="Chapter_Id" asp-items='@Model.ChapterViewModels' id="chapter1">
|
||||
<option value="0"> فصل</option>
|
||||
</select>
|
||||
<span asp-validation-for="Chapter_Id" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
|
||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||
<label asp-for="NoteNumber" class="control-label"> ماده: </label>
|
||||
<input type="text" class="form-control" asp-for="NoteNumber" placeholder="ماده">
|
||||
<span asp-validation-for="NoteNumber" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6" style="margin-bottom:20px;">
|
||||
<div class="form-group">
|
||||
|
||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||
<label asp-for="NoteNumber" class="control-label"> موضوع: </label>
|
||||
<input type="text" class="form-control" asp-for="SubjectTextManager" placeholder="موضوع">
|
||||
<span asp-validation-for="SubjectTextManager" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 m-b-30">
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||
<label asp-for="NumberTextManager" class="control-label"> تاریخ: </label>
|
||||
<input type="text" class="form-control" asp-for="DateTextManager" placeholder=" تاریخ" onkeyup="validDate1(this)" maxlength="10">
|
||||
<span id="spanmsg"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||
<label asp-for="NumberTextManager" class="control-label"> شماره: </label>
|
||||
<input type="text" class="form-control" asp-for="NumberTextManager" placeholder="شماره">
|
||||
<span asp-validation-for="NumberTextManager" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
|
||||
<textarea type="text" class="form-control" placeholder="نگارش متن" asp-for="Description" style=" height: 300px;"></textarea>
|
||||
<span asp-validation-for="Description" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<textarea type="text" class="form-control" asp-for="Paragraph" placeholder="نگارش محشا /پی نوشت" style=" height: 100px;"></textarea>
|
||||
<span asp-validation-for="Paragraph" class="error"></span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" asp-for="Id" value="@Model.Id" />
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
|
||||
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<style>
|
||||
.button-group-pills .btn {
|
||||
border-radius: 20px;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 15px;
|
||||
margin-left: 10px;
|
||||
border-color: #bbbbbb;
|
||||
background-color: #FFF;
|
||||
color: #14a4be;
|
||||
}
|
||||
|
||||
.button-group-pills .btn.active {
|
||||
border-color: #14a4be;
|
||||
background-color: #14a4be;
|
||||
color: #FFF;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.button-group-pills .btn:hover {
|
||||
border-color: #158b9f;
|
||||
background-color: #158b9f;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
|
||||
button.multiselect.dropdown-toggle.btn.btn-default {
|
||||
border: -3px solid !important;
|
||||
border-color: black;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("#originalTitle1").change(function () {
|
||||
$("#subtitle1").empty();
|
||||
$("#chapter1").empty();
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/Admin/Company/TextManager?handler=SubtitleList',
|
||||
dataType: 'json',
|
||||
data: { OriginalTitle_Id: $("#originalTitle1").val() },
|
||||
success: function (result) {
|
||||
$("#subtitle1").append(' <option value="' + -1 + '">' +
|
||||
"نام بخش را انتخاب کنید" + '</option>');
|
||||
$.each(result, function (i, result) {
|
||||
$("#subtitle1").append(' <option value="' + result.id + '">' +
|
||||
result.subtitle + '</option>');
|
||||
});
|
||||
},
|
||||
error: function (ex) {
|
||||
alert('Error');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
$("#subtitle1").change(function () {
|
||||
$("#chapter1").empty();
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/Admin/Company/TextManager?handler=ChptereList',
|
||||
dataType: 'json',
|
||||
data: {Subtitle_Id: $("#subtitle1").val() },
|
||||
success: function (results) {
|
||||
$("#chapter1").append(' <option value="' + -1 + '">' +
|
||||
"فصل را انتخاب کنید" + '</option>');
|
||||
$.each(results, function (i, result) {
|
||||
$("#chapter1").append(' <option value="' + result.value + '">' +
|
||||
result.text + '</option>');
|
||||
});
|
||||
},
|
||||
error: function (ex) {
|
||||
alert('ffff');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
function validDate1(inputField) {
|
||||
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function (str) {
|
||||
if (typeof str === 'string') {
|
||||
for (var i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField.value;
|
||||
var m1, m2;
|
||||
var y1, y2, y3, y4;
|
||||
var d1, d2;
|
||||
var s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
}
|
||||
var yRes = y1 + y2 + y3 + y4;
|
||||
var year = parseInt(yRes);
|
||||
var mRes = m1 + m2;
|
||||
var month = parseInt(mRes);
|
||||
var dRes = d1 + d2;
|
||||
var day = parseInt(dRes);
|
||||
var FixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
var isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(FixResult);
|
||||
if (isValid) {
|
||||
$("#spanmsg").empty();
|
||||
validCheck = true;
|
||||
|
||||
} else {
|
||||
$("#spanmsg").html("لطفا تاریخ را بصورت صحیح وارد کنید"), $("#spanmsg").css({
|
||||
color: "red"
|
||||
});
|
||||
|
||||
validCheck = false;
|
||||
|
||||
}
|
||||
return validCheck;
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -1,638 +0,0 @@
|
||||
@page
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.TextManager.IndexModel
|
||||
@using Microsoft.AspNetCore.Http.Extensions;
|
||||
@{
|
||||
}
|
||||
@{
|
||||
string url = HttpContext.Request.GetEncodedUrl();
|
||||
//string colaps = "in";
|
||||
//string act = "active";
|
||||
int i = 1;
|
||||
}
|
||||
@{
|
||||
//Layout = "~/Pages/Shared/_Layout.cshtml";
|
||||
Layout = "Shared/_AdminLayout";
|
||||
ViewData["title"] = "مدیریت متن";
|
||||
}
|
||||
|
||||
<style>
|
||||
.sizeSet {
|
||||
padding: 2px !important;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.rad {
|
||||
border-radius: 8px !important;
|
||||
/* padding: 10px; */
|
||||
padding: 2px 5px 0px 5px;
|
||||
}
|
||||
|
||||
.ionSize {
|
||||
font-size: 20px !important;
|
||||
top: 2px !important;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ionRad {
|
||||
border-radius: 8px !important;
|
||||
padding: 0px 7px 0px 7px !important;
|
||||
background-color: #ff7700 !important;
|
||||
border-color: #ff7700 !important;
|
||||
}
|
||||
|
||||
.ionRad2 {
|
||||
border-radius: 8px !important;
|
||||
padding: 0px 7px 0px 7px !important;
|
||||
background-color: #7c7a7a !important;
|
||||
border-color: #7c7a7a !important;
|
||||
}
|
||||
|
||||
.faSize {
|
||||
font-size: 22px !important;
|
||||
}
|
||||
|
||||
.thh0 {
|
||||
width: 8px !important;
|
||||
}
|
||||
|
||||
.thh {
|
||||
width: 40px !important;
|
||||
}
|
||||
|
||||
.thh2 {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.thhNastionalId {
|
||||
width: 30px !important;
|
||||
}
|
||||
|
||||
.inpt {
|
||||
width: 100%;
|
||||
border: 1px solid #c7c7c7;
|
||||
}
|
||||
|
||||
.searchpanel {
|
||||
background-color: #747272;
|
||||
}
|
||||
|
||||
select {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.panel-default > .panel-heading {
|
||||
background-color: #950000 !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.tooltip-container {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.tooltip2-container {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.tooltip {
|
||||
opacity: 0;
|
||||
z-index: 99;
|
||||
color: #fff;
|
||||
width: 220px;
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
font-family: 'IranSans';
|
||||
padding: 5px 10px;
|
||||
border-radius: 3px;
|
||||
text-align: center;
|
||||
/*text-shadow: 1px 1px 2px #111;*/
|
||||
background: #e67e22;
|
||||
border: 1px solid #e67e22;
|
||||
box-shadow: 0 0 3px rgba(0,0,0,0.5);
|
||||
-webkit-transition: all .2s ease-in-out;
|
||||
-moz-transition: all .2s ease-in-out;
|
||||
-o-transition: all .2s ease-in-out;
|
||||
-ms-transition: all .2s ease-in-out;
|
||||
transition: all .2s ease-in-out;
|
||||
-webkit-transform: scale(0);
|
||||
-moz-transform: scale(0);
|
||||
-o-transform: scale(0);
|
||||
-ms-transform: scale(0);
|
||||
transform: scale(0);
|
||||
position: absolute;
|
||||
right: -50px;
|
||||
bottom: 40px;
|
||||
}
|
||||
|
||||
.tooltip:before, .tooltip:after {
|
||||
content: '';
|
||||
border-left: 10px solid transparent;
|
||||
border-right: 10px solid transparent;
|
||||
border-top: 10px solid #e67e22;
|
||||
position: absolute;
|
||||
bottom: -10px;
|
||||
left: 70%;
|
||||
}
|
||||
|
||||
.tooltip-container:hover .tooltip, a:hover .tooltip {
|
||||
opacity: 1;
|
||||
-webkit-transform: scale(1);
|
||||
-moz-transform: scale(1);
|
||||
-o-transform: scale(1);
|
||||
-ms-transform: scale(1);
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
.tooltip2 {
|
||||
opacity: 0;
|
||||
z-index: 99;
|
||||
color: #fff;
|
||||
width: 220px;
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
font-family: 'IranSans';
|
||||
padding: 5px 10px;
|
||||
border-radius: 3px;
|
||||
text-align: center;
|
||||
/*text-shadow: 1px 1px 2px #111;*/
|
||||
background: #e67e22;
|
||||
border: 1px solid #e67e22;
|
||||
box-shadow: 0 0 3px rgba(0,0,0,0.5);
|
||||
-webkit-transition: all .2s ease-in-out;
|
||||
-moz-transition: all .2s ease-in-out;
|
||||
-o-transition: all .2s ease-in-out;
|
||||
-ms-transition: all .2s ease-in-out;
|
||||
transition: all .2s ease-in-out;
|
||||
-webkit-transform: scale(0);
|
||||
-moz-transform: scale(0);
|
||||
-o-transform: scale(0);
|
||||
-ms-transform: scale(0);
|
||||
transform: scale(0);
|
||||
position: absolute;
|
||||
right: -90px;
|
||||
bottom: 40px;
|
||||
}
|
||||
|
||||
.tooltip2:before, .tooltip2:after {
|
||||
content: '';
|
||||
border-left: 10px solid transparent;
|
||||
border-right: 10px solid transparent;
|
||||
border-top: 10px solid #e67e22;
|
||||
position: absolute;
|
||||
bottom: -10px;
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
.tooltip2-container:hover .tooltip2, a:hover .tooltip2 {
|
||||
opacity: 1;
|
||||
-webkit-transform: scale(1);
|
||||
-moz-transform: scale(1);
|
||||
-o-transform: scale(1);
|
||||
-ms-transform: scale(1);
|
||||
transform: scale(1);
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 m-r-10">
|
||||
|
||||
<p class="pull-right">
|
||||
|
||||
|
||||
</p>
|
||||
<p class="pull-right">
|
||||
|
||||
<a id="btnPopModal" href="#showmodal=@Url.Page("/Company/TextManager/Index", "Create")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #0f9500; font-family: 'Web_Yekan' !important; color: #0f9500 !important; margin-right: 10px "> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 10px; color: #0f9500 !important "></i> ایجاد متن جدید </a>
|
||||
|
||||
</p>
|
||||
<input type="hidden" id="sercheCheck" value="@Model.TextManagerSearch" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
<div class="panel-group panel-group-joined" id="accordion-test">
|
||||
<div class="panel panel-default" style="border-radius: 15px !important; background-color: #fdc0c0; ">
|
||||
<div class="panel-heading" style="background-color: #950000 !important">
|
||||
<h4 class="panel-title" style="color: #edebeb !important; display: inline;">
|
||||
<a data-toggle="collapse" data-parent="#accordion-test" href="#collapseOne" class="collapsed" style="display: inline;">
|
||||
جستجوی متون
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapseOne" class="panel-collapse collapse in ">
|
||||
<div class="panel-body" style="padding-top: 15px; padding-bottom: 15px;">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<form class="form-inline" role="form" method="get" name="search-theme-form" id="search-theme-form" autocomplete="off">
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="row">
|
||||
<div class="col-sm-3 pull-right">
|
||||
<select class="form-control select-city" asp-for="searchModel.OriginalTitle_Id" asp-items="Model.SelectListOriginalTitle" placeholder="عنوان" id="originalTitle" style="width: 100%">
|
||||
<option value="0" selected="selected">
|
||||
عنوان راانتخاب کنید
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<select class="form-control select-city" asp-for="searchModel.Subtitle_Id" asp-items="Model.SelectListSubtitle" id="subtitle" style="width: 100%">
|
||||
<option value="0"> فصل را انتخاب کنید</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-3 pull-right">
|
||||
<select class="form-control select-city" asp-for="searchModel.Chapter_Id" asp-items="Model.SelectListChapter" placeholder="فصل" id="chapter" style="width: 100%">
|
||||
<option value="0" selected="selected">بخش را انتخاب کنید </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-3 pull-right">
|
||||
<input class="form-control inpt" asp-for="searchModel.SubjectTextManager" placeholder="موضوع" style="width: 100%">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr style=" margin-top: 12px;margin-bottom: 12px;" />
|
||||
<div class="row" style="margin-top: 15px">
|
||||
<div class="col-lg-9">
|
||||
|
||||
<label class="sr-only" asp-for="searchModel.IsActiveString"></label>
|
||||
<select id="activing" class="form-control activer" asp-for="searchModel.IsActiveString" style="background-color: #dddddd; border-radius: 25px; border: 1px solid #bfbfbf;">
|
||||
<option value="true"> فعال </option>
|
||||
<option value="false"> غیر فعال </option>
|
||||
<option value="both"> هردو </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 search" style="border-bottom-left-radius: 0px; border-top-left-radius: 0px; background-color: #950000; border-color: #950000; font-family: 'Web_Yekan' !important; margin-left: -3px "> <i class="fa fa-search" style="padding-left: 3px; font-size: 10px;"></i> جستجو</button>
|
||||
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5" style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #545353; border-color: #545353; font-family: 'Web_Yekan' !important;" asp-page="./Index">مشاهده همه</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست متون ها</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-sm-12 col-xs-12">
|
||||
<table id="datatable" class="table table-striped table-bordered fc-scroller">
|
||||
<thead style="background-color: #ecefee">
|
||||
<tr>
|
||||
<th style="font-size: 10px !important; display: none" class="sizeSet">
|
||||
<span class="tooltip-container">
|
||||
<input class="checkboxtitle" type="checkbox" id="checkSelect" onclick="selectori(this)" checked="checked" />
|
||||
</span>
|
||||
</th>
|
||||
<th style="font-size: 10px !important" >#</th>
|
||||
<th style="font-size: 10px !important; width: 10% !important;" >عنوان</th>
|
||||
<th style="font-size: 10px !important; width: 10% !important;" >بخش</th>
|
||||
<th style="font-size: 10px !important; width: 15% !important;" >فصل </th>
|
||||
<th style="font-size: 10px !important; width: 5% !important;" > ماده </th>
|
||||
<th style="font-size: 10px !important; width: 5% !important;" > شماره </th>
|
||||
<th style="font-size: 10px !important; width: 15% !important;" >موضوع </th>
|
||||
<th style="font-size: 10px !important; width: 15% !important; ">توضیحات </th>
|
||||
@foreach (var module in Model.ListModule)
|
||||
{
|
||||
<th style="font-size: 10px !important;">
|
||||
<div style="text-align:center">
|
||||
<div style="font-size: 10px !important; writing-mode: sideways-lr;padding-right:25%; "> @module</div>
|
||||
<div style="margin-top: 5px;">
|
||||
<span class="tooltip2-container">
|
||||
<button type="button" style=" padding: 2px;" id="@module" class="btn btn-icon waves-effect waves-light btn-success m-b-5" onclick="ModuleSelect(this.id,1)">
|
||||
<i class="ion-checkmark-circled" style="color: #fff; font-size: 10px"></i>
|
||||
</button>
|
||||
<span class="tooltip2">
|
||||
با استفاده از این دکمه می توانید متن ها را بصورت گروهی امضاء نمایید
|
||||
</span>
|
||||
</span>
|
||||
<span class="tooltip2-container">
|
||||
<button type="button" style="padding: 2px;" class="btn btn-icon waves-effect waves-light btn-danger m-b-5" id="@module" onclick="ModuleSelect(this.id,0)">
|
||||
<i class="ion-close-circled" style="color: #fff;font-size: 10px"></i>
|
||||
</button>
|
||||
<span class="tooltip2">
|
||||
با استفاده از این دکمه می توانید امضاء متن ها را بصورت گروهی حذف نمایید
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
}
|
||||
<th style="font-size: 10px !important; width: 10% !important; ">
|
||||
<span style="float: right;">
|
||||
<span> </span><span> </span><span> </span><span> </span><span> </span><span> </span>
|
||||
</span>
|
||||
<span class="act">
|
||||
</span>
|
||||
<a class="btn btn-danger pull-right m-rl-5 rad deact" onclick="deactiveAll()">
|
||||
<i class="fa faSize fa-trash"></i>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.TextManagers)
|
||||
{
|
||||
<tr>
|
||||
<td style="font-size: 12px !important; text-align: center;display:none">
|
||||
<input type="checkbox" name="foo" value="@item.Id" checked="checked" />
|
||||
</td>
|
||||
<td style="font-size: 12px !important; text-align: center">@i </td>
|
||||
<td style="font-size: 12px !important; text-align: right; max-width:50px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">@item.OriginalTitle</td>
|
||||
<td style="font-size: 12px !important; text-align: right; max-width: 50px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">@item.Subtitle </td>
|
||||
<td style="font-size: 12px !important; text-align: right; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">@item.Chapter </td>
|
||||
<td style="font-size: 12px !important; text-align: center">@item.NoteNumber</td>
|
||||
<td style="font-size: 12px !important; text-align: center">@item.NumberTextManager</td>
|
||||
<td style="font-size: 12px !important; text-align: right; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">@item.SubjectTextManager</td>
|
||||
<td style="font-size: 12px !important; text-align: right; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">@item.Description</td>
|
||||
@{
|
||||
var result = string.Join(",", item.ListUseModule.ToArray());
|
||||
for (int c = 0; c < Model.ListModule.Count(); c++)
|
||||
{
|
||||
|
||||
if (result.Contains((Model.ListModule)[c]))
|
||||
{
|
||||
<td style="font-size: 10px !important; text-align: center">
|
||||
<label style="width: 20px; height: 20px; border-radius: 50%; border: 1px solid cadetblue; background: #67B55D; "></label>
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td style="font-size: 10px !important; text-align: center">
|
||||
<label style="width: 20px; height: 20px; border-radius: 50%; border: 1px solid cadetblue;"></label>
|
||||
</td>
|
||||
}
|
||||
}
|
||||
}
|
||||
@{
|
||||
i++;
|
||||
}
|
||||
|
||||
<td>
|
||||
|
||||
<a permission="20114" class="btn btn-warning pull-right m-rl-5 rad"
|
||||
href="#showmodal=@Url.Page("./Index", "Edit", new {Id = item.Id})">
|
||||
<i class="fa faSize fa-edit"></i>
|
||||
</a>
|
||||
|
||||
@if (item.IsActiveString == "true")
|
||||
{
|
||||
<a permission="20116" id="googleLink" class="btn btn-danger pull-right m-rl-5 fff rad" onclick="DeActive('/Admin/Company/TextManager?id=@item.Id&url=@url&handler=DeActive')"><i class="fa faSize fa-trash"></i></a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a permission="20116" onclick="IsActive('/Admin/Company/TextManager?id=@item.Id&url=@url&handler=IsActive')" class="btn btn-success pull-right m-rl-5 rad"><i class="fa faSize fa-rotate-left"></i> </a>{ }
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@section PanelScripts{
|
||||
<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>
|
||||
|
||||
$('.activer').on('change',
|
||||
function (e) {
|
||||
e.preventDefault();
|
||||
$('.search').click();
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
|
||||
if (document.getElementById("activing").selectedIndex == 1) {
|
||||
$('.deact').remove();
|
||||
$('.act').append(
|
||||
' <a class="btn btn-success pull-right m-rl-5 rad react" onclick="reActiveAll()">' + '<i class="fa faSize fa-rotate-left"></i>' + ' </a>'
|
||||
);
|
||||
}
|
||||
if (document.getElementById("activing").selectedIndex == 2) {
|
||||
$('.deact').remove();
|
||||
}
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
var countcul = document.getElementById('datatable').rows[0].cells.length;
|
||||
var sub_array = [];
|
||||
sub_array.push(0);
|
||||
for (var i = 8; i <= countcul - 1; i++) {
|
||||
sub_array.push(i);
|
||||
}
|
||||
$('#datatable').dataTable({
|
||||
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]],
|
||||
"columnDefs": [
|
||||
{ "targets": sub_array, "orderable": false, },
|
||||
]
|
||||
});
|
||||
$('#datatable2').dataTable({
|
||||
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]],
|
||||
"columnDefs": [
|
||||
{ "targets": sub_array, "orderable": false, },
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("#originalTitle").change(function () {
|
||||
$("#subtitle").empty();
|
||||
$("#chapter").empty();
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/Admin/Company/TextManager?handler=SubtitleList',
|
||||
dataType: 'json',
|
||||
data: { OriginalTitle_Id: $("#originalTitle").val() },
|
||||
success: function (result) {
|
||||
$("#subtitle").append(' <option value="' + -1 + '">' +
|
||||
"نام بخش را انتخاب کنید" + '</option>');
|
||||
$("#chapter").append(' <option value="' + -1 + '">' +
|
||||
"فصل را انتخاب کنید" + '</option>');
|
||||
$.each(result, function (i, result) {
|
||||
$("#subtitle").append(' <option value="' + result.id + '">' +
|
||||
result.subtitle + '</option>');
|
||||
});
|
||||
},
|
||||
error: function (ex) {
|
||||
alert('Error');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
$("#subtitle").change(function () {
|
||||
$("#chapter").empty();
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/Admin/Company/TextManager?handler=ChptereList',
|
||||
dataType: 'json',
|
||||
data: { Subtitle_Id: $("#subtitle").val() },
|
||||
success: function (results) {
|
||||
$("#chapter").append(' <option value="' + -1 + '">' +
|
||||
"فصل را انتخاب کنید" + '</option>');
|
||||
$.each(results, function (i, result) {
|
||||
$("#chapter").append(' <option value="' + result.value + '">' +
|
||||
result.text + '</option>');
|
||||
});
|
||||
},
|
||||
error: function (ex) {
|
||||
alert('ffff');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
function reActiveAll() {
|
||||
|
||||
if (document.getElementById("checkSelect").checked == false) {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ متنی انتخاب نشده است ");
|
||||
} else {
|
||||
if (document.getElementById("sercheCheck").value == "false") {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی متن حداقل یکی از فیلدهای عنوان،بخش را انتخاب نموده و سپس جستجو را کلیک کنید ");
|
||||
} else if (document.getElementById("sercheCheck").value == "true") {
|
||||
swal({
|
||||
title: "آیا فعال نمودن این متن ها اطمینان دارید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false
|
||||
}, function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
checkboxes2 = document.getElementsByName('foo');
|
||||
var url3b = '';
|
||||
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
|
||||
if (checkboxes2[i2].checked == true) {
|
||||
var u2 = '&ids=' + checkboxes2[i2].value;
|
||||
console.log(u2);
|
||||
url3b = url3b + u2;
|
||||
console.log(url3b);
|
||||
}
|
||||
}
|
||||
var url2b = '@Url.Page("/Company/TextManager/Index", "GroupReActive")';
|
||||
console.log(url2b);
|
||||
window.location.href = url2b + url3b;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function deactiveAll() {
|
||||
|
||||
if (document.getElementById("checkSelect").checked == false) {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ متنی انتخاب نشده است ");
|
||||
} else {
|
||||
if (document.getElementById("sercheCheck").value == "true") {
|
||||
swal({
|
||||
title: "آیا حذف این متن ها اطمینان دارید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false
|
||||
}, function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
checkboxes2 = document.getElementsByName('foo');
|
||||
var url3b = '';
|
||||
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
|
||||
if (checkboxes2[i2].checked == true) {
|
||||
var u2 = '&ids=' + checkboxes2[i2].value;
|
||||
console.log(u2);
|
||||
url3b = url3b + u2;
|
||||
console.log(url3b);
|
||||
}
|
||||
}
|
||||
var url2b = '@Url.Page("/Company/TextManager/Index", "GroupDeActive")';
|
||||
window.location.href = url2b + url3b;
|
||||
console.log(url2b);
|
||||
}
|
||||
});
|
||||
|
||||
} else if (document.getElementById("sercheCheck").value == "false") {
|
||||
console.log(document.getElementById("sercheCheck").value);
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی متن حداقل یکی از فیلدهای عنوان،بخش را انتخاب نموده و سپس جستجو را کلیک کنید ");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function ModuleSelect(module,d) {
|
||||
console.log(document.getElementById("sercheCheck").value);
|
||||
if (document.getElementById("sercheCheck").value == "false") {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی متن حداقل یکی از فیلدهای عنوان،بخش ، فصل را انتخاب نموده و سپس جستجو را کلیک کنید ");
|
||||
} else if (document.getElementById("sercheCheck").value == "true") {
|
||||
var messageSwal = '';
|
||||
if (d == 1) {
|
||||
messageSwal = "آیاازانتخاب کلیه گزینه های این ستون اطمینان دارید؟";
|
||||
}
|
||||
else {
|
||||
messageSwal = "آیاازحذف کلیه گزینه های این ستون اطمینان دارید؟";
|
||||
}
|
||||
swal({
|
||||
|
||||
title: messageSwal,
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false
|
||||
}, function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
checkboxes = document.getElementsByName('foo');
|
||||
var url3 = '';
|
||||
for (var i = 0, n = checkboxes.length; i < n; i++) {
|
||||
if (checkboxes[i].checked == true) {
|
||||
var u = '&ids=' + checkboxes[i].value;
|
||||
url3 = url3 + u;
|
||||
}
|
||||
}
|
||||
var module1 = '&module=' + module;
|
||||
var url2b = '@Url.Page("/Company/TextManager/Index", "GroupSelectModule")';
|
||||
|
||||
if (d == 1) {
|
||||
window.location.href = url2b + url3 + module1 + '&AD=' + 1;
|
||||
}
|
||||
else {
|
||||
window.location.href = url2b + url3 + module1 + '&AD=' + 0;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
}
|
||||
@@ -1,240 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using P_TextManager.Domin.TextManagerAgg;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Module;
|
||||
using CompanyManagment.App.Contracts.OriginalTitle;
|
||||
using CompanyManagment.App.Contracts.Subtitle;
|
||||
using CompanyManagment.App.Contracts.TextManager;
|
||||
using CompanyManagment.App.Contracts.Chapter;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Pages.Company.TextManager
|
||||
{
|
||||
public class IndexModel : PageModel
|
||||
{
|
||||
public string TextManagerSearch = "false";
|
||||
public string Message { get; set; }
|
||||
public TextManagerViewModel searchModel;
|
||||
public List<SubtitleViewModel> SubtitlesViewModels;
|
||||
public List<TextManagerViewModel> TextManagers;
|
||||
public SelectList SelectListOriginalTitle;
|
||||
public SelectList SelectListSubtitle;
|
||||
public SelectList SelectListChapter;
|
||||
public SelectList SelectListActiveString;
|
||||
public string[] ListModule;
|
||||
public List<OriginalTitleViewModel> OriginalTitleViewModels;
|
||||
public SelectList categoryListItems;
|
||||
private readonly ISubtitleApplication _subtitleApplication;
|
||||
private readonly IChapterApplication _chapterApplication;
|
||||
private readonly IOriginalTitleApplication _originalTitleApplication;
|
||||
private readonly ITextManagerApplication _textManagerApplication;
|
||||
private readonly IModuleApplication _moduleApplication;
|
||||
private readonly ITextManagerRepozitory _textManagerRepozitory;
|
||||
public IndexModel(ISubtitleApplication subtitleApplication, IChapterApplication chapterApplication, IOriginalTitleApplication originalTitleApplication, ITextManagerApplication textManagerApplication, IModuleApplication moduleApplication, ITextManagerRepozitory textManagerRepozitory)
|
||||
{
|
||||
_textManagerRepozitory = textManagerRepozitory;
|
||||
_subtitleApplication = subtitleApplication;
|
||||
_chapterApplication = chapterApplication;
|
||||
_originalTitleApplication = originalTitleApplication;
|
||||
_textManagerApplication = textManagerApplication;
|
||||
_moduleApplication = moduleApplication;
|
||||
}
|
||||
|
||||
public void OnGet(TextManagerSearchModel searchModel)
|
||||
{
|
||||
|
||||
TextManagers = _textManagerApplication.Search(searchModel);
|
||||
SelectListOriginalTitle = new SelectList(_originalTitleApplication.GetAllOriginalTitle().Where(x=>x.IsActiveString=="true"), "Id", "Title");
|
||||
SelectListSubtitle = new SelectList(_subtitleApplication.GetAllSubtitle().Where(x => x.IsActiveString == "true"), "Id", "Subtitle");
|
||||
SelectListChapter = new SelectList(_chapterApplication.GetAllChapter().Where(x => x.IsActiveString == "true"), "Id", "Chapter");
|
||||
ListModule = _moduleApplication.GetAllModule().Where(x => x.IsActiveString == "true").Select(x => x.NameSubModule).ToArray();
|
||||
|
||||
if (TextManagers != null)
|
||||
{
|
||||
|
||||
if (searchModel.OriginalTitle_Id != 0)
|
||||
{
|
||||
TextManagerSearch = "true";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public IActionResult OnGetCreate()
|
||||
{
|
||||
var createTextManager = new CreateTextManager
|
||||
{
|
||||
OriginalTitleViewModels = _originalTitleApplication.GetAllOriginalTitle().Where(x => x.IsActiveString == "true").ToList().Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList(),
|
||||
SubtitleViewModels = _subtitleApplication.GetAllSubtitle().Where(x => x.IsActiveString == "true").ToList().Select(x => new SelectListItem { Text = x.Subtitle, Value = x.Id.ToString() }).ToList(),
|
||||
ChapterViewModels = _chapterApplication.GetAllChapter().Where(x => x.IsActiveString == "true").ToList().Select(x => new SelectListItem { Text = x.Chapter, Value = x.Id.ToString() }).ToList(),
|
||||
drpModule = _moduleApplication.GetAllModule().Where(x => x.IsActiveString == "true").ToList().Select(x => new SelectListItem { Text = x.NameSubModule, Value = x.Id.ToString() }).ToList()
|
||||
};
|
||||
return Partial("./Create", createTextManager);
|
||||
}
|
||||
public IActionResult OnPostCreate(CreateTextManager command)
|
||||
{
|
||||
var result = _textManagerApplication.Create(command);
|
||||
return new JsonResult(result);
|
||||
}
|
||||
public IActionResult OnGetEdit(long id)
|
||||
{
|
||||
var textManager = _textManagerApplication.GetDetails(id);
|
||||
List<long> ModuleIds = _textManagerRepozitory.GetRelation(id);
|
||||
|
||||
var textManagereEdit = new EditTextManager
|
||||
{
|
||||
Id = id,
|
||||
NoteNumber = textManager.NoteNumber,
|
||||
DateTextManager = textManager.DateTextManager,
|
||||
Description = textManager.Description,
|
||||
NumberTextManager = textManager.NumberTextManager,
|
||||
SubjectTextManager = textManager.SubjectTextManager,
|
||||
Paragraph = textManager.Paragraph,
|
||||
OriginalTitle_Id = textManager.OriginalTitle_Id,
|
||||
Subtitle_Id = textManager.Subtitle_Id,
|
||||
Chapter_Id = textManager.Chapter_Id,
|
||||
ModuleIds = ModuleIds.ToArray(),
|
||||
OriginalTitleViewModels = _originalTitleApplication.GetAllOriginalTitle().Where(x => x.IsActiveString == "true").ToList().Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList(),
|
||||
SubtitleViewModels = _subtitleApplication.GetAllSubtitle().Where(x => x.IsActiveString == "true").ToList().Select(x => new SelectListItem { Text = x.Subtitle, Value = x.Id.ToString() }).ToList(),
|
||||
ChapterViewModels = _chapterApplication.GetAllChapter().Where(x => x.IsActiveString == "true").ToList().Select(x => new SelectListItem { Text = x.Chapter, Value = x.Id.ToString() }).ToList(),
|
||||
drpModule = _moduleApplication.GetAllModule().Where(x => x.IsActiveString == "true").ToList().Select(x => new SelectListItem { Text = x.NameSubModule, Value = x.Id.ToString() }).ToList()
|
||||
};
|
||||
return Partial("Edit", textManagereEdit);
|
||||
}
|
||||
public JsonResult OnPostEdit(EditTextManager command)
|
||||
{
|
||||
var result = _textManagerApplication.Edit(command);
|
||||
return new JsonResult(result);
|
||||
}
|
||||
public IActionResult OnGetDetails(long id)
|
||||
{
|
||||
var editJob = _textManagerApplication.GetDetails(id);
|
||||
return Partial("Details", editJob);
|
||||
}
|
||||
public IActionResult OnGetSubtitleList(long OriginalTitle_Id)
|
||||
{
|
||||
var subtitleList = _subtitleApplication.GetAllSubtitle().Where(d => d.OriginalTitle_Id == OriginalTitle_Id && d.IsActiveString == "true").ToList();
|
||||
return new JsonResult(subtitleList);
|
||||
}
|
||||
public IActionResult OnGetChptereList(long Subtitle_Id)
|
||||
{
|
||||
var chapterleList = _chapterApplication.GetAllChapter().Where(x => x.Subtitle_Id == Subtitle_Id && x.IsActiveString == "true").ToList().Select(x => new SelectListItem { Text = x.Chapter, Value = x.Id.ToString() }).ToList();
|
||||
return new JsonResult(chapterleList);
|
||||
}
|
||||
|
||||
public IActionResult OnGetDescription(long subtitle_Id)
|
||||
{
|
||||
var descriptions = _textManagerApplication.GetAllTextManager().Where(d => d.Subtitle_Id == subtitle_Id).Select(x => x.Description).ToList();
|
||||
return new JsonResult(descriptions);
|
||||
}
|
||||
public IActionResult OnGetDescriptionAll(string term, int Id)
|
||||
{
|
||||
if (Id == 0)
|
||||
return new JsonResult(_textManagerApplication.GetAllTextManager().Where(d => d.Description.Contains(term) && d.IsActiveString == "true").Select(x => x.Description).ToList());
|
||||
else
|
||||
return new JsonResult(_textManagerApplication.GetAllTextManager().Where(d => d.Description.Contains(term) && d.Chapter_Id == Id && d.IsActiveString == "true").Select(x => x.Description).ToList());
|
||||
}
|
||||
|
||||
public IActionResult OnGetSearchText1(string term)
|
||||
{
|
||||
try
|
||||
{
|
||||
//string term = HttpContext.Request.Query["term"].ToString();
|
||||
List<Parvandeh> ObjList = new List<Parvandeh>()
|
||||
{
|
||||
|
||||
new Parvandeh {Id=1,Name="Latur" },
|
||||
new Parvandeh {Id=2,Name="Mumbai" },
|
||||
new Parvandeh {Id=3,Name="Pune" },
|
||||
new Parvandeh {Id=4,Name="Delhi" },
|
||||
new Parvandeh {Id=5,Name="Dehradun" },
|
||||
new Parvandeh {Id=6,Name="Noida" },
|
||||
new Parvandeh {Id=7,Name="New Delhi" }
|
||||
|
||||
};
|
||||
//Searching records from list using LINQ query
|
||||
//var Name = (from N in ObjList
|
||||
// where N.Name.StartsWith(term)
|
||||
// select new { N.Name });
|
||||
var Name = (from N in ObjList
|
||||
where N.Name.Contains(term)
|
||||
select new { N.Name }).ToList();
|
||||
return new JsonResult(Name);
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
return BadRequest();
|
||||
}
|
||||
}
|
||||
|
||||
public IActionResult OnGetDeActive(long id,string url)
|
||||
{
|
||||
var result = _textManagerApplication.DeActive(id);
|
||||
|
||||
if (result.IsSuccedded)
|
||||
return new JsonResult(url);
|
||||
Message = result.Message;
|
||||
return RedirectToPage(url);
|
||||
|
||||
}
|
||||
public IActionResult OnGetIsActive(long id, string url)
|
||||
{
|
||||
|
||||
|
||||
var result = _textManagerApplication.Active(id);
|
||||
if (result.IsSuccedded)
|
||||
return new JsonResult(url);
|
||||
Message = result.Message;
|
||||
return RedirectToPage(url);
|
||||
}
|
||||
|
||||
|
||||
public IActionResult OnGetGroupDeActive(List<long> ids)
|
||||
{
|
||||
|
||||
foreach (var item in ids)
|
||||
{
|
||||
var result = _textManagerApplication.DeActive(item);
|
||||
}
|
||||
return RedirectToPage("./Index");
|
||||
|
||||
}
|
||||
|
||||
|
||||
public IActionResult OnGetGroupReActive(List<long> ids)
|
||||
{
|
||||
|
||||
foreach (var item in ids)
|
||||
{
|
||||
var result = _textManagerApplication.Active(item);
|
||||
}
|
||||
|
||||
|
||||
//if (result.IsSuccedded)
|
||||
// return RedirectToPage("./Index");
|
||||
|
||||
return RedirectToPage("./Index");
|
||||
}
|
||||
|
||||
public IActionResult OnGetGroupSelectModule(List<long> ids, string module, int AD)
|
||||
{
|
||||
long moduleId = _moduleApplication.GetAllModule().Where(x => x.NameSubModule == module).Select(x => x.Id).FirstOrDefault();
|
||||
foreach (var item in ids)
|
||||
{
|
||||
var result = _textManagerApplication.SelectModule(item, moduleId, AD);
|
||||
|
||||
}
|
||||
return RedirectToPage("./Index");
|
||||
|
||||
}
|
||||
private class Parvandeh
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -46,10 +46,6 @@
|
||||
<None Remove="wwwroot\webcamjs\flash\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Remove="Areas\Admin\Pages\Company\TextManager\clock.cshtml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AccountManagement.Configuration\AccountManagement.Configuration.csproj" />
|
||||
<ProjectReference Include="..\backService\backService.csproj" />
|
||||
|
||||
Reference in New Issue
Block a user