public ActionResult DeleteConfirmed(int id) { order_type order_type = db.order_type.Find(id); db.order_type.Remove(order_type); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "order_type_id,type")] order_type order_type) { if (ModelState.IsValid) { db.Entry(order_type).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(order_type)); }
public static byte[] form_byte_array( order_type order_type, bool para_bool, float para_float1, float para_float2) { byte[] arr = new byte[16]; byte[] t = new byte[4]; switch (order_type) { case order_type.Pose: t = BitConverter.GetBytes((Int32)order_type.Pose); break; case order_type.Reset: t = BitConverter.GetBytes((Int32)order_type.Reset); break; case order_type.Yaw: t = BitConverter.GetBytes((Int32)order_type.Yaw); break; case order_type.Pitch: t = BitConverter.GetBytes((Int32)order_type.Pitch); break; case order_type.Rotation: t = BitConverter.GetBytes((Int32)order_type.Rotation); break; case order_type.Spin: t = BitConverter.GetBytes((Int32)order_type.Spin); break; default: break; } Array.Copy(t, 0, arr, 0, 4); if (para_bool) { Int32 i = 1; t = BitConverter.GetBytes(i); } else { Int32 i = 0; t = BitConverter.GetBytes(i); } Array.Copy(t, 0, arr, 4, 4); t = BitConverter.GetBytes(para_float1); Array.Copy(t, 0, arr, 8, 4); t = BitConverter.GetBytes(para_float2); Array.Copy(t, 0, arr, 12, 4); return(arr); }
public ActionResult Create([Bind(Include = "order_type_id,type")] order_type order_type) { if (ModelState.IsValid) { db.order_type.Add(order_type); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(order_type)); }
// GET: order_type/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } order_type order_type = db.order_type.Find(id); if (order_type == null) { return(HttpNotFound()); } return(View(order_type)); }
static string[] returnModifyArray(string OrderID, operation_type operation_Type, int OrderPrice, int num_traded, order_type OrderType) { //editing SELL table string[] tempArray = new string[6]; tempArray[0] = operation_type.MODIFY.ToString(); tempArray[1] = OrderID; tempArray[2] = operation_Type.ToString(); tempArray[3] = OrderPrice.ToString(); tempArray[4] = num_traded.ToString(); tempArray[5] = OrderType.ToString(); return(tempArray); }