public ActionResult Edit(PODStatusVM v) { AWBStatu obj = new AWBStatu(); obj.AWBStatusID = v.AWBStatusID; obj.StatusDescriptionID = v.CourierStatusID; POD ob = new POD(); ob.PODID = v.PODID; ob.ReceiverName = v.RecevierName; ob.Remarks = v.Remarks; db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); db.Entry(ob).State = EntityState.Modified; db.SaveChanges(); ////var insacn = db.AWBStatus.Where(itm => itm.AWBStatusID == v.AWBStatusID).FirstOrDefault(); ////insacn.AWBStatusID = v.AWBStatusID; ////insacn.StatusDescriptionID = v.CourierStatusID; ////db.SaveChanges(); //var insacn1 = db.PODs.Where(itm => itm.PODID == v.PODID).FirstOrDefault(); //insacn1.PODID = v.PODID; //insacn1.ReceiverName = v.RecevierName; //insacn1.Remarks = v.Remarks; //db.SaveChanges(); return(RedirectToAction("Index")); }
// Start runs once void Start() { rate = (int)RecordRate; debugkey = interpretDebugKey(DebugViewButton); cam_gameobject = this.gameObject; debug_text_hud = cam_gameobject.AddComponent <debugText>(); collectedData = new POD(); raycaster = this.gameObject.AddComponent <Raycast>(); }
// Do once void Start() { i = 0; // Create new POD for data storage pod = new POD(); // Read Time Event Data from Filename CSV.ReadTimeEventData("Sight_tracker/" + fileName, pod); // Set the transform to the *camera* transform (since we record camera position and direction) T = this.transform; }
public void Save(string fileName) { var pod = new POD(); pod.Name = this.Name; pod.Files = this.ToArray(); using (var stream = File.OpenWrite(fileName)) s_serializer.Serialize(stream, pod); }
/* * Function for writing sequential data to file */ public static void WriteSequential(string fileName, POD pod) { StreamWriter sw = new StreamWriter(CreatePath(fileName)); for (int i = 0; i < pod.getObjectCount(); i++) { string str = String.Format("{0},{1}", pod.getObject(i), pod.getTimeSpan(i)); sw.WriteLine(str); } sw.Close(); }
/* * Function to read sequential data from a CSV file into * a Plain Old Data (POD) class. */ public static void ReadSequential(string fileName, POD pod) { StreamReader sr = new StreamReader(fileName); string readStr = sr.ReadLine(); string[] tempStr; while (readStr != null) { tempStr = readStr.Split(','); pod.addUntimedObject(tempStr[0]); pod.addTimeSpan(Convert.ToInt64(tempStr[1])); readStr = sr.ReadLine(); } sr.Close(); }
/* * Function for writing Time Event Data such as currently looking at * and current position * Used to "replay" the players movement, both keyboard and mouse */ public static void WriteTimeEventData(string fileName, POD pod) { StreamWriter sw = new StreamWriter(CreatePath(fileName)); for (int i = 0; i < pod.getLocationCount() - 5; i++) { Vector3 look = pod.getLookingAtObject(i); Vector3 loc = pod.getLocationObject(i); Double time = pod.getFrameTime(i); string str = String.Format("{0},{1},{2},{3},{4},{5},{6}", look.x, look.y, look.z, loc.x, loc.y, loc.z, time); sw.WriteLine(str); } sw.Close(); }
public ActionResult Create(PODStatusVM v) { AWBStatu obj = new AWBStatu(); int max = (from c in db.AWBStatus orderby c.AWBStatusID descending select c.AWBStatusID).FirstOrDefault(); //List<PODStatusVM> lst = (from c in db.CourierStatus join t in db.AWBStatus on c.CourierStatusID equals t.StatusDescriptionID select new PODStatusVM { CourierStatusID = c.CourierStatusID }).ToList(); if (max == null) { obj.AWBStatusID = 1; obj.StatusDescriptionID = v.CourierStatusID; } else { obj.AWBStatusID = max + 1; obj.StatusDescriptionID = v.CourierStatusID; } POD ob = new POD(); int data = (from c in db.PODs orderby c.PODID descending select c.PODID).FirstOrDefault(); if (data == null) { ob.PODID = 1; ob.ReceiverName = v.RecevierName; ob.Remarks = v.Remarks; } else { ob.PODID = data + 1; ob.ReceiverName = v.RecevierName; ob.Remarks = v.Remarks; } db.AWBStatus.Add(obj); db.SaveChanges(); db.PODs.Add(ob); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(int id) { PODStatusVM ob = new PODStatusVM(); ViewBag.delivery = db.CourierStatus.ToList(); POD data = (from c in db.PODs where c.PODID == id select c).FirstOrDefault(); if (data == null) { return(HttpNotFound()); } else { ob.CourierStatusID = data.CourierStatusID; ob.RecevierName = data.ReceiverName; ob.Remarks = data.Remarks; } return(View(ob)); }
/* * Function to load Time Event Data from file * Will be used to replay an earlier run from supplied CSV file */ public static void ReadTimeEventData(string fileName, POD pod) { StreamReader sr = new StreamReader(fileName); string readStr = sr.ReadLine(); string[] tempStr; while (readStr != null) { tempStr = readStr.Split(','); Vector3 tempLoc; Vector3 tempLook; tempLook.x = float.Parse(tempStr[0], CultureInfo.InvariantCulture.NumberFormat); tempLook.y = float.Parse(tempStr[1], CultureInfo.InvariantCulture.NumberFormat); tempLook.z = float.Parse(tempStr[2], CultureInfo.InvariantCulture.NumberFormat); tempLoc.x = float.Parse(tempStr[3], CultureInfo.InvariantCulture.NumberFormat); tempLoc.y = float.Parse(tempStr[4], CultureInfo.InvariantCulture.NumberFormat); tempLoc.z = float.Parse(tempStr[5], CultureInfo.InvariantCulture.NumberFormat); pod.addLookingAtVector(tempLook); pod.addCurrentLocation(tempLoc); readStr = sr.ReadLine(); } sr.Close(); }