public async Task <ActionResult <PointsType> > PostPointsType(PointsType pointsType) { _context.PointsType.Add(pointsType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPointsType", new { id = pointsType.PtId }, pointsType)); }
public static void OnLoad() { Persistence.Deserialize( FilePath, reader => { int version = reader.ReadInt(); if (version < 2) { reader.ReadBool(); } PointsType loaded = PointsType.None; int count = reader.ReadInt(); for (int i = 0; i < count; i++) { try { PointsType type = (PointsType)reader.ReadInt(); loaded = type; PointsSystem s = GetSystemInstance(type); s.Deserialize(reader); } catch { throw new Exception(string.Format("Points System Failed Load: {0} Last Loaded...", loaded.ToString())); } } }); }
public async Task <IActionResult> PutPointsType(Guid id, PointsType pointsType) { if (id != pointsType.PtId) { return(BadRequest()); } _context.Entry(pointsType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PointsTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public Vertex(int number, double x, double y, double z, PointsType pointType) { Number = number; X = x; Y = y; Z = z; PointType = pointType; }
public PointsTransaction(XmlRpcStruct pointsTransaction) { userId = Convert.ToInt32(pointsTransaction["USER"]); timestamp = Convert.ToDateTime(pointsTransaction["TIMESTAMP"]); type = (PointsType)Enum.Parse(typeof(PointsType), (string)pointsTransaction["TYPE"]); delta = Convert.ToInt32(pointsTransaction["DELTA"]); comments = (string)pointsTransaction["COMMENTS"]; }
public async Task <ActionResult <PointsTypeAll> > GetPointsTypeAllDetail(Guid id) { PointsType pt = await _context.PointsType.FindAsync(id); PointsTypeAll ptAll = new PointsTypeAll(); ptAll.PtId = pt.PtId; ptAll.PointsType = pt; ptAll.PtAttr = await _context.PointsTypeAttr.Where(p => p.PtId == pt.PtId).ToListAsync(); return(ptAll); }
public static PointsSystem GetSystemInstance(PointsType t) { for (var index = 0; index < Systems.Count; index++) { var s = Systems[index]; if (s.Loyalty == t) { return(s); } } return(null); }
public async Task <ActionResult <PointsTypeAll> > DeletePointsTypeAll(Guid id) { PointsType pt = await _context.PointsType.FindAsync(id); PointsTypeAll ptAll = new PointsTypeAll(); ptAll.PtId = pt.PtId; ptAll.PointsType = pt; ptAll.PtAttr = await _context.PointsTypeAttr.Where(p => p.PtId == pt.PtId).ToListAsync(); if (ptAll.PtId == null) { return(NotFound()); } return(ptAll); }
public static void OnLoad() { Persistence.Deserialize( FilePath, reader => { int version = reader.ReadInt(); if (version < 2) { reader.ReadBool(); } List <PointsType> loaded = new List <PointsType>(); int count = reader.ReadInt(); for (int i = 0; i < count; i++) { try { PointsType type = (PointsType)reader.ReadInt(); PointsSystem s = GetSystemInstance(type); s.Deserialize(reader); if (!loaded.Contains(type)) { loaded.Add(type); } } catch (Exception e) { foreach (var success in loaded) { Console.WriteLine("[Points System] Successfully Loaded: {0}", success.ToString()); } loaded.Clear(); throw new Exception(String.Format("[Points System]: {0}", e)); } } loaded.Clear(); }); }
public static void OnLoad() { Persistence.Deserialize( FilePath, reader => { int version = reader.ReadInt(); int count = reader.ReadInt(); for (int i = 0; i < count; i++) { PointsType type = (PointsType)reader.ReadInt(); PointsSystem s = GetSystemInstance(type); s.Deserialize(reader); } }); }
public static PointsSystem GetSystemInstance(PointsType t) { return(Systems.FirstOrDefault(s => s.Loyalty == t)); }
/// <summary> /// Add new points to the view model /// </summary> /// <param name="newPoints">points to add</param> public void AddPoints(PointsType newPoints) { MobTrophyPoints.Add(newPoints); }
private static IEnumerable <IFacet> GetsUpOrDownFaces(IEnumerable <IFacet> faces, PointsType point) { return((from allFace in faces from fItem in allFace.ArristCollection where fItem.FirstVertex.PointType == point select allFace).ToList()); }
// ********************************************************************* public static void AddPoints(PointsType points) { Score += (int)points; ScoreText = String.Format("{0:0000000}", Score); }
/// <summary> /// Add new points to the view model /// </summary> /// <param name="newPoints">points to add</param> public void AddPoints(PointsType newPoints) { ClubPoints.Add(newPoints); }