public void ResetNumbersForDay(int ShowID, int ShowDetailsID) { DataSet ds = _showClasses.getAllClassesForShow(ShowID); if (ds.Tables.Count > 0) { int rowCnt = 1; foreach (DataRow row in ds.Tables[0].Rows) { ShowClasses sc = new ShowClasses(row); sc.ClassNo = rowCnt; sc.Update(); rowCnt++; } } }
public void updatePosition(String[] posList) { for (int i = 0; i < posList.Length; i++) { int id = Convert.ToInt32(posList[i]); ShowClasses sc = new ShowClasses(id); sc.Position = i; sc.Update(); } }
public static void UpdateRings(Fpp.Core.Models.RPRingClassUpdate RingClassUpdate) { foreach (var Ring in RingClassUpdate.Rings) { if (Ring.Classes != null) { int pos = 1; foreach (int ClsId in Ring.Classes) { ShowClasses sc = new ShowClasses(ClsId); sc.Position = pos++; sc.RingID = Ring.Id; sc.Update(); } } } }
public void BulkCopy(int ShowID, int showDetailsID, int newShowDetailsID, List<Fpp.Core.Models.CopyValue> ShowChargeMap, List<Fpp.Core.Models.CopyValue> ClassTypesMap, int NewShowId = -1 ) { _showClasses.BulkCopy(showDetailsID, newShowDetailsID); int clsNo = 1; if (NewShowId > -1) { clsNo = _showClasses.getMaxClassNo(NewShowId) + 1; } DataSet ds = _showClasses.GetClassesFromShowDetails(newShowDetailsID); foreach (DataRow row in ds.Tables[0].Rows) { ShowClasses sc = new ShowClasses(row); if (ShowChargeMap != null) { var t = ClassTypesMap.Where(x => x.oldValue == sc.ClassType); if (t != null && t.Count() > 0) { sc.ClassType = t.First().newValue; } } sc.Update(); } }
public static void CreateChampClasses(IEnumerable<ShowClasses> champClasses) { foreach (var champ in champClasses.ToList()) { ShowClasses showClass = new ShowClasses(champ.ID); var baseName = (string.IsNullOrEmpty( showClass.ClassName ) ? "" : showClass.ClassName.Replace(" Agility","")); showClass.ClassName = baseName + " Agility"; showClass.Update(); var newClsId = showClass.copy(true); ShowClasses newCls = new ShowClasses(newClsId); newCls.Part = showClass.Part + 1; newCls.ClassName = baseName + " Jumping"; newCls.Update(); DogClasses.CopyDogs(showClass.ID, newClsId); newClsId = newCls.copy(true); ShowClasses final = new ShowClasses(newClsId); final.Part = newCls.Part + 1; final.ClassName = baseName + " Final"; final.Update(); DogClasses.CopyDogs(showClass.ID, newClsId, 20, true); } }
public static void Split(int ClassId, int By) { string moduleSettings = ModuleConfig.GetSettings(); Data.DogClasses dc = new Data.DogClasses(moduleSettings); List<DogClasses> dclist = new List<DogClasses>(); DataSet ds = dc.getDogsInClass(ClassId); foreach (DataRow row in ds.Tables[0].Rows) { dclist.Add(new DogClasses(row)); } dclist = dclist.OrderBy(t => t.RO).ToList(); int split = (int)Math.Truncate( (double)dclist.Count() / By); var remainder = dclist.Count() - (split * By ); int splitLength = (int)split; ShowClasses showClass = new ShowClasses(ClassId); showClass.Part = 1; showClass.Update(); var spt = splitLength; var j = Judge.getJudgeForClass(ClassId); var splitCnt = 2; for (var i = 1; i< By; i++) { if (i + 1 == By) { splitLength += remainder; } var copyid = showClass.copy(true); var splitClass = new ShowClasses(copyid); splitClass.ClassNo = showClass.ClassNo; splitClass.Position = showClass.Position; splitClass.RingID = showClass.RingID; splitClass.Part = splitCnt; splitClass.Update(); ShowClasses.updateJudgeClasses(copyid, j.ID); for (int dogCnt = 0; dogCnt < splitLength; dogCnt++) { var dogclass = dclist.ElementAt( dogCnt + (int)spt); dc.UpdateClassId(dogclass.ID, copyid); } spt += splitLength; splitCnt++; } }
public JsonResult UpdateGrades(int classId, string grades) { ShowClasses showClass = new ShowClasses(classId); showClass.Grades = grades; showClass.Update(); return Json(new { Status = 0 }); }
public JsonResult AddJudgeCls(int classId, int judgeId, int showDetailsId) { ShowClasses.updateJudgeClasses(classId, judgeId, showDetailsId); var j = new Judge(judgeId); var sc = new ShowClasses(classId) { RingID = j.RingID }; sc.Update(); return Json(new { Status = 0, JudgesList = Judge.GetAllJudgesForShow(j.ShowID) }); }
public JsonResult UpdateClassName(int classId, int newIdx) { ShowClasses showClass = new ShowClasses(classId); showClass.ClassType = newIdx; showClass.Update(); return Json(new { Status = 0 }); }