| | |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_Core.DB; |
| | | using WIDESEA_Core.DB.Models; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.Seed; |
| | | using WIDESEA_Core.Tenants; |
| | |
| | | ruleConfig.ModifyDate = DateTime.Now; |
| | | |
| | | code = ruleConfig.Format; |
| | | code = code.Replace("[YYYY]", now.Year.ToString().PadLeft(4, '0')); |
| | | code = code.Replace("[YY]", now.Year.ToString().Substring(2, 2)); |
| | | code = code.Replace("[MM]", now.Month.ToString().PadLeft(2, '0')); |
| | | code = code.Replace("[DD]", now.Day.ToString().PadLeft(2, '0')); |
| | | code = code.Replace("[ST]", ruleConfig.StartStr.ToString()); |
| | | code = code.Replace("[NUM]", ruleConfig.CurrentVal.ToString().PadLeft(ruleConfig.Length ?? 0, '0')); |
| | | code = code.Replace($"[{CodeFormat.YYYY}]", now.Year.ToString().PadLeft(4, '0')); |
| | | code = code.Replace($"[{CodeFormat.MM}]", now.Month.ToString().PadLeft(2, '0')); |
| | | code = code.Replace($"[{CodeFormat.DD}]", now.Day.ToString().PadLeft(2, '0')); |
| | | code = code.Replace($"[{CodeFormat.ST}]", ruleConfig.StartStr.ToString()); |
| | | code = code.Replace($"[{CodeFormat.NUM}]", ruleConfig.CurrentVal.ToString().PadLeft(ruleConfig.Length ?? 0, '0')); |
| | | } |
| | | catch (Exception ex) |
| | | { |