This commit is contained in:
mmrbnjd
2024-08-09 19:35:50 +03:30
parent 70df7d48b4
commit 3a4eb0a4de
5 changed files with 41 additions and 20 deletions

View File

@@ -50,6 +50,7 @@ namespace TaxPayer.Infrastructure.Persistence
public DbSet<Promotion> Promotions { get; set; } public DbSet<Promotion> Promotions { get; set; }
public DbSet<PromotionDetails> PromotionDetails { get; set; } public DbSet<PromotionDetails> PromotionDetails { get; set; }
public DbSet<CreditDocuments> CreditDocuments { get; set; } public DbSet<CreditDocuments> CreditDocuments { get; set; }
public DbSet<Condition> Conditions { get; set; }
#endregion #endregion
//public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = new CancellationToken()) //public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = new CancellationToken())
//{ //{

View File

@@ -0,0 +1,16 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace Back.Data.Models
{
public class Condition
{
public int ID { get; set; }
public int fildID { get; set; }
public string condition { get; set; }
//----------nav
[ForeignKey("fildID")]
public Fild fild { get; set; }
}
}

View File

@@ -16,6 +16,7 @@ namespace Back.Data.Models
#region Navigation #region Navigation
public virtual ICollection<FildModeInPattern> FildModeInPatterns { get; set; } public virtual ICollection<FildModeInPattern> FildModeInPatterns { get; set; }
public virtual ICollection<Coding> Codings { get; set; } public virtual ICollection<Coding> Codings { get; set; }
public virtual ICollection<Condition> Conditions { get; set; }
[NotMapped] [NotMapped]
public ICollection<SpecialCondition> specialConditions { get; set; } public ICollection<SpecialCondition> specialConditions { get; set; }
#endregion #endregion

View File

@@ -144,10 +144,19 @@ namespace Back.Services
var Bmodel = body.Clone(); var Bmodel = body.Clone();
foreach (_TaxPayer.Fild item in Bmodel) foreach (_TaxPayer.Fild item in Bmodel)
{ {
var resval = invoicedetail.GetType().GetProperties().Where(w => w.Name == item.eName).Select(s => s.GetValue(invoicedetail)).FirstOrDefault(); if (item.InputBox=="")
item.Value = resval == null ? "" : resval.ToString().Split('.').Length == 2 ? ((decimal)resval).ToString("N0") : resval.ToString(); {
item.DefVals = item.InputBox == "fromdb" ? _codingRepo.Get(w => w.FildID == item.FildID).Select(ss => new _TaxPayer.Coding() { ID = ss.Code, Name = ss.Title }).ToList() : new List<_TaxPayer.Coding>();
item.Des = item.ModeID == 3 ? _specialConditionRepo.Get(w => w.FildID == item.FildID).Select(ss => ss.condition).ToArray() : null; }
else
{
var resval = invoicedetail.GetType().GetProperties().Where(w => w.Name == item.eName).Select(s => s.GetValue(invoicedetail)).FirstOrDefault();
item.Value = resval == null ? "" : resval.ToString().Split('.').Length == 2 ? ((decimal)resval).ToString("N0") : resval.ToString();
item.DefVals = item.InputBox == "fromdb" ? _codingRepo.Get(w => w.FildID == item.FildID).Select(ss => new _TaxPayer.Coding() { ID = ss.Code, Name = ss.Title }).ToList() : new List<_TaxPayer.Coding>();
item.Des = item.ModeID == 3 ? _specialConditionRepo.Get(w => w.FildID == item.FildID).Select(ss => ss.condition).ToArray() : null;
}
} }
ret.Bodys.Add(new _TaxPayer.Filds() { ID = invoicedetail.ID, filds = Bmodel }); ret.Bodys.Add(new _TaxPayer.Filds() { ID = invoicedetail.ID, filds = Bmodel });
} }

View File

@@ -1,6 +1,7 @@
@page "/TaxPayerInvoiceItem/{InvoiceID:int}" @page "/TaxPayerInvoiceItem/{InvoiceID:int}"
@page "/FullInvoiceItem/{InvoiceID:int}" @page "/FullInvoiceItem/{InvoiceID:int}"
@using Front.Services @using Front.Services
@using Shared
@using Shared.DTOs @using Shared.DTOs
@layout PanelLayout @layout PanelLayout
@inject HttpClientController hc; @inject HttpClientController hc;
@@ -130,8 +131,6 @@ else
{ {
item.Value = bill; item.Value = bill;
} }
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
} }
else if (item.eName.ToLower() == "inp") else if (item.eName.ToLower() == "inp")
{ {
@@ -140,28 +139,23 @@ else
{ {
item.Value = patt; item.Value = patt;
} }
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
} }
else if (item.eName.ToLower() == "ins") else if (item.eName.ToLower() == "ins")
{ {
var patt = Patterns.Where(w => w.ID == Convert.ToInt32(item.Value)).Select(s => s.Title).FirstOrDefault(); InvoiceType foo = (InvoiceType)Enum.Parse(typeof(InvoiceType), item.Value);
if (patt != null) item.Value = foo.GetEnumDisplayName();
{
item.Value = patt;
}
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
} }
else if (item.eName.ToLower() == "tob")
else
{ {
CustomerType foo = (CustomerType)Enum.Parse(typeof(CustomerType), item.Value);
item.Value = foo.GetEnumDisplayName();
}
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled /> <input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
}