Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        own         = 0;
        drag        = transform.parent.gameObject;
        drag_script = drag.GetComponent <Drag>();
        drag_script.AddList(gameObject);
        central     = GameObject.Find("Central");
        central_scr = central.GetComponent <Central>();
        if (type == 0)
        {
            own = central_scr.dog;
        }
        else if (type == 1)
        {
            own = central_scr.chicken;
        }
        guiStyleFore = new GUIStyle();
        guiStyleFore.normal.textColor = Color.white;
        guiStyleFore.alignment        = TextAnchor.UpperCenter;
        guiStyleFore.wordWrap         = true;
        guiStyleBack = new GUIStyle();
        guiStyleBack.normal.textColor = Color.black;
        guiStyleBack.alignment        = TextAnchor.UpperCenter;
        guiStyleBack.wordWrap         = true;

        // toolTipText = name + "\n In Storage: " + own + "\n " + toolTipText;
    }
Esempio n. 2
0
 public string EnterNewBudgetItem(BudgetListItem ListItemToAdd, Guid CustomerId, string InputType)
 {
     try
     {
         int        Type         = (InputType == "SuggestedInput") ? 0 : 1;
         var        Context      = new Central();
         BudgetItem MyBudgetItem = new BudgetItem();
         MyBudgetItem.BudgetItemId        = Guid.NewGuid();
         MyBudgetItem.BudgetId            = GetBudgetId(CustomerId);
         MyBudgetItem.BudgetItemAmount    = ListItemToAdd.BudgetListItemAmount;
         MyBudgetItem.BudgetItemCategory  = ListItemToAdd.BudgetListItemCategory;
         MyBudgetItem.BudgetItemName      = ListItemToAdd.BudgetListItemName;
         MyBudgetItem.BudgetItemFrequency = ListItemToAdd.BudgetListItemFrequency;
         MyBudgetItem.BudgetItemType      = Type;
         MyBudgetItem.CreationDate        = DateTime.Now;
         MyBudgetItem.UpdateDate          = DateTime.Now;
         Context.BudgetItems.Add(MyBudgetItem);
         Context.SaveChanges();
         string Status = "Success";
         return(Status);
     }
     catch (Exception e)
     {
         return(e.ToString());
     }
 }
Esempio n. 3
0
 public string EditBudgetItemList(List <BudgetListItem> CurrentBudgetItems, Guid CustomerId)
 {
     try
     {
         var  Context  = new Central();
         Guid BudgetId = GetBudgetId(CustomerId);
         foreach (var x in CurrentBudgetItems)
         {
             Guid BudgListItemId = Guid.Parse(x.BudgetListItemId);
             if (HasBudgetItemId(BudgetId, BudgListItemId))
             {
                 var ListItemToUpdate = (from b in Context.BudgetItems
                                         where b.BudgetItemId == BudgListItemId && b.BudgetId == BudgetId
                                         select b).FirstOrDefault();
                 if (ListItemToUpdate.BudgetItemType == 1)
                 {
                     ListItemToUpdate.BudgetItemName = x.BudgetListItemName;
                 }
                 ListItemToUpdate.BudgetItemAmount     = x.BudgetListItemAmount;
                 ListItemToUpdate.BudgetItemFrequency  = x.BudgetListItemFrequency;
                 ListItemToUpdate.UpdateDate           = DateTime.Now;
                 Context.Entry(ListItemToUpdate).State = System.Data.Entity.EntityState.Modified;
             }
         }
         Context.SaveChanges();
         string Status = "Success";
         return(Status);
     }
     catch (Exception e)
     {
         return(e.ToString());
     }
 }
        public ActionResult DeleteTransaction(TransactionItemToDelete TransactionToDelete)
        {
            string result = "";

            try
            {
                Guid CustomerId        = Guid.Parse(User.Identity.GetUserId());
                Guid TransactionItemId = Guid.Parse(TransactionToDelete.TransactionId);
                var  Context           = new Central();
                var  ToDelete          = (from b in Context.TransactionItems
                                          where b.CustomerId == CustomerId && b.TransactionItemId == TransactionItemId
                                          select b).FirstOrDefault();
                Context.TransactionItems.Remove(ToDelete);
                if (TransactionToDelete.TransactionType == 3)
                {
                    DeleteSplitTransactionsForPrimary(Context, TransactionItemId);
                }
                Context.SaveChanges();
                result = "You have successfully deleted the Transaction Item - " + TransactionToDelete.TransactionName;
            }
            catch (Exception e)
            {
                result = e.ToString();
            }
            return(RedirectToAction("Transaction", "Transaction", new { message = result }));
        }
