Esempio n. 1
0
 private void UpdateGridDataSource(Table t)
 {
     schemaDS1.TableSchema.AddTableSchemaRow(t.Id, t.Name, t.Schema, t.Schema + "." + t.Name, t.HasData);
 }
Esempio n. 2
0
 public Column(string name, string type,Table parentTable)
 {
     this.Name = name;
     this.ColumnDataType = new DataType() { SQLType = type };
     this.Parent = parentTable;
 }
Esempio n. 3
0
 private string GetColumnString(Table table, Column col)
 {
     string result = col.Name;
     
     foreach(RelationShip r in table.ParentRelationShips)
     {
         if(r.ChildColumn.Name == col.Name)
         {
             switch(r.MasterTable.Name)
             {
                 case "Address":
                     result = string.Format("Migration.fn_GetNewAddressID({0}, 0, 0)", col.Name);
                     break;
                 case "Banks":
                     result = string.Format("Migration.fn_GetNewBankID({0}, 0, 0)", col.Name);
                     break;
                 case "Categories":
                     result = string.Format("Migration.fn_GetNewCategoryID({0}, 0, 0)", col.Name);
                     break;
                 case "Cities":
                     result = string.Format("Migration.fn_GetNewCityID({0}, 0, 0)", col.Name);
                     break;
                 case "ProjectsComments":
                     result = string.Format("Migration.fn_GetNewCommentID({0}, 0, 0)", col.Name);
                     break;
                 case "Currencies":
                     result = string.Format("Migration.fn_GetNewCurrencyID({0}, 0, 0)", col.Name);
                     break;
                 case "Customers":
                     result = string.Format("Migration.fn_GetNewCustomerID({0}, 0, 0)", col.Name);
                     break;
                 case "CustomerSupplierRegistration":
                     result = string.Format("Migration.fn_GetNewCustomerSupplierRegistrationID({0}, 0, 0)", col.Name);
                     break;
                 case "DocumentsJobs":
                     result = string.Format("Migration.fn_GetNewDocID({0}, 0, 0)", col.Name);
                     break;
                 case "ProjectsGuarantee":
                     result = string.Format("Migration.fn_GetNewGuranteeID({0}, 0, 0)", col.Name);
                     break;
                 case "Inquiries":
                     result = string.Format("Migration.fn_GetNewInquiryNumber({0}, 0, 0)", col.Name);
                     break;
                 case "Notifications":
                     result = string.Format("Migration.fn_GetNewNotificationID({0}, 0, 0)", col.Name);
                     break;
                 case "SystemPages":
                     result = string.Format("Migration.fn_GetNewPageID({0}, 0, 0)", col.Name);
                     break;
                 case "PartialOrder":
                     result = string.Format("Migration.fn_GetNewPartialOrderID({0}, 0, 0)", col.Name);
                     break;
                 case "PartialShipment":
                     result = string.Format("Migration.fn_GetNewPartialShipmentID({0}, 0, 0)", col.Name);
                     break;
                 case "Person.Person":
                 case "Person.BusinessEntity":
                     result = string.Format("Migration.fn_GetNewPersonID({0}, 0, 0)", col.Name);
                     break;
                 case "Products":
                     result = string.Format("Migration.fn_GetNewProductID({0}, 0, 0)", col.Name);
                     break;
                 case "ProjectsHistory":
                     result = string.Format("Migration.fn_GetNewProjectHistoryID({0}, 0, 0)", col.Name);
                     break;
                 case "Projects":
                     result = string.Format("Migration.fn_GetNewProjectID({0}, 0, 0)", col.Name);
                     break;
                 case "Roles":
                     result = string.Format("Migration.fn_GetNewRoleID({0}, 0, 0)", col.Name);
                     break;
                 case "Suppliers":
                     result = string.Format("Migration.fn_GetNewSupplierID({0}, 0, 0)", col.Name);
                     break;
                 case "TimeSheet":
                     result = string.Format("Migration.fn_GetNewTimeSheetID({0}, 0, 0)", col.Name);
                     break;
                 case "Transactions":
                     result = string.Format("Migration.fn_GetNewTransactionID({0}, 0, 0)", col.Name);
                     break;
                 case "Visits":
                     result = string.Format("Migration.fn_GetNewVisitID({0}, 0, 0)", col.Name);
                     break;
                 case "ProjectsLog":
                     result = string.Format("Migration.fn_GetProjectLogID({0}, 0, 0)", col.Name);
                     break;
             }
         }
     }
     return result;
 }
Esempio n. 4
0
        public override object Clone()
        {
            if (!this.EntitySelected)
                return null;
            Table tbl = new Table();
            tbl.Name = this.Name;
            tbl.EntitySelected = this.EntitySelected;
            tbl.Id = this.Id;
            tbl.PrimaryColumnCount = this.PrimaryColumnCount;
            tbl.Schema = this.Schema;
            tbl.TableID = this.TableID;
            foreach (Column col in this.Columns)
            {
                Column newCol = col.Clone() as Column;
                if (newCol != null)
                {
                    newCol.Parent = tbl;
                    tbl.Columns.Add(newCol);
                }
            }
            return tbl;

        }
 public abstract void GetTableRelations(Table table);
 public abstract void GetChildRelations(Table table);
 public abstract void GetParentRelations(Table table);
 public abstract void GetColumns(Table table);