public void insertReceipt(REntity rEntity) { r.UserId = rEntity.UserId; r.ReceiptPath = rEntity.ReceiptPath; db.Rs.InsertOnSubmit(r); db.SubmitChanges(); }
void MoveEntity(REntity re, int x, int y) { Rentities[re.CurrentX, re.CurrentY] = null; re.transform.position = GetTileCenter(x, y); re.SetPosition(x, y); Rentities[x, y] = re; }
public override void DoSelf(BoardManager manager, REntity re) { re.commands.RemoveAt(0); re.commands.InsertRange(0, currentCommands); re.commands[0].DoSelf(manager, re); re.commands.RemoveAt(0); }
public void MoveEntityIfPossible(REntity re, int x, int y) { if (!IsBoardCoordinates(x, y)) { return; } if (Rentities[x, y] != null) { if (Rentities[x, y].isMovable) { REntity obstacle = Rentities[x, y]; int xDest = x + x - re.CurrentX; int yDest = y + y - re.CurrentY; if (!IsBoardCoordinates(xDest, yDest)) { return; } if (Rentities[xDest, yDest] == null) { MoveEntity(obstacle, xDest, yDest); MoveEntity(re, x, y); } } return; } if (re.PossibleMove(x, y)) { MoveEntity(re, x, y); } }
public void insertReceipt(REntity rEntity) { rEntity.UserId = Convert.ToInt32(Session["Id"]); rEntity.ReceiptPath = FileUploadControl.FileName; receiptBusiness.insertReceipt(rEntity); gridData(); }
public void Simulate() { Deselect(); blockInput = true; selectedEntity = null; SetIndicatorButtonText("Going"); DoStep(); }
public void deleteData(REntity rEntity) { var delete = (from s in db.Rs where s.ReceiptID == rEntity.ReceiptID select s).FirstOrDefault(); db.Rs.DeleteOnSubmit(delete); db.SubmitChanges(); }
public void addToExpense(REntity rEntity) { var receipt = (from s in db.Rs where s.ReceiptID == rEntity.ReceiptID select s).FirstOrDefault(); receipt.ReceiptID = rEntity.ReceiptID; rEntity.ReceiptPath = receipt.ReceiptPath; }
public void addToExpense(REntity rEntity) { var receiptId = Request.QueryString["ReceiptId"]; rEntity.ReceiptID = Convert.ToInt32(receiptId); receiptBusiness.addToExpense(rEntity); receiptImage.ImageUrl = "~/Receipt/" + rEntity.ReceiptPath; receiptEntity.ReceiptPath = rEntity.ReceiptPath; receiptBusiness.deleteData(rEntity); }
private void Deselect() { selectedEntity = null; foreach (GameObject go in currentCommands) { Destroy(go); } currentCommands.Clear(); SetIndicatorButtonText("None"); }
private void SelectEntity(int x, int y) { if (Rentities[x, y] == null || Rentities[x, y].isSelectable == false) { return; } selectedEntity = Rentities[x, y]; SetIndicatorButtonText(Rentities[x, y].entityName); foreach (GameObject go in currentCommands) { Destroy(go); } currentCommands.Clear(); for (int i = 0; i < selectedEntity.commands.Count; ++i) { GameObject btn = Instantiate(indicatorButton, new Vector3(0, 0, 0), Quaternion.identity) as GameObject; currentCommands.Add(btn); } foreach (GameObject btn in currentCommands) { int i = currentCommands.IndexOf(btn); btn.transform.SetParent(indicatorButton.transform.parent.transform); btn.transform.position = indicatorButton.transform.position; btn.transform.rotation = indicatorButton.transform.rotation; btn.GetComponent <RectTransform>().localScale = indicatorButton.GetComponent <RectTransform>().localScale; btn.GetComponent <RectTransform>().position = indicatorButton.GetComponent <RectTransform>().position; Vector3 up = btn.GetComponent <RectTransform>().up; Vector3 right = btn.GetComponent <RectTransform>().right; btn.GetComponent <RectTransform>().position += up * (-55f - ((i / 3) * 10)); btn.GetComponent <RectTransform>().position += right * (-15f + ((i % 3) * 10)); btn.GetComponent <RectTransform>().sizeDelta = new Vector2(30, 30); btn.name = "Instruction"; btn.GetComponentsInChildren <Text>()[0].text = selectedEntity.commands[i].getName(); btn.GetComponent <Button>().onClick.AddListener(() => { selectedEntity.commands.RemoveAt(i); Reselect(); }); } }
public void addToExpense(REntity rEntity) { receiptData.addToExpense(rEntity); }
public void deleteData(REntity rEntity) { receiptData.deleteData(rEntity); }
public override void DoSelf(BoardManager manager, REntity re) { manager.MoveEntityIfPossible(re, re.CurrentX + 1, re.CurrentY); re.commands.RemoveAt(0); }
public override void DoSelf(BoardManager manager, REntity re) { re.commands.RemoveAt(0); }
public virtual void DoSelf(BoardManager manager, REntity re) { }
public void insertReceipt(REntity rEntity) { receiptData.insertReceipt(rEntity); }