예제 #1
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;
 }
예제 #2
0
 public override object Clone()
 {
     //if (!this.EntitySelected)
     //    return null;
     Column col = new Column();
     col.Name = this.Name;
     col.ColumnDataType = this.ColumnDataType;
     col.AllowNull = this.AllowNull;
     col.ColumnDirection = this.ColumnDirection;
     col.ColumnId = this.ColumnId;
     col.IndexType = this.IndexType;
     col.IsComputed = this.IsComputed;
     col.IsForeign = this.IsForeign;
     col.IsIdentity = this.IsIdentity;
     col.IsPrimary = this.IsPrimary;
     col.Length = this.Length;
     col.OrdinalPosition = this.OrdinalPosition;
     col.Precision = this.Precision;
     col.Scale = this.Scale;
     return col;
     
 }