public static string[] ReadCruiseMethodStr(CruiseDatastore db, bool reconMethodsOnly)
        {
            var format = "Select group_concat(Code,',') FROM CruiseMethods {0};";

            string command = string.Format(format,
                                           (reconMethodsOnly) ? "WHERE Code = 'FIX' OR Code = 'PNT'" : string.Empty);

            string result = db.ExecuteScalar(command) as string ?? string.Empty;

            if (string.IsNullOrEmpty(result))
            {
                return(new string[0]);
            }
            else
            {
                return(result.Split(','));
            }
        }
예제 #2
0
        protected void VerifyTablesCanDelete(CruiseDatastore datastore)
        {
            var tableNames = datastore.ExecuteScalar <string>("SELECT group_concat(Name) FROM sqlite_master WHERE Type = 'table';").Split(',');

            foreach (var table in tableNames)
            {
                try
                {
                    datastore.Execute($"DELETE FROM {table};");
                }
                catch (Exception e)
                {
                    Output.WriteLine(e.Message);
                    Output.WriteLine(e.InnerException.Message);
                }

                //datastore.Invoking(x => x.Execute($"DELETE FROM {table};")).Should().NotThrow();
            }
        }
 private static bool HasSampleGroupUOMErrors(this CruiseDatastore dal)
 {
     return((dal.ExecuteScalar <long>("Select Count(DISTINCT UOM) FROM SampleGroup WHERE UOM != '04';")) > 1L);
     //return this.GetRowCount("SampleGroup", "WHERE UOM != '04' GROUP BY UOM") > 1;
 }