Esempio n. 5
0
    void Start()
    {
        InitElements();
        //my_settings_panel.SetVolume(5);
        ClearGUI(GameState.Null);

        //	peripheral = (GameObject.Find ("Peripheral")).gameObject.GetComponentInParent<Peripheral>();
        peripheral = Peripheral.Instance;

        if (Instance != null && Instance != this)
        {
            Destroy(gameObject);
        }

        Instance = this;
        central  = Central.Instance;
        //	cameras.Add(GameObject.Find("MAINCAMERA").transform);

        x_coord = Screen.width;
        y_coord = Screen.height;


        //  UICamera.genericEventHandler = this.gameObject;
        PlaceState(GameState.MainMenu);
    }
Esempio n. 6
0
        public string CreateNewBudget(Guid CustomerId)
        {
            try
            {
                Guid   NewBudgetId = Guid.NewGuid();
                var    context     = new Central();
                Budget myBudget    = new Budget();
                myBudget.CustomerId   = CustomerId;
                myBudget.BudgetId     = NewBudgetId;
                myBudget.CreationDate = DateTime.Now;
                myBudget.UpdatedDate  = DateTime.Now;
                context.Budgets.Add(myBudget);

                /*****
                 * Tried to see if adding Uncategorized to each was okay
                 * BudgetItem myFirstBudgetItem = new BudgetItem();
                 * myFirstBudgetItem.BudgetId = NewBudgetId;
                 * myFirstBudgetItem.BudgetItemAmount = Decimal.Parse("0.00");
                 * myFirstBudgetItem.BudgetItemCategory = "Uncategorized";
                 * myFirstBudgetItem.BudgetItemFrequency = "Monthly";
                 * myFirstBudgetItem.BudgetItemId = new Guid();
                 * myFirstBudgetItem.BudgetItemName = "Uncategorized";
                 * myFirstBudgetItem.BudgetItemType = 3;
                 * myFirstBudgetItem.CreationDate = DateTime.Now;
                 * myFirstBudgetItem.UpdateDate = DateTime.Now;
                 * context.BudgetItems.Add(myFirstBudgetItem);*/
                context.SaveChanges();
                string Status = "Success";
                return(Status);
            }
            catch (Exception e)
            {
                return(e.ToString());
            }
        }
Esempio n. 7
0
	//public int currentStatus;

	void Start () 
	{

		hp = maxhp;
		InitUI();
		status = Status.Ready;
		//currentStatus = (int)Status.NewTurn;

		for(int y=5;y<GridHeight+5;y++)
		{
			for(int x=5;x<GridWidth+5;x++)
			{
				CreateNewGem(x,y);
				CreateNewFloor(x,y);
			//	mark_to_create[x,y] = false;
//				gems.Add(g.GetComponent<Gem>());
			}
		}
		//caching central
		central = GameObject.Find("Central");
		central_scr = central.GetComponent<Central>();

		PutInCharacter ();
		PutInMonster();
		Display();

		central_scr.Ready();
	//	PutInMonster ();
	}
