计算日期后自动更新数据库字段?

Update the database field automatically after calculating the date?

我在数据库中有一个 table 包含两个日期,

第一个字段:开始日期 = "1400/01/08" 第二个字段:enddate = 流式计算后...

在这个table中我有一个字节类型的字段

AllowField = "0"

1-我想获取今天的日期,如果今天的月份在01到06之间...

例如:var six1 = "1400/01/01,

我想将“six1”乘以“31”: 例如:var resualt1 = "1400/01/01 * 31 = 1400/02/01" 并在“结束日期”字段中保存“resualt1”

2-如果今天的月份在 07 到 12 之间...

例如:var six2 = "1400/07/01,

我想将“six2”乘以“30”: 例如:var resualt2 = "1400/07/01 * 30 = 1400/08/01" 并在“结束日期”字段中保存“resualt2”

如果今天的日期不在“开始日期”和“结束日期”之间,我想加载表格

"AllowField" 自动将其值改为 1,反之Õ

DateTime class in C# has a method called AddMonths.

var thisDayNextMonth = currentDate.AddMonths(1);

请不要自制奇怪的解决方案。标准问题有标准的解决方案,在 C# 中它们真的很容易找到,一点也不晦涩。