示例#1
0
        private IDBTable UserDetail(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2019, 9, 9), 0, eDBRevisionType.Create);
            var ret = DBMacros.AddDBTableID("UserDetail", sch, rev);

            ret.AddConstraint(new DBForeignKeyConstraintDescriptor(new List <string>()
            {
                "ID"
            }, "Common.Principal", new List <string>()
            {
                "ID"
            }),
                              new DBRevision(rev));

            ret.AddField("Username", new DBFieldDescriptor()
            {
                FieldType = new DBFieldTypeNvarchar(), Size = 512, Nullable = false
            },
                         new DBRevision(rev));

            ret.AddConstraint(new DBUniqueConstraintDescriptor("Username"),
                              new DBRevision(rev));

            ret.AddField("Email", new DBFieldDescriptor()
            {
                FieldType = new DBFieldTypeNvarchar(), Size = 512, Nullable = false
            },
                         new DBRevision(rev));

            var fldFullName = ret.AddField("Fullname", new DBFieldDescriptor()
            {
                FieldType = new DBFieldTypeNvarchar(), Size = 512, Nullable = false
            },
                                           new DBRevision(rev));

            fldFullName.AddRevision(new DBRevision(new DateTime(2019, 10, 10), 0, eDBRevisionType.Delete));

            ret.AddField("FirstName", new DBFieldDescriptor()
            {
                FieldType = new DBFieldTypeNvarchar(), Size = 512, Nullable = false
            },
                         new DBRevision(rev));

            ret.AddField("LastName", new DBFieldDescriptor()
            {
                FieldType = new DBFieldTypeNvarchar(), Size = 512, Nullable = false
            },
                         new DBRevision(rev));


            var fldNickName = ret.AddField("Nickname", new DBFieldDescriptor()
            {
                FieldType = new DBFieldTypeNvarchar(), Size = 512, Nullable = false
            },
                                           new DBRevision(rev));

            fldNickName.AddRevision(new DBRevision(new DateTime(2019, 10, 10), 0, eDBRevisionType.Delete));

            return(ret);
        }
示例#2
0
        private IDBTable RolePermission(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2016, 6, 10), 0, eDBRevisionType.Create);
            var ret = DBMacros.AddDBTableID("RolePermission", sch, rev);

            var fld = DBMacros.AddForeignKeyFieldID("RoleID", true, ret, sch.Name + ".Role",
                                                    new DBRevision(new DateTime(2016, 6, 10), 1, eDBRevisionType.Create));

            fld.AddRevision(new DBRevision(new DateTime(2016, 6, 10), 2, eDBRevisionType.Modify),
                            new DBFieldDescriptor(fld.Descriptor)
            {
                Nullable = false
            });

            DBMacros.AddForeignKeyFieldID("ClaimID", true, ret, sch.Name + ".Claim",
                                          new DBRevision(new DateTime(2016, 6, 10), 1, eDBRevisionType.Create));

            ret.AddField("CanExecute", DBMacros.DBFieldBitDescriptor(false),
                         new DBRevision(new DateTime(2016, 6, 10), 2, eDBRevisionType.Create));

            ret.AddIndex(new DBIndexDescriptor(new List <string>()
            {
                "RoleID", "ClaimID"
            }, new List <string>()
            {
                "CanExecute"
            })
            {
                Unique = true
            },
                         new DBRevision(new DateTime(2016, 6, 10), 3, eDBRevisionType.Create));

            return(ret);
        }
示例#3
0
        private IDBTable Claim(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2016, 6, 10), 0, eDBRevisionType.Create);
            var ret = DBMacros.AddDBTableID("Claim", sch, rev);

            ret.AddField("Name", DBMacros.DBFieldNazivDescriptor(false), rev);

            return(ret);
        }
示例#4
0
        private IDBTable Organization(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2020, 4, 14), 0, eDBRevisionType.Create);

            var ret = DBMacros.AddDBTableID("Organization", sch, new DBRevision(rev));

            ret.AddField("Name", DBMacros.DBFieldNazivDescriptor(false), new DBRevision(rev));

            return(ret);
        }