Esempio n. 8
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            //Store.Default.suggestData = cbSuggest.Checked;
            Store.Default.autoSync     = cbAutoSync.Checked;
            Store.Default.backupData   = cbBackupData.Checked;
            Store.Default.fastStart    = cbFast.Checked;
            Store.Default.daysToFinish = Convert.ToInt32(npdComplet.Value);

            UpdateDepartmentHours();

            Store.Default.downloadSource     = txtDownloadSource.Text;
            Store.Default.updateCheckRuntime = cbUpdateRuntime.Checked;

            Store.Default.Save();

            SaveDepartments();
            SaveProductionEff();
            var c = new Central();

            c.GetBase();
            c.GetProductionColor();

            var table = Central.TaskList;

            dataGridView2.DataSource = table;
        }
 public string AddNewTransaction(Guid CustomerId, UserTransaction TransactionToAdd)
 {
     try
     {
         var             Context = new Central();
         TransactionItem DBTrans = new TransactionItem();
         DBTrans.TransactionItemId         = Guid.NewGuid();
         DBTrans.TransactionItemDate       = TransactionToAdd.TransactionDate;
         DBTrans.TransactionItemName       = TransactionToAdd.TransactionName;
         DBTrans.TransactionItemAmount     = TransactionToAdd.TransactionAmount;
         DBTrans.TransactionItemMemo       = TransactionToAdd.TransactionMemo;
         DBTrans.TransactionItemBudgetItem = TransactionToAdd.BudgetItemId;
         DBTrans.TransactionItemType       = 2;
         DBTrans.CustomerId   = CustomerId;
         DBTrans.CreationDate = DateTime.Now;
         DBTrans.UpdateDate   = DateTime.Now;
         Context.TransactionItems.Add(DBTrans);
         Context.SaveChanges();
         string status = "Success";
         return(status);
     }
     catch (Exception e)
     {
         return(e.ToString());
     }
 }
 public string UploadTransactionsToDatabase(Guid CustomerId, HttpPostedFileBase UploadedFile)
 {
     try
     {
         var    Context        = new Central();
         var    StreamToUpdate = UploadedFile.InputStream;
         var    parser         = new OfxDocumentParser();
         string StreamString   = StreamToString(StreamToUpdate);
         var    ofxDocument    = parser.Import(StreamString);
         foreach (var x in ofxDocument.Transactions)
         {
             if (!IsExistingTransaction(CustomerId, x))
             {
                 TransactionItem UserTransaction = new TransactionItem();
                 UserTransaction.TransactionItemId         = Guid.NewGuid();
                 UserTransaction.CustomerId                = CustomerId;
                 UserTransaction.TransactionItemName       = x.Name;
                 UserTransaction.TransactionItemDate       = DateTime.Parse(x.Date.ToShortDateString());
                 UserTransaction.TransactionItemAmount     = x.Amount;
                 UserTransaction.TransactionItemBudgetItem = Guid.Empty;
                 UserTransaction.TransactionItemType       = 1;
                 UserTransaction.CreationDate              = DateTime.Now;
                 UserTransaction.UpdateDate                = DateTime.Now;
                 Context.TransactionItems.Add(UserTransaction);
             }
         }
         Context.SaveChanges();
         string Status = "Success";
         return(Status);
     }
     catch (Exception e)
     {
         return(e.ToString());
     }
 }
