1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
| namespace HotelPms.SourceFactory.Util
| {
| public class TypeScriptFactory
| {
| public static string ToTsType(string sqlType)
| {
| switch (sqlType)
| {
| case "int":
| case "tinyint":
| case "smallint":
| case "decimal":
| case "float":
| return "number";
| case "bit":
| return "boolean";
| case "smalldatetime":
| case "datetime":
| return "Date";
| default:
| return "string";
| }
| }
|
| public static string GetDefValue(string sqlType)
| {
| switch (sqlType)
| {
| case "int":
| case "tinyint":
| case "smallint":
| return "0";
| case "decimal":
| case "float":
| return "0";
| case "bit":
| return "false";
| case "smalldatetime":
| case "datetime":
| return "new Date()";
| default:
| return "''";
| }
| }
| }
| }
|
|