доработки
This commit is contained in:
parent
6e622c82ce
commit
2132887869
@ -8,7 +8,8 @@ namespace UniversityContracts.BindingModels
|
||||
{
|
||||
public class PaymentBindingModel
|
||||
{
|
||||
public DateOnly Date { get; set; } = DateOnly.FromDateTime(DateTime.Now);
|
||||
public DateTime DateCreate { get; set; } = DateTime.Now;
|
||||
|
||||
|
||||
public double PaidPrice { get; set; }
|
||||
|
||||
|
@ -12,7 +12,7 @@ namespace UniversityContracts.SearchModels
|
||||
public int? ClassId { get; set; }
|
||||
public int? PurchaseId { get; set; }
|
||||
|
||||
public DateOnly? DateFrom { get; set; }
|
||||
public DateOnly? DateTo { get; set; }
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
}
|
||||
}
|
@ -20,7 +20,7 @@ namespace BankContracts.ViewModels
|
||||
public double PaidPrice { get; set; }
|
||||
public int ClassByPurchaseId { get; set; }
|
||||
[DisplayName("Дата оплаты")]
|
||||
public DateOnly Date { get; set; } = DateOnly.FromDateTime(DateTime.Now);
|
||||
public DateTime DateCreate { get; set; } = DateTime.Now;
|
||||
public ClassByPurchaseModel ClassByPurchase { get; set; }
|
||||
|
||||
// Машины для отчета за период
|
||||
|
@ -9,7 +9,7 @@ namespace UniversityDataModels
|
||||
public interface IPaymentModel : IId
|
||||
{
|
||||
double PaidPrice { get; }
|
||||
DateOnly Date { get; }
|
||||
DateTime DateCreate { get; }
|
||||
int ClassByPurchaseId { get; }
|
||||
}
|
||||
}
|
||||
|
@ -44,9 +44,9 @@ namespace UniversityDatabaseImplement.Implements
|
||||
using var context = new UniversityDB();
|
||||
if (model.DateFrom.HasValue)
|
||||
return Payments(context)
|
||||
.Where(x => model.DateFrom.Value <= x.Date && x.Date <= model.DateTo.Value)
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
.Where(x => x.DateCreate >= model.DateFrom.Value && x.DateCreate <= model.DateTo.Value)
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
|
||||
return Payments(context)
|
||||
.Where(x => x.ClassByPurchase != null &&
|
||||
|
@ -13,7 +13,7 @@ namespace UniversityDatabaseImplement.Models
|
||||
public int ClassByPurchaseId { get; private set; }
|
||||
|
||||
[Required]
|
||||
public DateOnly Date { get; private set; }
|
||||
public DateTime DateCreate { get; private set; }
|
||||
|
||||
[Required]
|
||||
public double PaidPrice { get; private set; }
|
||||
@ -32,8 +32,8 @@ namespace UniversityDatabaseImplement.Models
|
||||
return new Payment()
|
||||
{
|
||||
|
||||
Date = model.Date,
|
||||
PaidPrice = model.PaidPrice,
|
||||
DateCreate = model.DateCreate,
|
||||
PaidPrice = model.PaidPrice,
|
||||
Id = model.Id,
|
||||
ClassByPurchaseId = model.ClassByPurchaseId,
|
||||
};
|
||||
@ -43,8 +43,8 @@ namespace UniversityDatabaseImplement.Models
|
||||
Operation = ClassByPurchase?.Class?.GetViewModel,
|
||||
ClassByPurchase = ClassByPurchase,
|
||||
FullPrice = ClassByPurchase?.Class?.Price ?? -1,
|
||||
Date = Date,
|
||||
PaidPrice = PaidPrice,
|
||||
DateCreate = DateCreate,
|
||||
PaidPrice = PaidPrice,
|
||||
Id = Id,
|
||||
ClassByPurchaseId = ClassByPurchaseId,
|
||||
};
|
||||
|
@ -11,7 +11,7 @@ namespace UniversityDatabaseImplement
|
||||
{
|
||||
if (optionsBuilder.IsConfigured == false)
|
||||
{
|
||||
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=UniversityDB;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=University;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
}
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user