示例#5
0
        private IDBTable Principal(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2016, 6, 10), 0, eDBRevisionType.Create);
            var ret = DBMacros.AddDBTableID("Principal", sch, rev);

            ret.AddField("Username", DBMacros.DBFieldNazivDescriptor(false), rev);

            ret.AddField("SuperAdmin", DBMacros.DBFieldBitDescriptor(false), rev);

            return(ret);
        }
示例#6
0
        private IDBTable PrincipalHasRole(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2016, 6, 10), 0, eDBRevisionType.Create);
            var ret = DBMacros.AddDBTableID("PrincipalHasRole", sch, rev);

            DBMacros.AddForeignKeyFieldID("PrincipalID", true, ret, sch.Name + ".Principal",
                                          new DBRevision(new DateTime(2016, 6, 10), 1, eDBRevisionType.Create));
            DBMacros.AddForeignKeyFieldID("RoleID", true, ret, sch.Name + ".Role",
                                          new DBRevision(new DateTime(2016, 6, 10), 1, eDBRevisionType.Create));

            return(ret);
        }
示例#7
0
        private IDBTable BusinessDay(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2020, 4, 14), 0, eDBRevisionType.Create);

            var ret = DBMacros.AddDBTableID("BusinessDay", sch, new DBRevision(rev));

            ret.AddField("ShortName", DBMacros.DBFieldNazivDescriptor(false), new DBRevision(rev));
            ret.AddField("FullName", DBMacros.DBFieldNazivDescriptor(false), new DBRevision(rev));

            ret.AddConstraint(new DBUniqueConstraintDescriptor("ShortName"), new DBRevision(rev));
            ret.AddConstraint(new DBUniqueConstraintDescriptor("FullName"), new DBRevision(rev));

            return(ret);
        }
示例#8
0
        private IDBTable LineEmployee(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2020, 4, 14), 2, eDBRevisionType.Create);

            var ret = DBMacros.AddDBTableID("LineEmployee", sch, new DBRevision(rev));

            DBMacros.AddForeignKeyFieldID("LineID", false, ret, sch.Name + ".Line",
                                          new DBRevision(rev));

            DBMacros.AddForeignKeyFieldID("EmployeeID", false, ret, sch.Name + ".UserDetail",
                                          new DBRevision(rev));

            return(ret);
        }
示例#9
0
        private IDBTable LinePhoto(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2020, 4, 14), 2, eDBRevisionType.Create);

            var ret = DBMacros.AddDBTableID("LinePhoto", sch, new DBRevision(rev));

            DBMacros.AddForeignKeyFieldID("LineID", false, ret, sch.Name + ".Line",
                                          new DBRevision(rev));

            ret.AddField("PhotoName", DBMacros.DBFieldNazivDescriptor(false),
                         new DBRevision(rev));

            ret.AddField("PhotoUrl", DBMacros.DBFieldLongTextDescriptor(false),
                         new DBRevision(rev));

            return(ret);
        }
示例#10
0
        private IDBTable Grad(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2016, 6, 10), 0, eDBRevisionType.Create);

            var ret = DBMacros.AddDBTableID("Grad", sch, rev);

            ret.AddField("Naziv", new DBFieldDescriptor()
            {
                Nullable = false, FieldType = new DBFieldTypeNvarchar(), Size = 512
            },
                         new DBRevision(rev));

            DBMacros.AddForeignKeyFieldID("DrzavaID", true, ret, sch.Name + ".Drzava",
                                          new DBRevision(new DateTime(2016, 6, 10), 1, eDBRevisionType.Create));

            return(ret);
        }
