transport loading order status in brisanje
This commit is contained in:
@@ -75,8 +75,8 @@ namespace EveryThing.Pages.Invoices
|
||||
|
||||
ViewData["States"] = new SelectList(Enum.GetValues(typeof(Models.Invoice.Invoice.InvoiceState))
|
||||
.Cast<Models.Invoice.Invoice.InvoiceState>()
|
||||
.Where(x => GetAttribute<Models.Invoice.Invoice.InvoiceStateAttribute>(x).AllowedTypes.Split(',').Contains(((int)Invoice.Type).ToString()))
|
||||
.Select(x => new { Name = GetAttribute<DisplayAttribute>(x).Name, Value = x.ToString()})
|
||||
.Where(x => Classes.Global.GetAttribute<Models.Invoice.Invoice.InvoiceStateAttribute>(x).AllowedTypes.Split(',').Contains(((int)Invoice.Type).ToString()))
|
||||
.Select(x => new { Name = Classes.Global.GetAttribute<DisplayAttribute>(x).Name, Value = x.ToString()})
|
||||
.ToList(), "Value", "Name");
|
||||
|
||||
if (!string.IsNullOrEmpty(Request.Headers["Referer"]))
|
||||
@@ -87,13 +87,7 @@ namespace EveryThing.Pages.Invoices
|
||||
return Page();
|
||||
}
|
||||
|
||||
public static TAttribute GetAttribute<TAttribute>(Enum value)
|
||||
where TAttribute : Attribute
|
||||
{
|
||||
var enumType = value.GetType();
|
||||
var name = Enum.GetName(enumType, value);
|
||||
return enumType.GetField(name).GetCustomAttributes(false).OfType<TAttribute>().SingleOrDefault();
|
||||
}
|
||||
|
||||
|
||||
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
|
||||
// more details see https://aka.ms/RazorPagesCRUD.
|
||||
|
||||
Reference in New Issue
Block a user