This repository has been archived by the owner on Dec 24, 2022. It is now read-only.
/
Main.cs
123 lines (79 loc) · 3.53 KB
/
Main.cs
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
using System;
using System.Data;
using System.Collections.Generic;
using ServiceStack.Common.Utils;
using ServiceStack.DataAnnotations;
using ServiceStack.Common;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Firebird;
namespace TestLiteFirebir03
{
class MainClass
{
public static void Main (string[] args)
{
OrmLiteConfig.DialectProvider = new FirebirdOrmLiteDialectProvider();
using (IDbConnection db =
"User=SYSDBA;Password=masterkey;Database=employee.fdb;DataSource=localhost;Dialect=3;charset=ISO8859_1;".OpenDbConnection())
{
Schema fbd= new Schema(){
Connection = db
};
Console.WriteLine("--------TABLES-------------");
var tables = fbd.Tables;
foreach(Table t in tables){
Console.WriteLine(t.Name);
}
Console.WriteLine("-------users's owner--------------");
Table t1 = fbd.GetTable("USERS");
Console.WriteLine(t1.Owner);
Console.WriteLine ("---------user's columns ----------------");
var Columns = fbd.GetColumns("USERS");
foreach(Column cl in Columns){
Console.WriteLine("{0}--{1}--{2}--{3} -- {4}-- {5}--{6} ",
cl.Name,cl.Position, cl.Nullable, cl.Length, cl.DbType, cl.NetType, cl.Sequence);
}
Console.WriteLine("--------------------------------------------");
Console.WriteLine("EMPLOYEE's Columns ");
Columns = fbd.GetColumns("EMPLOYEE");
foreach(Column cl in Columns){
Console.WriteLine("{0}--{1}--{2}--{3} -- {4}-- {5}--{6} -- Computed {7} ",
cl.Name,cl.Position, cl.Nullable, cl.Length, cl.DbType,
cl.NetType, cl.Sequence,cl.IsComputed);
}
Columns = fbd.GetColumns("COMPANY");
foreach(Column cl in Columns){
Console.WriteLine("{0}--{1}--{2}--{3} -- {4}-- {5}--{6} ",
cl.Name,cl.Position, cl.Nullable, cl.Length, cl.DbType, cl.NetType, cl.Sequence);
}
Console.WriteLine("--------------------------------------------");
Console.WriteLine("-----------------Procedure---------------------------");
Console.WriteLine ("----- ADD_EMP_PROJ ----");
Procedure p = fbd.GetProcedure("ADD_EMP_PROJ");
Console.WriteLine("p.Name {0} p.Owner {1} p.Inputs {2} p.Outputs {3} p.Type {4}",
p.Name, p.Owner, p.Inputs, p.Outputs, p.Type);
var parameters = fbd.GetParameters(p);
foreach( var par in parameters){
Console.WriteLine("p.ProcedureName {0} p.Name {1} p.Position {2} p.ParameterType {3} p.DbType {4} p.NetType {5}",
par.ProcedureName, par.Name, par.Position, par.Direction, par.DbType, par.NetType);
}
Console.WriteLine ("----- ALL_LANGS ----");
p = fbd.GetProcedure("ALL_LANGS");
Console.WriteLine("p.Name {0} p.Owner {1} p.Inputs {2} p.Outputs {3} p.Type {4}",
p.Name, p.Owner, p.Inputs, p.Outputs, p.Type);
parameters = fbd.GetParameters(p);
parameters = fbd.GetParameters(p);
foreach( var par in parameters){
Console.WriteLine("p.ProcedureName {0} p.Name {1} p.Position {2} p.ParameterType {3} p.DbType {4} p.NetType {5}",
par.ProcedureName, par.Name, par.Position, par.Direction, par.DbType, par.NetType);
}
ClassWriter cw = new ClassWriter(){
Schema=fbd,
};
cw.WriteClass( new Table(){Name="EMPLOYEE"} );
Console.WriteLine("This is The End my friend");
//DTOGenerator
}
}
}
}