示例#11
0
        private IDBTable LineLocation(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2020, 4, 14), 2, eDBRevisionType.Create);

            var ret = DBMacros.AddDBTableID("LineLocation", sch, new DBRevision(rev));

            ret.AddField("Longitude", new DBFieldDescriptor()
            {
                Size = 18, Precision = 6, FieldType = new DBFieldTypeDecimal(), DefaultValue = "0", Nullable = false
            },
                         new DBRevision(rev));

            ret.AddField("Latitude", new DBFieldDescriptor()
            {
                Size = 18, Precision = 6, FieldType = new DBFieldTypeDecimal(), DefaultValue = "0", Nullable = false
            },
                         new DBRevision(rev));

            DBMacros.AddForeignKeyFieldID("CountryID", false, ret, sch.Name + ".Country",
                                          new DBRevision(rev));

            ret.AddField("StreetAddress", DBMacros.DBFieldNazivDescriptor(false),
                         new DBRevision(rev));

            ret.AddField("City", DBMacros.DBFieldNazivDescriptor(false),
                         new DBRevision(rev));

            ret.AddField("State", DBMacros.DBFieldNazivDescriptor(true),
                         new DBRevision(rev));

            ret.AddField("ZipCode", DBMacros.DBFieldNazivDescriptor(true),
                         new DBRevision(rev));

            ret.AddConstraint(new DBForeignKeyConstraintDescriptor(new List <string>()
            {
                "ID"
            }, sch.Name + ".Line", new List <string>()
            {
                "ID"
            }),
                              new DBRevision(rev));

            return(ret);
        }
        private IDBTable LineEmployeeAccepted(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2020, 4, 14), 4, eDBRevisionType.Create);

            var ret = DBMacros.AddDBTableID("LineEmployeeAccepted", sch, new DBRevision(rev));

            ret.AddConstraint(new DBForeignKeyConstraintDescriptor(new List <string>()
            {
                "ID"
            }, sch.Name + ".LineEmployee", new List <string>()
            {
                "ID"
            }),
                              new DBRevision(rev));

            ret.AddField("InviteAcceptedOn", DBMacros.DBFieldDateTimeDescriptor(false),
                         new DBRevision(rev));

            return(ret);
        }
示例#13
0
        private IDBTable LineStatus(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2020, 4, 14), 2, eDBRevisionType.Create);

            var ret = DBMacros.AddDBTableID("LineStatus", sch, new DBRevision(rev));

            ret.AddConstraint(new DBForeignKeyConstraintDescriptor(new List <string>()
            {
                "ID"
            }, sch.Name + ".Line", new List <string>()
            {
                "ID"
            }),
                              new DBRevision(rev));

            ret.AddField("IsReadyForWork", DBMacros.DBFieldBitDescriptor(false),
                         new DBRevision(rev));

            return(ret);
        }
示例#14
0
        private IDBTable LineBusinessHour(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2020, 4, 14), 2, eDBRevisionType.Create);

            var ret = DBMacros.AddDBTableID("LineBusinessHour", sch, new DBRevision(rev));

            DBMacros.AddForeignKeyFieldID("LineID", false, ret, sch.Name + ".Line",
                                          new DBRevision(rev));

            DBMacros.AddForeignKeyFieldID("BusinessDayID", false, ret, sch.Name + ".BusinessDay",
                                          new DBRevision(rev));

            ret.AddField("StartTime", DBMacros.DBFieldIntegerDescriptor(false),
                         new DBRevision(rev));

            ret.AddField("EndTime", DBMacros.DBFieldIntegerDescriptor(false),
                         new DBRevision(rev));

            return(ret);
        }
示例#15
0
        private IDBTable Line(IDBSchema sch)
        {
            var rev = new DBRevision(new DateTime(2020, 4, 14), 1, eDBRevisionType.Create);

            var ret = DBMacros.AddDBTableID("Line", sch, new DBRevision(rev));

            var fldName = ret.AddField("Name", DBMacros.DBFieldNazivDescriptor(false),
                                       new DBRevision(rev));

            fldName.AddRevision(new DBRevision(new DateTime(2020, 4, 14), 2, eDBRevisionType.Delete));

            ret.AddField("Title", DBMacros.DBFieldNazivDescriptor(false),
                         new DBRevision(rev));

            ret.AddField("Description", DBMacros.DBFieldLongTextDescriptor(false),
                         new DBRevision(rev));

            DBMacros.AddForeignKeyFieldID("OrganizationID", false, ret, sch.Name + ".Organization",
                                          new DBRevision(rev));

            return(ret);
        }