Esempio n. 11
0
        public ActionResult DeleteConfirmed(int id)
        {
            Central central = db.Centrals.Find(id);

            db.Centrals.Remove(central);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 12
0
 /// <summary>
 /// 当前用于比较两个圆形是否相等
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool IsAlmostEqualTo(Circle2D other)
 {
     if (Central.IsAlmostEqualTo(other.Central) && Radius.AreEqual(other.Radius))
     {
         return(true);
     }
     return(false);
 }
Esempio n. 13
0
        protected override void OnLoad(EventArgs e)
        {
            for (var i = DateTime.Now.Year - 2; i <= DateTime.Now.Year + 1; i++)
            {
                cboYears.Items.Add(i);
            }

            cboMonth.SelectedIndexChanged += (s, ev) =>
            {
                if (_firstRead)
                {
                    return;
                }

                Month = cboMonth.SelectedIndex + 1;
                LoadData();
            };

            cboYears.SelectedIndexChanged += (s, ev) =>
            {
                if (_firstRead)
                {
                    return;
                }

                Year = Convert.ToInt32(cboYears.Text);
                LoadData();
            };

            foreach (var str in Store.Default.arrDept.Split(','))
            {
                if (!string.IsNullOrEmpty(str))
                {
                    cboDepartment.Items.Add(str);
                }
            }

            if (cboDepartment.Items.Count > 0)
            {
                cboDepartment.SelectedIndex = 0;
            }

            cboYears.SelectedIndex = cboYears.FindString(DateTime.Now.Year.ToString());
            cboMonth.SelectedIndex = DateTime.Now.Month - 1;

            LoadData();

            FormClosing += delegate
            {
                lblSavedInfo.Visible = true;
                lblSavedInfo.Text    = "Reloading...";

                var m = new Central();
                m.GetBase();
            };

            base.OnLoad(e);
        }
Esempio n. 14
0
 protected virtual void Awake()
 {
     // 戻るボタン
     backSceneButton?.onClick.AddListener(() => {
         SceneManager.LoadScene("Top");
     });
     // GrayBlue取得
     grayBlueCentral = Central.Instance;
 }
Esempio n. 15
0
 void Douse()
 {
     if (central == null)
     {
         central = GameObject.Find("Central").GetComponent <Central>();
     }
     central.ActOnEvent(OFFLANTERN);
     lit = false;
 }
Esempio n. 16
0
        public Guid GetBudgetId(Guid CustomerId)
        {
            var Context = new Central();
            var BudgId  = (from b in Context.Budgets
                           where b.CustomerId == CustomerId
                           select b.BudgetId).First();

            return(BudgId);
        }
Esempio n. 17
0
 void Ignite()
 {
     if (central == null)
     {
         central = GameObject.Find("Central").GetComponent <Central>();
     }
     central.ActOnEvent(LITLANTERN);
     lit = true;
 }
Esempio n. 18
0
 public ActionResult Edit([Bind(Include = "ID,Nombre,Telefono")] Central central)
 {
     if (ModelState.IsValid)
     {
         db.Entry(central).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(central));
 }
Esempio n. 19
0
    void Start()
    {
        central     = GameObject.Find("Central");
        central_scr = central.GetComponent <Central>();
        GameObject tim = GameObject.Find("Time");

        time_txt = tim.GetComponent <Text>();

        //Push();
    }
Esempio n. 20
0
 public ActionResult Edit([Bind(Include = "IdCentral,Nombre,Version,Color,Identificador")] Central central)
 {
     if (ModelState.IsValid)
     {
         db.Entry(central).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(central));
 }
    private float counter; //Arming counter.

    // Use this for initialization
    void Start()
    {
        collided     = false;
        counter      = 0;
        central      = GameObject.Find("Central").GetComponent <Central>();
        missileArmed = transform.Find("MissileArmed").gameObject;
        if (!armed)
        {
            missileArmed.GetComponent <Renderer>().enabled = false;
        }
    }
Esempio n. 22
0
        public ActionResult Create([Bind(Include = "IdCentral,Nombre,Version,Color,Identificador")] Central central)
        {
            if (ModelState.IsValid)
            {
                db.Central.Add(central);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(central));
        }
Esempio n. 23
0
    void Awake()
    {
        spring = GetComponent <SpringJoint2D> ();

        central        = GameObject.FindGameObjectWithTag("Central");
        central_script = central.GetComponent <Central>();
        //hand = GameObject.FindGameObjectWithTag("Hand");

        //catapult = hand.transform;
        spring.enabled = false;
    }
        public async Task <IActionResult> PostCentral([FromBody] Central central)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            await centrales.Insert(central);

            return(CreatedAtAction("GetCentral", new { id = central.CentralId }, central));
        }
