/// <summary> /// Fixed: /// </summary> private static void InitializeResults( Context context, DemoModel demoModel, string parentId, Dictionary <string, long> idHash) { Def.DemoDefinitionCollection .Where(o => o.ParentId == parentId) .Where(o => o.Type == "Results") .ForEach(demoDefinition => { var resultId = Rds.ExecuteScalar_response( context: context, selectIdentity: true, statements: new SqlStatement[] { Rds.InsertItems( setIdentity: true, param: Rds.ItemsParam() .ReferenceType("Results") .Creator(idHash.Get(demoDefinition.Creator)) .Updator(idHash.Get(demoDefinition.Updator)) .CreatedTime(demoDefinition.CreatedTime.DemoTime(demoModel)) .UpdatedTime(demoDefinition.UpdatedTime.DemoTime(demoModel)), addUpdatorParam: false), Rds.InsertResults( param: Rds.ResultsParam() .SiteId(idHash.Get(demoDefinition.ParentId)) .ResultId(raw: Def.Sql.Identity) .Title(demoDefinition.Title) .Body(demoDefinition.Body.Replace(idHash)) .Status(demoDefinition.Status) .Manager(idHash.Get(demoDefinition.Manager)) .Owner(idHash.Get(demoDefinition.Owner)) .ClassA(demoDefinition.ClassA.Replace(idHash)) .ClassB(demoDefinition.ClassB.Replace(idHash)) .ClassC(demoDefinition.ClassC.Replace(idHash)) .ClassD(demoDefinition.ClassD.Replace(idHash)) .ClassE(demoDefinition.ClassE.Replace(idHash)) .ClassF(demoDefinition.ClassF.Replace(idHash)) .ClassG(demoDefinition.ClassG.Replace(idHash)) .ClassH(demoDefinition.ClassH.Replace(idHash)) .ClassI(demoDefinition.ClassI.Replace(idHash)) .ClassJ(demoDefinition.ClassJ.Replace(idHash)) .ClassK(demoDefinition.ClassK.Replace(idHash)) .ClassL(demoDefinition.ClassL.Replace(idHash)) .ClassM(demoDefinition.ClassM.Replace(idHash)) .ClassN(demoDefinition.ClassN.Replace(idHash)) .ClassO(demoDefinition.ClassO.Replace(idHash)) .ClassP(demoDefinition.ClassP.Replace(idHash)) .ClassQ(demoDefinition.ClassQ.Replace(idHash)) .ClassR(demoDefinition.ClassR.Replace(idHash)) .ClassS(demoDefinition.ClassS.Replace(idHash)) .ClassT(demoDefinition.ClassT.Replace(idHash)) .ClassU(demoDefinition.ClassU.Replace(idHash)) .ClassV(demoDefinition.ClassV.Replace(idHash)) .ClassW(demoDefinition.ClassW.Replace(idHash)) .ClassX(demoDefinition.ClassX.Replace(idHash)) .ClassY(demoDefinition.ClassY.Replace(idHash)) .ClassZ(demoDefinition.ClassZ.Replace(idHash)) .NumA(demoDefinition.NumA) .NumB(demoDefinition.NumB) .NumC(demoDefinition.NumC) .NumD(demoDefinition.NumD) .NumE(demoDefinition.NumE) .NumF(demoDefinition.NumF) .NumG(demoDefinition.NumG) .NumH(demoDefinition.NumH) .NumI(demoDefinition.NumI) .NumJ(demoDefinition.NumJ) .NumK(demoDefinition.NumK) .NumL(demoDefinition.NumL) .NumM(demoDefinition.NumM) .NumN(demoDefinition.NumN) .NumO(demoDefinition.NumO) .NumP(demoDefinition.NumP) .NumQ(demoDefinition.NumQ) .NumR(demoDefinition.NumR) .NumS(demoDefinition.NumS) .NumT(demoDefinition.NumT) .NumU(demoDefinition.NumU) .NumV(demoDefinition.NumV) .NumW(demoDefinition.NumW) .NumX(demoDefinition.NumX) .NumY(demoDefinition.NumY) .NumZ(demoDefinition.NumZ) .DateA(demoDefinition.DateA) .DateB(demoDefinition.DateB) .DateC(demoDefinition.DateC) .DateD(demoDefinition.DateD) .DateE(demoDefinition.DateE) .DateF(demoDefinition.DateF) .DateG(demoDefinition.DateG) .DateH(demoDefinition.DateH) .DateI(demoDefinition.DateI) .DateJ(demoDefinition.DateJ) .DateK(demoDefinition.DateK) .DateL(demoDefinition.DateL) .DateM(demoDefinition.DateM) .DateN(demoDefinition.DateN) .DateO(demoDefinition.DateO) .DateP(demoDefinition.DateP) .DateQ(demoDefinition.DateQ) .DateR(demoDefinition.DateR) .DateS(demoDefinition.DateS) .DateT(demoDefinition.DateT) .DateU(demoDefinition.DateU) .DateV(demoDefinition.DateV) .DateW(demoDefinition.DateW) .DateX(demoDefinition.DateX) .DateY(demoDefinition.DateY) .DateZ(demoDefinition.DateZ) .DescriptionA(demoDefinition.DescriptionA) .DescriptionB(demoDefinition.DescriptionB) .DescriptionC(demoDefinition.DescriptionC) .DescriptionD(demoDefinition.DescriptionD) .DescriptionE(demoDefinition.DescriptionE) .DescriptionF(demoDefinition.DescriptionF) .DescriptionG(demoDefinition.DescriptionG) .DescriptionH(demoDefinition.DescriptionH) .DescriptionI(demoDefinition.DescriptionI) .DescriptionJ(demoDefinition.DescriptionJ) .DescriptionK(demoDefinition.DescriptionK) .DescriptionL(demoDefinition.DescriptionL) .DescriptionM(demoDefinition.DescriptionM) .DescriptionN(demoDefinition.DescriptionN) .DescriptionO(demoDefinition.DescriptionO) .DescriptionP(demoDefinition.DescriptionP) .DescriptionQ(demoDefinition.DescriptionQ) .DescriptionR(demoDefinition.DescriptionR) .DescriptionS(demoDefinition.DescriptionS) .DescriptionT(demoDefinition.DescriptionT) .DescriptionU(demoDefinition.DescriptionU) .DescriptionV(demoDefinition.DescriptionV) .DescriptionW(demoDefinition.DescriptionW) .DescriptionX(demoDefinition.DescriptionX) .DescriptionY(demoDefinition.DescriptionY) .DescriptionZ(demoDefinition.DescriptionZ) .CheckA(demoDefinition.CheckA) .CheckB(demoDefinition.CheckB) .CheckC(demoDefinition.CheckC) .CheckD(demoDefinition.CheckD) .CheckE(demoDefinition.CheckE) .CheckF(demoDefinition.CheckF) .CheckG(demoDefinition.CheckG) .CheckH(demoDefinition.CheckH) .CheckI(demoDefinition.CheckI) .CheckJ(demoDefinition.CheckJ) .CheckK(demoDefinition.CheckK) .CheckL(demoDefinition.CheckL) .CheckM(demoDefinition.CheckM) .CheckN(demoDefinition.CheckN) .CheckO(demoDefinition.CheckO) .CheckP(demoDefinition.CheckP) .CheckQ(demoDefinition.CheckQ) .CheckR(demoDefinition.CheckR) .CheckS(demoDefinition.CheckS) .CheckT(demoDefinition.CheckT) .CheckU(demoDefinition.CheckU) .CheckV(demoDefinition.CheckV) .CheckW(demoDefinition.CheckW) .CheckX(demoDefinition.CheckX) .CheckY(demoDefinition.CheckY) .CheckZ(demoDefinition.CheckZ) .Comments(Comments(demoModel, idHash, demoDefinition.Id)) .Creator(idHash.Get(demoDefinition.Creator)) .Updator(idHash.Get(demoDefinition.Updator)) .CreatedTime(demoDefinition.CreatedTime.DemoTime(demoModel)) .UpdatedTime(demoDefinition.UpdatedTime.DemoTime(demoModel)), addUpdatorParam: false) }).Identity.ToLong(); idHash.Add(demoDefinition.Id, resultId); var siteModel = new SiteModel().Get( context: context, where : Rds.SitesWhere().SiteId(idHash.Get(demoDefinition.ParentId))); var ss = siteModel.ResultsSiteSettings( context: context, referenceId: resultId); var resultModel = new ResultModel( context: context, ss: ss, resultId: resultId); var fullText = resultModel.FullText(context: context, ss: ss); Rds.ExecuteNonQuery( context: context, statements: Rds.UpdateItems( param: Rds.ItemsParam() .SiteId(resultModel.SiteId) .Title(resultModel.Title.DisplayValue) .FullText(fullText, _using: fullText != null), where : Rds.ItemsWhere().ReferenceId(resultModel.ResultId), addUpdatorParam: false, addUpdatedTimeParam: false)); Libraries.Search.Indexes.Create( context: context, ss: ss, resultModel: resultModel); }); }
public string Calendar() { SetSite(); ViewModes.Set(Site.SiteId); switch (Site.ReferenceType) { case "Issues": return(IssueUtilities.Calendar( ss: Site.IssuesSiteSettings( ReferenceId, setAllChoices: true, setSiteIntegration: true))); case "Results": return(ResultUtilities.Calendar( ss: Site.ResultsSiteSettings( ReferenceId, setAllChoices: true, setSiteIntegration: true))); default: return(HtmlTemplates.Error(Error.Types.NotFound)); } }