fix file session bug
This commit is contained in:
@@ -22,10 +22,11 @@ public class BoardApplication : IBoardApplication
|
||||
|
||||
var disputeResolutionPetitionDate = new DateTime();
|
||||
|
||||
disputeResolutionPetitionDate = command.DisputeResolutionPetitionDate.ToGeorgianDateTime();
|
||||
//TODO if
|
||||
//if(_BoardRepository.Exists(x=>x.Branch == command.Branch))
|
||||
// operation.Failed("fail message")
|
||||
if (!command.DisputeResolutionPetitionDate.TryToGeorgianDateTime(out disputeResolutionPetitionDate))
|
||||
{
|
||||
disputeResolutionPetitionDate = new DateTime();
|
||||
}
|
||||
|
||||
|
||||
var board = new Board(disputeResolutionPetitionDate, command.Branch, command.BoardChairman,
|
||||
command.ExpertReport,command.File_Id, command.BoardType_Id);
|
||||
@@ -41,7 +42,11 @@ public class BoardApplication : IBoardApplication
|
||||
var board = _boardRepository.Get(command.Id);
|
||||
|
||||
var disputeResolutionPetitionDate = new DateTime();
|
||||
disputeResolutionPetitionDate = command.DisputeResolutionPetitionDate.ToGeorgianDateTime();
|
||||
|
||||
if (!command.DisputeResolutionPetitionDate.TryToGeorgianDateTime(out disputeResolutionPetitionDate))
|
||||
{
|
||||
disputeResolutionPetitionDate = new DateTime();
|
||||
}
|
||||
|
||||
//TODO
|
||||
//if(_BoardRepository.Exists(x=>x.Branch == command.Branch))
|
||||
|
||||
@@ -84,6 +84,7 @@ public class FileAlertApplication : IFileAlertApplication
|
||||
foreach (var item in files)
|
||||
{
|
||||
var file = _fileApplication.GetFileDetails(item);
|
||||
Console.WriteLine(file.Id);
|
||||
file.State = _fileStateApplication.GetFileState(file);
|
||||
|
||||
if (file.State == 0)
|
||||
|
||||
@@ -48,9 +48,13 @@ public class ProceedingSessionApplication : IProceedingSessionApplication
|
||||
|
||||
if (!command.Date.TryToGeorgianDateTime(out Date))
|
||||
{
|
||||
operation.Failed("تاریخ ")
|
||||
return operation.Failed("تاریخ جلسه وارد شده نامعتبر است ");
|
||||
}
|
||||
|
||||
if (!TimeOnly.TryParse(command.Time, out _))
|
||||
{
|
||||
return operation.Failed("ساعت جلسه وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
|
||||
var proSession = new ProceedingSession(Date, command.Time, command.Board_Id);
|
||||
@@ -122,8 +126,8 @@ public class ProceedingSessionApplication : IProceedingSessionApplication
|
||||
var viewModels = new List<ProceedingSessionViewModel>();
|
||||
|
||||
|
||||
searchModel.FromDate = CreateFrom_ToDate(searchModel)[0];
|
||||
searchModel.ToDate = CreateFrom_ToDate(searchModel)[1];
|
||||
//searchModel.FromDate = CreateFrom_ToDate(searchModel)[0];
|
||||
//searchModel.ToDate = CreateFrom_ToDate(searchModel)[1];
|
||||
|
||||
var proseedingSessions = Search(searchModel)
|
||||
.OrderBy(x => x.Date)
|
||||
@@ -179,7 +183,11 @@ public class ProceedingSessionApplication : IProceedingSessionApplication
|
||||
i++;
|
||||
}
|
||||
|
||||
var days = Tools.GetDaysBetweenDateGeorgian(startDate.ToGeorgianDateTime(), endDate.ToGeorgianDateTime());
|
||||
List<string> days = [];
|
||||
if (!string.IsNullOrWhiteSpace(startDate) && !string.IsNullOrWhiteSpace(endDate))
|
||||
{
|
||||
days = Tools.GetDaysBetweenDateGeorgian(startDate.ToGeorgianDateTime(), endDate.ToGeorgianDateTime());
|
||||
}
|
||||
|
||||
//foreach (var item in new List<ProceedingSessionViewModel>(viewModels))
|
||||
//{
|
||||
@@ -241,7 +249,7 @@ public class ProceedingSessionApplication : IProceedingSessionApplication
|
||||
if (searchModel.Board.BoardType_Id != 0 && board.BoardType_Id != searchModel.Board.BoardType_Id)
|
||||
continue;
|
||||
|
||||
if(searchModel.Board.BoardChairman != null)
|
||||
if (searchModel.Board.BoardChairman != null)
|
||||
{
|
||||
if (board.BoardChairman == null)
|
||||
continue;
|
||||
@@ -325,7 +333,7 @@ public class ProceedingSessionApplication : IProceedingSessionApplication
|
||||
{
|
||||
var pastProceedingSessions = _proceedingSessionRepository.Search(new ProceedingSessionSearchModel { Status = 1, ToDate = DateTime.Today.AddDays(-1).ToFarsi() });
|
||||
|
||||
foreach(var PS in pastProceedingSessions)
|
||||
foreach (var PS in pastProceedingSessions)
|
||||
{
|
||||
var proceedingSession = _proceedingSessionRepository.Get(PS.Id);
|
||||
proceedingSession.Edit(PS.Date.ToGeorgianDateTime(), PS.Time, PS.Board_Id, 2);
|
||||
|
||||
@@ -40,22 +40,22 @@ public class ProceedingSessionRepository : RepositoryBase<long, ProceedingSessio
|
||||
|
||||
//TODO if
|
||||
|
||||
if(searchModel.Id != 0)
|
||||
if (searchModel.Id != 0)
|
||||
{
|
||||
query = query.Where(x => x.Id == searchModel.Id);
|
||||
}
|
||||
|
||||
if(searchModel.Board_Id != 0)
|
||||
if (searchModel.Board_Id != 0)
|
||||
{
|
||||
query = query.Where(x => x.Board_Id == searchModel.Board_Id);
|
||||
}
|
||||
|
||||
if(searchModel.Status != 0)
|
||||
if (searchModel.Status != 0)
|
||||
{
|
||||
query = query.Where(x => x.Status == searchModel.Status);
|
||||
}
|
||||
|
||||
if(!string.IsNullOrEmpty(searchModel.FromDate))
|
||||
if (!string.IsNullOrEmpty(searchModel.FromDate))
|
||||
{
|
||||
query = query.Where(x => x.Date >= searchModel.FromDate.ToGeorgianDateTime());
|
||||
}
|
||||
@@ -70,7 +70,20 @@ public class ProceedingSessionRepository : RepositoryBase<long, ProceedingSessio
|
||||
query = query.Where(x => x.Time == searchModel.Time);
|
||||
}
|
||||
|
||||
return query.Select(x => new EditProceedingSession {
|
||||
if (searchModel.Year != 0 && searchModel.Month != 0)
|
||||
{
|
||||
var start = $"{searchModel.Year:0000}/{searchModel.Month:00}/01";
|
||||
var end = start.FindeEndOfMonth();
|
||||
|
||||
|
||||
var startGr = start.ToGeorgianDateTime();
|
||||
var endGr = end.ToGeorgianDateTime();
|
||||
|
||||
query = query.Where(x => x.Date >= startGr && x.Date <= endGr);
|
||||
}
|
||||
|
||||
return query.Select(x => new EditProceedingSession
|
||||
{
|
||||
Id = x.Id,
|
||||
Date = x.Date.ToFarsi(),
|
||||
Time = x.Time,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user