Esempio n. 25
0
        public ActionResult Create([Bind(Include = "ID,Nombre,Telefono")] Central central)
        {
            if (ModelState.IsValid)
            {
                db.Centrals.Add(central);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(central));
        }
 public static Centralita operator +(Centralita Central, Llamada nuevaLlamada)
 {
     if (Central == nuevaLlamada)
     {
         Console.WriteLine("Ya se encuentra en la lista");
     }
     else
     {
         Central.AgregarLlamada(nuevaLlamada);
     }
     return(Central);
 }
 public static Centralita operator +(Centralita Central, Llamada nuevaLlamada)
 {
     if (Central == nuevaLlamada)
     {
         throw new CentralitaException("LLamada repetida", "Centralita", "Operador +");
     }
     else
     {
         Central.AgregarLlamada(nuevaLlamada);
     }
     return(Central);
 }
Esempio n. 28
0
        // GET: Centrals/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Central central = db.Centrals.Find(id);

            if (central == null)
            {
                return(HttpNotFound());
            }
            return(View(central));
        }
Esempio n. 29
0
    // Start is called before the first frame update
    void Awake()
    {
        if (Instance != null)
        {
            Debug.LogError("Multiple Die Managers in scene");
        }
        else
        {
            Instance = this;
        }

        _state = State.Uninitialized;
        _dice  = new Dictionary <string, Die>();
    }
        private void UpdateFocus(MassTestChamber master, int deltaTime)
        {
            int direction = master.SimulationInput.PollInteger(MassTestChamber.FocusMotorKey);

            if (direction != 0)
            {
                FocusCart.Drive(direction > 0, deltaTime);
            }
            bool field = master.SimulationInput.PollBoolean(MassTestChamber.FieldGeneratorKey);

            Central.ShowAs(Emitter.IsProvidingMass, field, IsDischarging);
            master.SimulationOutput.SetValue(MassTestChamber.FocusFrontKey, FocusCart.FrontPositionReached);
            master.SimulationOutput.SetValue(MassTestChamber.FocusBackKey, FocusCart.BackPositionReached);
        }
Esempio n. 31
0
    // Update is called once per frame
    // Move units around as per the instructions from the database.
    void FixedUpdate()
    {
        SyncUnits();
        foreach (KeyValuePair <GameObject, Vector3> car in targets)
        {
            if (!car.Key.GetComponent <CarElements>().hit)
            {
                try {
                    car.Key.transform.LookAt(car.Value);
                } catch (Exception e) { Debug.Log(e.ToString()); }
            }
        }
        foreach (KeyValuePair <string, GameObject> car in Connect.hashes)
        {
            if (car.Value.rigidbody.constraints == RigidbodyConstraints.None)
            {
                continue;
            }
            car.Value.transform.Rotate(new Vector3(-car.Value.transform.eulerAngles.x, 0, 0));
            car.Value.rigidbody.constraints = car.Value.rigidbody.constraints | RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ;
            car.Value.transform.position    = new Vector3(car.Value.transform.position.x, 0.1f, car.Value.transform.position.z);
        }
        List <GameObject> toRemove = new List <GameObject>();

        foreach (KeyValuePair <GameObject, Vector3> target in targets)
        {
            if (!Connect.hashes.ContainsValue(target.Key))
            {
                toRemove.Add(target.Key);
                continue;
            }
            // Handle responses.
            Connect.ResponseSpooler(target.Key.name, "locator",
                                    Mathf.Round((target.Key.transform.position.x + 50) * 10).ToString() + "," +
                                    Mathf.Round((target.Key.transform.position.z + 50) * 10).ToString());
            // Debug.Log("Distance: " + Vector3.Distance(target.Key.transform.position, target.Value).ToString());
            if (Central.VerticalDistance(target.Key.transform.position, target.Value, 2.5f))
            {
                target.Key.rigidbody.velocity = Vector3.zero;
                toRemove.Add(target.Key);
                continue;
            }
        }
        foreach (GameObject idleCar in toRemove)
        {
            targets.Remove(idleCar);
        }
        HandleActions();
    }
