From e5fc772089ac70899c51bbef4125627416a05051 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 10 Dec 2019 16:56:02 +0000 Subject: [PATCH] --- server/AyaNova/biz/WidgetBiz.cs | 3 +++ server/AyaNova/models/Widget.cs | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server/AyaNova/biz/WidgetBiz.cs b/server/AyaNova/biz/WidgetBiz.cs index 0ea40ab4..5cae9107 100644 --- a/server/AyaNova/biz/WidgetBiz.cs +++ b/server/AyaNova/biz/WidgetBiz.cs @@ -365,6 +365,9 @@ namespace AyaNova.Biz //Can save or update? private void Validate(Widget proposedObj, Widget currentObj) { + + //NOTE: In DB schema only name and serial are not nullable + //run validation and biz rules bool isNew = currentObj == null; diff --git a/server/AyaNova/models/Widget.cs b/server/AyaNova/models/Widget.cs index e6141b15..db4d95e4 100644 --- a/server/AyaNova/models/Widget.cs +++ b/server/AyaNova/models/Widget.cs @@ -7,7 +7,8 @@ using System.ComponentModel.DataAnnotations; namespace AyaNova.Models { - //Test class for development + //NOTE: Any non required field (nullable in DB) sb nullable here, i.e. decimal? not decimal, otherwise the server will call it an invalid record if the field isn't sent from client + //NOTE: In Widget DB schema only name and serial are not nullable public partial class Widget { public long Id { get; set; } @@ -22,7 +23,7 @@ namespace AyaNova.Models public DateTime? StartDate { get; set; } public DateTime? EndDate { get; set; } public string Notes { get; set; } - public int Count { get; set; } + public int? Count { get; set; } public string CustomFields { get; set; } public List Tags { get; set; }