public ESector CreateESector(Sector sector) { ESector eSector = new ESector() { SkyMaterial = sector.skyMaterial, SectorBorder = sector.sectorBorder, LightReferences = sector.staticLights.Select(l => l.Offset.ToString()).ToList(), Neighbours = sector.neighbors.Select(n => n.sector.offset.ToString()).ToList() }; eSector.Geometry = new Dictionary <string, EGeometry>(); foreach (SuperObject spo in sector.SuperObject.children) { IPO ipo = spo.data as IPO; if (ipo != null) // If IPO { EGeometry eg = new EGeometry(); PhysicalObject po = ipo.data; if (po.visualSet.Length > 0) { eg.Visuals = po.visualSet[0].obj as GeometricObject; eg.Collision = po.collideMesh; } eSector.Geometry.Add(ipo.offset.ToString(), eg); } } return(eSector); }
public void AddPO(IPO po) { SerializablePO temp = new SerializablePO() { Number = po.Number }; this.AddPO(temp); }
public void TestAddGetIPO() { IPO ipo = new IPO { IPOID = "01", CompanyName = "AAPL", PricePerS = 200, TotalShares = 150 }; repo.AddIPO(ipo); List <IPO> testipo = repo.GetAllIPOs(); Assert.NotNull(testipo); }
public IActionResult AddIPO(IPO ipo) { try { adminservice.AddIPO(ipo); return(Ok()); } catch (Exception e) { return(StatusCode(500, e.Message)); } }
public static string MakeHtmlTableRow(this IPO source) { string row = string.Format(Resources.PORow, source.Number, source.Vendor, source.ShipFromVBU, source.ScheduledArrival.ToShortDateString(), source.LandedDate, source.SCAC, source.TrailerID, source.GetHoldReasonString()); return(row); }
public static IHoldReason GetHoldReason(this IPO source) { string sql = string.Format("source_id={0} AND is_safety={1}", source.RequestItem.Request.Project.SourceID, source.RequestItem.Request.IsSafety); IHoldReasonMap map = new HoldReasonMap().Where(sql).FirstOrDefault(); if (map == null) { return(null); } else { return(map.HoldReason); } }
public static string GetHoldReasonString(this IPO source) { if (source.RequestItem == null) { return("Audit"); } IHoldReason hr = source.GetHoldReason(); if (hr == null) { return("Hold Reason Unknown"); } return(hr.ReasonText); }
public IActionResult GetIPO(string IPOID) { IPO ipo = userService.GetIPO(IPOID); try { if (ipo == null) { return(Content("Invalid ipo")); } else { return(Ok(ipo)); } } catch (Exception e) { return(StatusCode(500, e.Message)); } }
// GET api/Automation public bool Get() { string dbfile = HttpContext.Current.Server.MapPath("~") + "Data.db3"; string icologfile = HttpContext.Current.Server.MapPath("~") + "ICOLog.txt"; string ipologfile = HttpContext.Current.Server.MapPath("~") + "IPOLog.txt"; ICO icoservice = new ICO(); icoservice.CheckICO(dbfile, icologfile); IPO iposervice = new IPO(); iposervice.CheckIPO(dbfile, ipologfile); TimeZoneInfo INDIAN_ZONE = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"); using (StreamWriter writer = new StreamWriter(HttpContext.Current.Server.MapPath("~") + "Log.txt", true)) { DateTime indianTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, INDIAN_ZONE); writer.WriteLine("Automation ran on " + indianTime.ToString()); writer.WriteLine(); } return(true); }
private static List <PhysicalObject> RetrievePhysicalObjectsFromIPO(IPO ipo) { List <PhysicalObject> pos = new List <PhysicalObject>(); bool spoHasNoCollisionFlag = ipo.SuperObject?.flags.HasFlag(SuperObjectFlags.Flags.NoCollision) ?? false; if (spoHasNoCollisionFlag) { return(pos); } pos.Add(ipo.data); foreach (var s in ipo.SuperObject.children) { if (s.data is IPO ipoChild) { pos.AddRange(RetrievePhysicalObjectsFromIPO(ipoChild)); pos.Add(ipoChild.data); } } return(pos); }
/*public POwithItemCombo(long number) * : base(new PO(number)) * { * _items = new List<long>(); * }*/ public POwithItemCombo(IPO po) : base(po) { _items = new List <long>(); }
public IActionResult UpdateIPO(IPO ipo) { adminservice.UpdateIPO(ipo); return(Ok("IPO updated")); }
public void UpdateIPO(IPO ipo) { AdminRepo.UpdateIPO(ipo); }
public void GetMaximizedCapital(int k, int initialCapital, int[] profits, int[] capitals, int expectedCapital) { var ipo = new IPO(); Assert.Equal(expectedCapital, ipo.FindMaximizedCapital(k, initialCapital, profits, capitals)); }
//private HashSet<IRequestItem> _requestItems; public PODecorator(IPO po) { _po = po; }
public void AddIPO(IPO ipo) { AdminRepo.AddIPO(ipo); }
public static List <SuperObject> Read(EndianBinaryReader reader, Pointer off_so, bool parseSiblings = true, bool parseChildren = true, SuperObject parent = null) { MapLoader l = MapLoader.Loader; List <SuperObject> superObjects = new List <SuperObject>(); if (IsParsed(off_so)) { return(null); } bool isFirstNode = true; bool hasNextBrother = false; bool isValidNode = true; while (isFirstNode || (hasNextBrother && parseSiblings)) { SuperObject so = new SuperObject(off_so); superObjects.Add(so); // Local list of superobjects (only this & siblings) l.superObjects.Add(so); // Global list of superobjects (all) if (parent != null) { parent.children.Add(so); so.parent = parent; } hasNextBrother = false; so.type = reader.ReadUInt32(); so.off_data = Pointer.Read(reader); so.off_child_first = Pointer.Read(reader); so.off_child_last = Pointer.Read(reader); so.num_children = reader.ReadUInt32(); so.off_brother_next = Pointer.Read(reader); so.off_brother_prev = Pointer.Read(reader); so.off_parent = Pointer.Read(reader); so.off_matrix = Pointer.Read(reader); //R3Pointer.Read(reader); // a copy of the matrix right after, at least in R3GC Vector3 pos = Vector3.zero; Vector3 scale = Vector3.one; Quaternion rot = Quaternion.identity; if (so.off_matrix != null) { Pointer curPos = Pointer.Goto(ref reader, so.off_matrix); so.matrix = Matrix.Read(reader, so.off_matrix); pos = so.matrix.GetPosition(convertAxes: true); rot = so.matrix.GetRotation(convertAxes: true); scale = so.matrix.GetScale(convertAxes: true); Pointer.Goto(ref reader, curPos); } switch (so.type) { case 0x20: // IPO Pointer.Goto(ref reader, so.off_data); so.data = IPO.Read(reader, so.off_data, so); break; case 0x40: // IPO l.print("IPO with code 0x40 at offset " + String.Format("0x{0:X}", so.offset.offset)); Pointer.Goto(ref reader, so.off_data); so.data = IPO.Read(reader, so.off_data, so); break; case 0x02: // e.o. Pointer.Goto(ref reader, so.off_data); so.data = Perso.Read(reader, so.off_data, so); break; case 0x01: // world superobject so.data = World.New(so); //print("parsing world superobject with " + num_children + " children"); break; case 0x04: // sector Pointer.Goto(ref reader, so.off_data); so.data = Sector.Read(reader, so.off_data, so); break; default: l.print("Unknown SO type " + so.type + " at offset " + String.Format("0x{0:X}", so.offset.offset)); isValidNode = false; break; } if (so.Gao != null) { if (parent != null) { so.Gao.transform.parent = parent.Gao.transform; } so.Gao.transform.localPosition = pos; so.Gao.transform.localRotation = rot; so.Gao.transform.localScale = scale; } isFirstNode = false; if (isValidNode) { if (parseChildren && so.num_children > 0 && so.off_child_first != null) { //if (type == 0x01) print("parsing children now"); Pointer off_current = Pointer.Goto(ref reader, so.off_child_first); SuperObject.Read(reader, so.off_child_first, true, true, so); //R3Pointer.Goto(ref reader, off_current); } if (so.off_brother_next != null && !IsParsed(so.off_brother_next)) { hasNextBrother = true; Pointer.Goto(ref reader, so.off_brother_next); off_so = so.off_brother_next; } } } return(superObjects); }
public int InsertListPO(IPO po, string strInsertQuery) { throw new NotImplementedException(); }
internal void Add(IPO po) { this.Add(po); }
public SelectablePO(IPO po) : base(po) { }
public void AddIPO(IPO ipo) { ipo.IPOID = (dbcontext.IPOs.Count() + 1).ToString(); dbcontext.IPOs.Add(ipo); dbcontext.SaveChanges(); }
public void UpdateIPO(IPO ipo) { dbcontext.IPOs.Update(ipo); dbcontext.SaveChanges(); }
public POWithStatus(IPO po) : base(po) { LocationStatus = GetStatusString(); }
public HoldPO(IPO po) : base(po) { Initialize(); }