Esempio n. 32
0
	// Use this for initialization
	void Start () {
		central = Camera.main.GetComponent<Central> ();
		rigidbody.centerOfMass = centroGravedad.localPosition;
		rigidbody.mass = rigidbodyMass;
		rigidbody.drag = rigidbodyDrag;
		rigidbody.angularDrag = rigidbodyAngularDrag;
		rigidbody.maxAngularVelocity = velocidadAngularMaxima;
		parteDelanteraIzq.particulas.Stop(true);
		parteDelanteraDer.particulas.Stop(true);
		parteTraseraIzq.particulas.Stop(true);
		parteTraseraDer.particulas.Stop(true);

		ReferenciaAuto[] referenciasAuto = GetComponentsInChildren<ReferenciaAuto>();
		foreach( ReferenciaAuto referenciaAuto in referenciasAuto ) {
			referenciaAuto.automovil = this;
		}
	}
Esempio n. 33
0
	void Sync()
	{
		central = GameObject.Find("Central");
		central_scr = central.GetComponent<Central>();
		if(type == 1)
		{
			max_hp = central_scr.char1_maxHp;
			dmg = central_scr.char1_dmg;
			def = central_scr.char1_def;
			foreach( int skill in central_scr.char1Skill)
			{
				charSkill.Add (skill);
			}
			foreach(int lvl in central_scr.char1Lvl)
			{
				charLvl.Add (lvl);
			}
			foreach(int exp in central_scr.char1Exp)
			{
				charExp.Add (exp);
			}
		}
		if(type == 2)
		{
			max_hp = central_scr.char2_maxHp;
			dmg = central_scr.char2_dmg;
			def = central_scr.char2_def;
			foreach( int skill in central_scr.char2Skill)
			{
				charSkill.Add (skill);
			}
			foreach(int lvl in central_scr.char2Lvl)
			{
				charLvl.Add (lvl);
			}
			foreach(int exp in central_scr.char2Exp)
			{
				charExp.Add (exp);
			}
		}
	}
Esempio n. 34
0
	void Start(){
		central = Camera.main.GetComponent<Central> ();
	}
Esempio n. 35
0
		static void Main(string[] args) {
			using (Central central = new Central()) {
				central.Run();
			}
		}
Esempio n. 36
0
    void Start()
    {
        central = GameObject.Find("Central");
        central_scr = central.GetComponent<Central>();
        GameObject tim = GameObject.Find("Time");
        time_txt = tim.GetComponent<Text>();

        //Push();
    }
Esempio n. 37
0
 // Use this for initialization
 void Start()
 {
     on = false;
     central = GameObject.Find("Central");
     central_scr = central.GetComponent<Central>();
 }
Esempio n. 38
0
 // Use this for initialization
 void Start()
 {
     central = GameObject.Find("Central");
     central_script = central.GetComponent<Central>();
 }
Esempio n. 39
0
    // Use this for initialization
    void Start()
    {
        own = 0;
        drag = transform.parent.gameObject;
        drag_script = drag.GetComponent<Drag>();
        drag_script.AddList(gameObject);
        central = GameObject.Find("Central");
        central_scr = central.GetComponent<Central>();
        if (type == 0)
        {
            own = central_scr.dog;
        }
        else if(type == 1)
        {
            own = central_scr.chicken;
        }
        guiStyleFore = new GUIStyle();
        guiStyleFore.normal.textColor = Color.white;
        guiStyleFore.alignment = TextAnchor.UpperCenter;
        guiStyleFore.wordWrap = true;
        guiStyleBack = new GUIStyle();
        guiStyleBack.normal.textColor = Color.black;
        guiStyleBack.alignment = TextAnchor.UpperCenter;
        guiStyleBack.wordWrap = true;

           // toolTipText = name + "\n In Storage: " + own + "\n " + toolTipText;
    }