using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Configuration; using System.Linq; using System.Reflection.Metadata.Ecma335; using System.Text; using System.Threading.Tasks; namespace ODCWeb.Models { /* [BindProperties]*/ public class ActionTask { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int TaskId { get; set; } public string Name { get; set; } /* */ [Display(Name = "Display Name")] public string? DisplayName { get; set; } // This computed property will return DisplayName if not null, otherwise Name [NotMapped] // This prevents EF Core from trying to map this to a database column public string EffectiveDisplayName => DisplayName ?? Name; /* */ public int ActionId { get; set; } /*[IntegerValidator]*/ [Display(Name = "CC")] public double? Material_Cost { get; set; } [Display(Name="Labor Rate")] /*[IntegerValidator]*/ [Required] [Range(0, Int32.MaxValue)] public double Labor_Rate { get; set; } /// [Range(0, Int32.MaxValue)] public double? M_Labor_Cost { get; set; } [Range(0, Int32.MaxValue)] public double? M_Mat_Cost { get; set; } public double? M_Budget { get; set; } /// /// [Range(0, Int32.MaxValue)] public double? A_Labor_Cost { get; set; } [Range(0, Int32.MaxValue)] public double? A_Mat_Cost { get; set; } public double? A_Budget_Left { get; set; } public double? T_Profit_Loss { get; set; } /// [Display(Name = "Labor Cost")] public double? Labor_Cost { get; set; } [Display(Name = "Measured Work")] public double? Measured_Work { get; set; } [Display(Name = "Material and Labor")] public double? Mat_Lab { get; set; } public double? Completion { get; set; } [Display(Name = "Start Date")] public DateOnly? SDate { get; set; } public int? Duration { get; set; } [Display(Name = "Reference Id")] public string? Reference_Id { get; set; } } }