示例#1
0
        private List <LiteDbRunSet> GetGingerRunSet(List <LiteDbRunner> runnersData)
        {
            List <LiteDbRunSet> data = new List <LiteDbRunSet>();

            for (var a = 0; a < 2; a++)
            {
                LiteDbRunSet item = new LiteDbRunSet();
                item.Seq            = a;
                item.GUID           = Guid.NewGuid();
                item.Name           = ("RunSet_name");
                item.Description    = ("RunSet_description");
                item.StartTimeStamp = DateTime.Now;
                item.EndTimeStamp   = DateTime.Today;
                item.GingerVersion  = "66";
                item.MachineName    = "my machine";
                item.ExecutedbyUser = "******";
                item.RunnersColl    = runnersData;
                data.Add(item);
            }
            return(data);
        }
        public bool DeleteDocumentByLiteDbRunSet(LiteDbRunSet liteDbRunSet, eExecutedFrom executedFrom = eExecutedFrom.Run)
        {
            bool result           = true;
            var  runSetLiteColl   = GetCollection <LiteDbRunSet>(NameInDb <LiteDbRunSet>());
            var  runnerssLiteColl = GetCollection <LiteDbRunner>(NameInDb <LiteDbRunner>());

            foreach (LiteDbRunner ldbRunner in liteDbRunSet.RunnersColl)
            {
                var businessFlowsLiteColl = GetCollection <LiteDbBusinessFlow>(NameInDb <LiteDbBusinessFlow>());
                foreach (LiteDbBusinessFlow ldbBF in ldbRunner.BusinessFlowsColl)
                {
                    var activitiesLiteColl       = GetCollection <LiteDbActivity>(NameInDb <LiteDbActivity>());
                    var activitiesGroupsLiteColl = GetCollection <LiteDbActivityGroup>(NameInDb <LiteDbActivityGroup>());
                    foreach (LiteDbActivityGroup ldbAG in ldbBF.ActivitiesGroupsColl)
                    {
                        activitiesGroupsLiteColl.Delete(ldbAG._id);
                    }
                    foreach (LiteDbActivity ldbActivity in ldbBF.ActivitiesColl)
                    {
                        var actionsLiteColl = GetCollection <LiteDbAction>(NameInDb <LiteDbAction>());
                        foreach (LiteDbAction ldbAction in ldbActivity.ActionsColl)
                        {
                            actionsLiteColl.Delete(ldbAction._id);
                        }
                        activitiesLiteColl.Delete(ldbActivity._id);
                    }
                    businessFlowsLiteColl.Delete(ldbBF._id);
                }
                if (executedFrom == eExecutedFrom.Run)
                {
                    runnerssLiteColl.Delete(ldbRunner._id);
                }
            }
            if (executedFrom == eExecutedFrom.Run)
            {
                runSetLiteColl.Delete(liteDbRunSet._id);
            }
            return(result);
        }
示例#3
0
 public bool DeleteDocumentByLiteDbRunSet(LiteDbRunSet liteDbRunSet)
 {
     return(dbConnector.DeleteDocumentByLiteDbRunSet(liteDbRunSet));
 }