/// <summary> /// Building a collection /// </summary> /// <param name="tables">Tables collection</param> /// <param name="procedures">Procedures collection</param> /// <param name="triggers">Triggers collection</param> /// <param name="dbName">Data base name</param> /// <returns>Redesigned collection</returns> private GeneralDbInfo DesignOfCollection(List <string> tables, List <string> procedures, List <string> triggers, string dbName) { var tempTables = GetProperties(tables, "Table"); var tempProcedures = GetProperties(procedures, "Procedure"); var tempTriggers = GetProperties(triggers, "Trigger"); GeneralDbInfo dataBase = new GeneralDbInfo() { Name = dbName, Entitys = new List <Entity>() { new Entity() { Name = "Tables", Properties = tempTables }, new Entity() { Name = "Procedures", Properties = tempProcedures }, new Entity() { Name = "Triggers", Properties = tempTriggers } } }; return(dataBase); }
/// <summary> /// A comparison of the collections and change the color value fields /// </summary> /// <param name="lsGenInfo">Left side collecton</param> /// <param name="rsGenInfo">Right side collecton</param> /// <returns>Collection with changed field color</returns> public List <CompareResult> Colorize(GeneralDbInfo lsGenInfo, GeneralDbInfo rsGenInfo) { for (int i = 0; i < lsGenInfo.Entitys.Count; i++) { if (lsGenInfo.Entitys[i].Name == "Tables") { FieldsCompare("Tables", "Fields", lsGenInfo.Entitys[i].Properties, rsGenInfo.Entitys[i].Properties); } else if (lsGenInfo.Entitys[i].Name == "Procedures") { ScriptCompare("Procedures", "Procedures sqripts", lsGenInfo.Entitys[i].Properties, rsGenInfo.Entitys[i].Properties, _lsRepository.GetProcedureSqript, _rsRepository.GetProcedureSqript); } else if (lsGenInfo.Entitys[i].Name == "Triggers") { ScriptCompare("Triggers", "Triggers sqripts", lsGenInfo.Entitys[i].Properties, rsGenInfo.Entitys[i].Properties, _lsRepository.GetTriggerSqript, _rsRepository.GetTriggerSqript); } } return(_compareResults); }