649 lines
22 KiB
C#
649 lines
22 KiB
C#
using _0_Framework.Application;
|
|
using AccountManagement.Application.Contracts.Task;
|
|
using AccountManagement.Application.Contracts.Ticket;
|
|
using AccountManagement.Application.Contracts.TicketAccessAccount;
|
|
using AccountManagement.Domain.AccountAgg;
|
|
using AccountManagement.Domain.AdminResponseAgg;
|
|
using AccountManagement.Domain.AssignAgg;
|
|
using AccountManagement.Domain.ClientResponseAgg;
|
|
using AccountManagement.Domain.MediaAgg;
|
|
using AccountManagement.Domain.TaskAgg;
|
|
using AccountManagement.Domain.TicketAgg;
|
|
using Microsoft.AspNetCore.Http;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
|
|
namespace AccountManagement.Application;
|
|
|
|
public class TicketApplication : ITicketApplication
|
|
{
|
|
private readonly ITicketRepository _ticketRepository;
|
|
private readonly IAccountRepository _accountRepository;
|
|
private readonly ITaskRepository _taskRepository;
|
|
private readonly IAssignRepository _assignRepository;
|
|
private readonly IMediaRepository _mediaRepository;
|
|
private readonly ITicketAccessAccountApplication _ticketAccessAccountApplication;
|
|
private readonly IAuthHelper _authHelper;
|
|
|
|
public TicketApplication(ITicketRepository ticketRepository, IAccountRepository accountRepository, ITaskRepository taskRepository, IAssignRepository assignRepository, IMediaRepository mediaRepository, ITicketAccessAccountApplication ticketAccessAccountApplication, IAuthHelper authHelper)
|
|
{
|
|
_ticketRepository = ticketRepository;
|
|
_accountRepository = accountRepository;
|
|
_taskRepository = taskRepository;
|
|
_assignRepository = assignRepository;
|
|
_mediaRepository = mediaRepository;
|
|
_ticketAccessAccountApplication = ticketAccessAccountApplication;
|
|
_authHelper = authHelper;
|
|
}
|
|
|
|
public OperationResult CreateTicket(CreateTicket command)
|
|
{
|
|
var operation = new OperationResult();
|
|
if (string.IsNullOrWhiteSpace(command.ContractingPartyName))
|
|
{
|
|
return operation.Failed("خطای سیستمی");
|
|
}
|
|
|
|
if (string.IsNullOrWhiteSpace(command.Title))
|
|
{
|
|
return operation.Failed("لطفا عنوان را وارد کنید");
|
|
}
|
|
|
|
if (string.IsNullOrWhiteSpace(command.Description) && command.VoiceId < 1)
|
|
{
|
|
return operation.Failed("لطفا توضیحات خودرا وارد کنید");
|
|
}
|
|
else if (string.IsNullOrWhiteSpace(command.Description))
|
|
{
|
|
command.Description = "";
|
|
}
|
|
var ticketNumber = (_ticketRepository.GetLastTicketNumber() + 1).ToString("D5");
|
|
|
|
var ticket = new Ticket(command.Title, command.Description, command.SenderId, command.ContractingPartyName,
|
|
command.TicketType, command.WorkshopId, ticketNumber,command.SubAccountId);
|
|
_ticketRepository.Create(ticket);
|
|
_ticketRepository.SaveChanges();
|
|
|
|
#region SaveDocuments
|
|
|
|
if (command.UploadedMediaIds?.Count > 0)
|
|
{
|
|
foreach (var mediaId in command.UploadedMediaIds)
|
|
{
|
|
var media = _mediaRepository.Get(mediaId);
|
|
var oldPath = media.Path;
|
|
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
|
|
"Ticket", $"{ticket.id}");
|
|
Directory.CreateDirectory(path);
|
|
|
|
|
|
|
|
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
|
|
File.Move(oldPath, filepath);
|
|
|
|
media.Edit(filepath, media.Type, media.Category);
|
|
|
|
_mediaRepository.SaveChanges();
|
|
_mediaRepository.CreateTicketMedia(ticket.id, media.id);
|
|
_mediaRepository.SaveChanges();
|
|
}
|
|
}
|
|
if (command.ScreenShotId > 0)
|
|
{
|
|
var media = _mediaRepository.Get(command.ScreenShotId);
|
|
var oldPath = media.Path;
|
|
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
|
|
"Ticket", $"{ticket.id}");
|
|
Directory.CreateDirectory(path);
|
|
|
|
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
|
|
File.Move(oldPath, filepath);
|
|
|
|
media.Edit(filepath, media.Type, "اسکرین شات");
|
|
|
|
_mediaRepository.SaveChanges();
|
|
_mediaRepository.CreateTicketMedia(ticket.id, media.id);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
#region SaveVoice
|
|
if (command.VoiceId > 0)
|
|
{
|
|
var media = _mediaRepository.Get(command.VoiceId);
|
|
var oldPath = media.Path;
|
|
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
|
|
"Ticket", $"{ticket.id}");
|
|
Directory.CreateDirectory(path);
|
|
|
|
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
|
|
File.Move(oldPath, filepath);
|
|
|
|
media.Edit(filepath, media.Type, "صوت");
|
|
|
|
_mediaRepository.SaveChanges();
|
|
_mediaRepository.CreateTicketMedia(ticket.id, media.id);
|
|
|
|
|
|
}
|
|
#endregion
|
|
|
|
_mediaRepository.SaveChanges();
|
|
return operation.Succcedded(ticket.id);
|
|
}
|
|
|
|
public OperationResult AssignTicket(CreateTask command, long ticketId)
|
|
{
|
|
var operation = new OperationResult();
|
|
if (string.IsNullOrEmpty(command.Title))
|
|
{
|
|
return operation.Failed("لطفا عنوان وظیفه خود ار وارد کنید");
|
|
}
|
|
|
|
if (string.IsNullOrEmpty(command.EndTaskDate))
|
|
{
|
|
return operation.Failed("لطفا تاریخ انجام وظیفه را وارد کنید");
|
|
}
|
|
|
|
|
|
if (string.IsNullOrEmpty(command.ContractingPartyName))
|
|
{
|
|
return operation.Failed("لطفا طرف حساب خودرا وارد کنید");
|
|
}
|
|
|
|
if (command.SenderId < 1)
|
|
{
|
|
return operation.Failed("خطای سیستمی!!!");
|
|
}
|
|
|
|
var sender = _accountRepository.GetIncludePositions(command.SenderId);
|
|
|
|
|
|
if (command.ReceiverId.Count < 1)
|
|
{
|
|
return operation.Failed("طرف وظیفه خود را وارد کنید");
|
|
}
|
|
|
|
var receivers = _accountRepository.GetAccountsByIds(command.ReceiverId);
|
|
|
|
if (sender.Position.PositionValue == 1)
|
|
{
|
|
|
|
}
|
|
else if (receivers.Any(x => sender.Position.PositionValue >= x.Position.PositionValue))
|
|
{
|
|
var checkReceiver = receivers.Where(x => sender.Position.PositionValue >= x.Position.PositionValue).ToList();
|
|
if (checkReceiver.All(x => x.id == sender.id))
|
|
{
|
|
|
|
}
|
|
else
|
|
{
|
|
return operation.Failed("شما نمیتوانید به سطح بالاتر خود یا هم سطح خود وظیفه ای دهید");
|
|
}
|
|
|
|
}
|
|
else if (receivers.Count == 1 && receivers.Any(x => sender.id == x.id))
|
|
{
|
|
|
|
}
|
|
var ticket = _ticketRepository.Get(ticketId);
|
|
if (ticket == null)
|
|
return operation.Failed("چنین پشتیبانی وجود ندارد");
|
|
|
|
|
|
|
|
var endTask = string.IsNullOrWhiteSpace(command.EndTaskTime) ? command.EndTaskDate.ToEndDayOfGeorgianDateTime() : command.EndTaskDate.ToGeorgianDateWithTime(command.EndTaskTime);
|
|
|
|
var task = new Tasks(command.Title, command.Description, command.SenderId, command.ContractingPartyName, ticketId);
|
|
_taskRepository.Create(task);
|
|
ticket.AssignedToTasks();
|
|
_assignRepository.SaveChanges();
|
|
|
|
|
|
foreach (var receiver in receivers)
|
|
{
|
|
var assign = new Assign(task.id, task.SenderId, receiver.id, sender.Position.PositionValue, receiver.Fullname,
|
|
receiver.Position.PositionValue, endTask, true);
|
|
_assignRepository.Create(assign);
|
|
}
|
|
_assignRepository.SaveChanges();
|
|
|
|
|
|
#region SaveMedias
|
|
|
|
#region SaveDocuments
|
|
|
|
if (command.UploadedMedia?.Count > 0)
|
|
{
|
|
foreach (var mediaId in command.UploadedMedia)
|
|
{
|
|
var media = _mediaRepository.Get(mediaId);
|
|
var oldPath = media.Path;
|
|
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
|
|
"Task", $"{task.id}");
|
|
Directory.CreateDirectory(path);
|
|
|
|
|
|
|
|
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
|
|
File.Move(oldPath, filepath);
|
|
|
|
media.Edit(filepath, media.Type, media.Category);
|
|
|
|
_mediaRepository.SaveChanges();
|
|
_mediaRepository.CreateMediaWithTaskMedia(task.id, media.id);
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
if (command.UploadedVoiceMedia > 0)
|
|
{
|
|
var media = _mediaRepository.Get(command.UploadedVoiceMedia);
|
|
var oldPath = media.Path;
|
|
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
|
|
"Task", $"{task.id}");
|
|
Directory.CreateDirectory(path);
|
|
|
|
|
|
|
|
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
|
|
File.Move(oldPath, filepath);
|
|
|
|
media.Edit(filepath, media.Type, "صوت");
|
|
|
|
_mediaRepository.SaveChanges();
|
|
_mediaRepository.CreateMediaWithTaskMedia(task.id, media.id);
|
|
|
|
}
|
|
#endregion
|
|
|
|
|
|
_taskRepository.SaveChanges();
|
|
|
|
return operation.Succcedded(task.id);
|
|
}
|
|
|
|
public OperationResult CompleteTicket(long id)
|
|
{
|
|
var operation = new OperationResult();
|
|
if (!_ticketRepository.Exists(x => x.id == id))
|
|
{
|
|
return operation.Failed("چنین تیکتی وجود ندارد");
|
|
}
|
|
var ticket = _ticketRepository.Get(id);
|
|
ticket.Completed();
|
|
_ticketRepository.SaveChanges();
|
|
return operation.Succcedded(ticket.id);
|
|
}
|
|
|
|
public OperationResult AdminResponseTicket(ResponseTicket command)
|
|
{
|
|
var operation = new OperationResult();
|
|
if (string.IsNullOrWhiteSpace(command.Response) && !(command.UploadedFileIds?.Count > 0) && !(command.VoiceId > 0))
|
|
{
|
|
return operation.Failed("لطفا پیغام یا فایل را وارد کنید");
|
|
}
|
|
|
|
if (string.IsNullOrWhiteSpace(command.Response))
|
|
{
|
|
command.Response = "$GOzaReshgirMediaVoIce@";
|
|
}
|
|
|
|
var adminRes = new AdminResponse(command.Response, command.TicketId, command.AdminId);
|
|
if (_ticketAccessAccountApplication.HasTicketAccess(command.AdminId))
|
|
adminRes.Active();
|
|
var ticket = _ticketRepository.Get(command.TicketId);
|
|
_ticketRepository.CreateAdminResponse(adminRes);
|
|
ticket.Responded();
|
|
_ticketRepository.SaveChanges();
|
|
|
|
|
|
#region SaveDocuments
|
|
|
|
if (command.UploadedFileIds?.Count > 0)
|
|
{
|
|
foreach (var mediaId in command.UploadedFileIds)
|
|
{
|
|
var media = _mediaRepository.Get(mediaId);
|
|
var oldPath = media.Path;
|
|
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
|
|
"TicketAdminResponse", $"{adminRes.id}");
|
|
Directory.CreateDirectory(path);
|
|
|
|
|
|
|
|
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
|
|
File.Move(oldPath, filepath);
|
|
|
|
media.Edit(filepath, media.Type, media.Category);
|
|
|
|
_mediaRepository.SaveChanges();
|
|
_mediaRepository.CreateAdminResponseMedia(adminRes.id, media.id);
|
|
}
|
|
}
|
|
if (command.VoiceId > 0)
|
|
{
|
|
var media = _mediaRepository.Get(command.VoiceId);
|
|
var oldPath = media.Path;
|
|
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
|
|
"TicketAdminResponse", $"{adminRes.id}");
|
|
Directory.CreateDirectory(path);
|
|
|
|
|
|
|
|
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
|
|
File.Move(oldPath, filepath);
|
|
|
|
media.Edit(filepath, media.Type, "صوت");
|
|
|
|
_mediaRepository.SaveChanges();
|
|
_mediaRepository.CreateAdminResponseMedia(adminRes.id, media.id);
|
|
}
|
|
|
|
#endregion
|
|
_mediaRepository.SaveChanges();
|
|
|
|
|
|
return operation.Succcedded(adminRes.id);
|
|
}
|
|
|
|
public OperationResult ClientResponseTicket(ResponseTicket command)
|
|
{
|
|
var operation = new OperationResult();
|
|
if (string.IsNullOrWhiteSpace(command.Response) && !(command.UploadedFileIds?.Count > 0) && !(command.VoiceId > 0))
|
|
{
|
|
return operation.Failed("لطفا پیغام یا فایل را وارد کنید");
|
|
}
|
|
|
|
if (string.IsNullOrWhiteSpace(command.Response))
|
|
{
|
|
command.Response = "$GOzaReshgirMediaVoIce@";
|
|
}
|
|
|
|
var clientRes = new ClientResponse(command.Response, command.TicketId);
|
|
var ticket = _ticketRepository.Get(command.TicketId);
|
|
_ticketRepository.CreateClientResponse(clientRes);
|
|
ticket.Open();
|
|
_ticketRepository.SaveChanges();
|
|
#region SaveDocuments
|
|
|
|
if (command.UploadedFileIds?.Count > 0)
|
|
{
|
|
foreach (var mediaId in command.UploadedFileIds)
|
|
{
|
|
var media = _mediaRepository.Get(mediaId);
|
|
var oldPath = media.Path;
|
|
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
|
|
"TicketClientResponse", $"{clientRes.id}");
|
|
Directory.CreateDirectory(path);
|
|
|
|
|
|
|
|
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
|
|
File.Move(oldPath, filepath);
|
|
|
|
media.Edit(filepath, media.Type, media.Category);
|
|
|
|
_mediaRepository.SaveChanges();
|
|
_mediaRepository.CreateClientResponseMedia(clientRes.id, media.id);
|
|
}
|
|
}
|
|
|
|
if (command.VoiceId > 0)
|
|
{
|
|
var media = _mediaRepository.Get(command.VoiceId);
|
|
var oldPath = media.Path;
|
|
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
|
|
"TicketClientResponse", $"{clientRes.id}");
|
|
Directory.CreateDirectory(path);
|
|
|
|
|
|
|
|
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
|
|
File.Move(oldPath, filepath);
|
|
|
|
media.Edit(filepath, media.Type, "صوت");
|
|
|
|
_mediaRepository.SaveChanges();
|
|
_mediaRepository.CreateClientResponseMedia(clientRes.id, media.id);
|
|
}
|
|
|
|
#endregion
|
|
_mediaRepository.SaveChanges();
|
|
return operation.Succcedded(clientRes.id);
|
|
}
|
|
|
|
public EditTicket GetDetails(long id)
|
|
{
|
|
return _ticketRepository.GetDetails(id);
|
|
}
|
|
|
|
public EditTicket GetDetailsForClient(long id)
|
|
{
|
|
return _ticketRepository.GetDetailsForClient(id);
|
|
}
|
|
|
|
public List<TicketViewModel> GetAll(TicketSearchModel searchModel)
|
|
{
|
|
return _ticketRepository.GetAll(searchModel);
|
|
}
|
|
|
|
public List<TicketViewModel> GetDeletedTicket()
|
|
{
|
|
return _ticketRepository.GetDeletedTicket();
|
|
}
|
|
|
|
public bool IsExist(long id)
|
|
{
|
|
return _ticketRepository.Exists(x => x.id == id);
|
|
}
|
|
public OperationResult UploadMedia(IFormFile mediaFile, long senderId)
|
|
{
|
|
var operation = new OperationResult();
|
|
if ((mediaFile.Length > 5000000) || (mediaFile.Length > 5000000) || (mediaFile.Length > 5000000))
|
|
return operation.Failed("حجم فایل نمیتواند از 5 مگابایت بیشتر باشد");
|
|
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
|
|
"temp", $"{senderId}");
|
|
Directory.CreateDirectory(path);
|
|
|
|
string uniqueFileName = $"{Path.GetFileNameWithoutExtension(mediaFile.FileName)}_{DateTime.Now.Ticks}{Path.GetExtension(mediaFile.FileName)}";
|
|
string filepath = Path.Combine(path, uniqueFileName);
|
|
|
|
using (var stream = new FileStream(filepath, FileMode.Create))
|
|
{
|
|
mediaFile.CopyTo(stream);
|
|
|
|
}
|
|
var type = Path.GetExtension(filepath);
|
|
var media = new Media(filepath, type, "فایل", "Ticket");
|
|
_mediaRepository.Create(media);
|
|
_mediaRepository.SaveChanges();
|
|
return operation.Succcedded(media.id);
|
|
|
|
}
|
|
|
|
public OperationResult RemoveMedia(long mediaId)
|
|
{
|
|
var operation = new OperationResult();
|
|
try
|
|
{
|
|
var media = _mediaRepository.Get(mediaId);
|
|
var path = media.Path;
|
|
if (File.Exists(path))
|
|
{
|
|
File.Delete(path);
|
|
}
|
|
_mediaRepository.Remove(mediaId);
|
|
return operation.Succcedded();
|
|
}
|
|
catch
|
|
{
|
|
return operation.Failed("مشکلی در حذف این فایل وجود دارد");
|
|
}
|
|
|
|
}
|
|
|
|
public void RemoveTempUploadedFiles(long userId)
|
|
{
|
|
var path = Path.Combine($"{_taskRepository.GetWebEnvironmentPath()}", "Storage",
|
|
"temp", $"{userId}");
|
|
|
|
|
|
if (Directory.Exists(path))
|
|
{
|
|
|
|
Directory.Delete(path, true);
|
|
}
|
|
|
|
}
|
|
|
|
public List<TicketViewModel> GetTicketsForClients(TicketSearchModel searchModel)
|
|
{
|
|
return _ticketRepository.GetTicketsForClients(searchModel);
|
|
}
|
|
|
|
public OperationResult AcceptPendingAdminResponse(long adminResId)
|
|
{
|
|
var operation = new OperationResult();
|
|
var adminRes = _ticketRepository.GetAdminResponse(adminResId);
|
|
var ticket = _ticketRepository.Get(adminRes.TicketId);
|
|
|
|
|
|
if (adminRes.IsActiveString == "true")
|
|
{
|
|
return operation.Failed("خطایی رخ داده است . لطفا با مدیر سیستم تماس بگیرید");
|
|
}
|
|
adminRes.Active();
|
|
ticket.Responded();
|
|
_ticketRepository.SaveChanges();
|
|
return operation.Succcedded();
|
|
}
|
|
|
|
public OperationResult RejectPendingAdminResponse(long adminResId)
|
|
{
|
|
var operation = new OperationResult();
|
|
var adminRes = _ticketRepository.GetAdminResponse(adminResId);
|
|
if (adminRes.IsActiveString == "true")
|
|
{
|
|
return operation.Failed("خطایی رخ داده است . لطفا با مدیر سیستم تماس بگیرید");
|
|
}
|
|
_ticketRepository.RemoveAdminResponse(adminResId);
|
|
_ticketRepository.SaveChanges();
|
|
return operation.Succcedded();
|
|
|
|
}
|
|
|
|
public OperationResult EditAndAcceptPendingAdminResponse(long adminResId, string newResponse)
|
|
{
|
|
var operation = new OperationResult();
|
|
var adminRes = _ticketRepository.GetAdminResponse(adminResId);
|
|
var ticket = _ticketRepository.Get(adminRes.TicketId);
|
|
if (adminRes.IsActiveString == "true")
|
|
{
|
|
return operation.Failed("خطایی رخ داده است . لطفا با مدیر سیستم تماس بگیرید");
|
|
}
|
|
adminRes.Edit(newResponse);
|
|
adminRes.Active();
|
|
ticket.Responded();
|
|
_ticketRepository.SaveChanges();
|
|
return operation.Succcedded();
|
|
}
|
|
|
|
public OperationResult DeletePendingAdminResponse(int adminResId)
|
|
{
|
|
var operation = new OperationResult();
|
|
var userId = _authHelper.CurrentAccountId();
|
|
try
|
|
{
|
|
var adminRes = _ticketRepository.GetAdminResponse(adminResId);
|
|
if (adminRes.AdminAccountId != userId)
|
|
{
|
|
return operation.Failed("شما نمیتوانید این پیام را پاک کنید");
|
|
}
|
|
if (adminRes.IsActiveString == "true")
|
|
{
|
|
return operation.Failed("شما نمیتوانید این پیام را پاک کنید");
|
|
}
|
|
_ticketRepository.RemoveAdminResponse(adminResId);
|
|
_taskRepository.SaveChanges();
|
|
return operation.Succcedded();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
return operation.Failed(e.ToString());
|
|
}
|
|
}
|
|
|
|
public OperationResult EditPendingAdminResponse(long adminResId, string newMessage)
|
|
{
|
|
var operation = new OperationResult();
|
|
var entity = _ticketRepository.GetAdminResponse(adminResId);
|
|
if (entity == null)
|
|
{
|
|
return operation.Failed("مشکل سیستمی!!");
|
|
}
|
|
entity.Edit(newMessage);
|
|
_ticketRepository.SaveChanges();
|
|
return operation.Succcedded();
|
|
}
|
|
|
|
public OperationResult CloseTicket(long ticketId)
|
|
{
|
|
var operation = new OperationResult();
|
|
var ticket = _ticketRepository.Get(ticketId);
|
|
if (ticket == null)
|
|
{
|
|
return operation.Failed("اطلاعات وارد شده نامعتبر است");
|
|
}
|
|
ticket.Completed();
|
|
_ticketRepository.SaveChanges();
|
|
return operation.Succcedded();
|
|
}
|
|
|
|
public OperationResult DeleteTicket(long ticketId)
|
|
{
|
|
var op = new OperationResult();
|
|
var ticket = _ticketRepository.Get(ticketId);
|
|
if (ticket == null)
|
|
return op.Failed("چنین آیتمی وجود ندارد");
|
|
ticket.Delete();
|
|
_ticketRepository.SaveChanges();
|
|
return op.Succcedded();
|
|
}
|
|
|
|
public OperationResult RestoreDeletedTicket(long ticketId)
|
|
{
|
|
var op = new OperationResult();
|
|
var ticket = _ticketRepository.Get(ticketId);
|
|
if (ticket == null)
|
|
return op.Failed("چنین آیتمی وجود ندارد");
|
|
ticket.RestoreDelete ();
|
|
_ticketRepository.SaveChanges();
|
|
return op.Succcedded();
|
|
}
|
|
|
|
public TypesCountOfTicketViewModel GetTypesCountOfTicketForAdmin()
|
|
{
|
|
return _ticketRepository.GetTypesCountOfTicketForAdmin();
|
|
}
|
|
|
|
public TypesCountOfTicketViewModel GetTypesCountOfTicketForClient(long workshopId)
|
|
{
|
|
return _ticketRepository.GetTypesCountOfTicketForClient(workshopId);
|
|
}
|
|
|
|
#region Vafa
|
|
|
|
public int GetAdminTicketsCount()
|
|
{
|
|
return _ticketRepository.GetAdminTicketsCount();
|
|
}
|
|
|
|
#endregion
|
|
} |