void Create (int range) { //int direction = GetMinDirection (range); int direction = Random.Range (0, 4); Vector2 vector = new Vector2 (range, range); if (direction == 1 || direction == 3) { vector.y = Random.Range (0, 18); } else { vector.x = Random.Range (0, 34); } //Debug.Log ("got vector : " + vector); if (IsAlreadyHere (vector)) return; alreadyHere.Enqueue (vector); GameObject guy = Instantiate (prefab) as GameObject; Vector2 pos = ComputePosition ((int)vector.x, (int)vector.y, direction, range % 2); //pos.y = 0.1f + ((5.0f - range) / 10.0f); guy.transform.parent = transform; guy.transform.localPosition = pos; float sc = Random.Range (0.75f, 1.2f); guy.transform.localScale *= sc; guy.renderer.materials [0].color = PossibleColors.GetRandom (); Stare t = guy.AddComponent<Stare> (); t.target = puck; ranges [direction, range]++; }
private void Load_FolderList() { Stare Stare = new Stare(REDACTATA, new DateTime(), "adresa", "numbeAvt", new Instanta("numeInstanta"), "numbeJudecatorie", new DateTime()); Situatie Situatie = new Situatie("nume situatie", 12, "descriere"); Act Act = new Act(Stare, Situatie, "tipAct", new DateTime()); Folder Folder = new Folder(new Instanta("22"), "adresa", "adresa", "adresa", "adresa", "adresa", "adresa", Act); string[] f1 = { Folder.Nume_cl, Folder.Nume_cl, Folder.Nume_cl }; string[] f2 = { Folder.Nume_cl, Folder.Nume_cl, Folder.Nume_cl }; string[] f3 = { Folder.Nume_cl, Folder.Nume_cl, Folder.Nume_cl }; var listViewItem1 = new ListViewItem(f1); var listViewItem2 = new ListViewItem(f2); var listViewItem3 = new ListViewItem(f3); folderList.Items.Add(listViewItem1); folderList.Items.Add(listViewItem2); folderList.Items.Add(listViewItem3); comboBox1.DataSource = Enum.GetValues(typeof(DATA)); comboBox2.DataSource = Enum.GetValues(typeof(DATA)); comboBox1.SelectedIndex = 0; }
private void saveFolder(object sender, EventArgs e) { CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US"); string format = "d/M/yyyy"; Folder folder = new Folder(); Act act = new Act(); Situatie situatie = new Situatie(); Stare stare = new Stare(); // folder.Instanta = (Instanta) comboBoxIndicativInstanta.SelectedItem; folder.Instanta = InstantaRepository.GetInstantaRepository.GetById(1); //folder.Instanta.Id_instanta = 1; folder.Cod_value_a = textBoxCodDosar1.Text; folder.Cod_value_b = textBoxCodDosar2.Text; folder.Cod_value_c = textBoxCodDosar3.Text; folder.Cod_value_d = textBoxCodDosar4.Text; folder.Cod_value = folder.Cod_value_a + '/' + folder.Cod_value_b + '/' + folder.Cod_value_c + '/' + folder.Cod_value_d; folder.Nume_cl = textBoxNumeClient.Text; folder.Nume_tit_dosar = textBoxNumeTitular.Text; act.Tip_act = textBoxTipAct.Text; act.Data = DateTime.ParseExact(textBoxDataAct.Text, format, CultureInfo.InvariantCulture); situatie.Nume_situatie = textBoxDetaliiAct.Text; situatie.Nr_zile_ramase = int.Parse(textBoxZileRamase.Text); //10 situatie.Descriere = ""; SituatieService.GetSituatieService.Add(situatie); act.Situatie = situatie; stare.Nume_intrebare = textBoxNumeRedactata.Text; stare.Data_intrebare = DateTime.ParseExact(textBoxDataAct.Text, format, CultureInfo.InvariantCulture); //stare.Nume_intrebare = textBoxNumeComunicata.Text; //stare.Data_intrebare = DateTime.Parse(textBoxDataComunicata.Text); stare.Adresa = textBoxAdresaComunicata.Text; //stare.Tip = textBoxNumeApelRecurs.Text; //stare.Data_tip = DateTime.Parse(textBoxDataApelRecurs.Text); stare.Nume_avct = textBoxNumeAvc.Text; //stare.Plecat = textBoxNumePlecat; //stare.Data_plecat = textBoxDataPlecat.Text; stare.Instanta = InstantaRepository.GetInstantaRepository.GetById(1); //stare.Instanta.Id_instanta = 1; //stare.Inregistrat = textBoxNumeInregistrat.Text; //stare.Data_inregistrare = textBoxDataInregistrat.Text; stare.Nume_jdctr = textBoxJudecatori.Text; StareRepository.GetStareRepository.Add(stare); //stare.Data_fotocopiat = DateTime.Parse(textBoxFotoCopiat.Text); //stare.Mentiuni = textBoxMentiuni.Text; act.Stare = stare; ActService.GetActService.Add(act); folder.Act = act; FolderService.GetFolderService.Add(folder); }
public List <Act> GetByStare(Stare stare) { using (ISession session = NHibernateHelper.OpenSession()) { List <Act> actList = (List <Act>)session.QueryOver <Act>().Where(x => x.Stare.Id_stare == stare.Id_stare).List(); return(actList); } }
public Stare GetById(int id_stare) { using (ISession session = NHibernateHelper.OpenSession()) { Stare stare = session.QueryOver <Stare>().Where(x => x.Id_stare == id_stare).SingleOrDefault(); return(stare); } }
public JsonResult Stare() { Stare stare = new Stare { Umplut = SharedVariables.Umplut, Activat = SharedVariables.Activat, Pornit = SharedVariables.Pornit, Deschis = SharedVariables.Deschis }; return(Json(stare)); }
public void Imprumutat() { Utilizator utiliz = new Utilizator(new Text("Nume"), new AdresaContact("Adr.1")); Carte carte = new Carte(new ISSN("23-EFF-344"), new Text("Titlu"), Gen_tip.liric, Gen_continut.Mister); Stare s = Stare.imprumutata; Assert.Equal(s, utiliz.Alege_carte(carte)); }
public void Update(Stare stare) { using (ISession session = NHibernateHelper.OpenSession()) using (ITransaction transaction = session.BeginTransaction()) { session.Update(stare); transaction.Commit(); } }
public void Restituit() { Utilizator utiliz = new Utilizator(new Text("Nume"), new AdresaContact("Adr.2")); Carte carte = new Carte(new ISSN("2454-EFf-334"), new Text("Titlu2"), Gen_tip.liric, Gen_continut.Mister); carte.stare = utiliz.Alege_carte(carte); Stare s = Stare.disponibila; Assert.Equal(s, utiliz.Restituie_carte(carte)); }
public void VerificareIncepeVinzarea() { // arrange State.Stare stare = new Stare(); stare = Stare.Vanzare; //act bool testResult = (stare == Stare.Vanzare); // assert Assert.True(testResult); // success }
public void VerificareIncepeInventarul() { // arrange State.Stare stare = new Stare(); stare = Stare.Inventar; //act bool testResult = (stare == Stare.Inventar); // assert Assert.True(testResult); // success }
public IActionResult UpdateStare([FromBody] Stare model) { try { if (SharedVariables.Activat == false && model.Activat == true) { tcpCommunication.On(); } if (SharedVariables.Activat == true && model.Activat == false) { tcpCommunication.Off(); } if (SharedVariables.Umplut == true && model.Umplut == false) { Task.Run(() => { DBHelper.addUser("User1", DateTime.Now, "Golire", "Nivel 5"); tcpCommunication.Golire(); }); } if (SharedVariables.Umplut == false && model.Umplut == true) { Task.Run(() => { DBHelper.addUser("User1", DateTime.Now, "Umplere", "Nivel 1"); tcpCommunication.Umplere(); }); } } catch (Exception ex) { } SharedVariables.Umplut = model.Umplut; SharedVariables.Activat = model.Activat; SharedVariables.Pornit = model.Pornit; SharedVariables.Deschis = model.Deschis; return(Json(new{ })); }
public static Obiectiv ToObiectiv(ObiectivPostModel obiectiv) { //Transformare din string in Enum Importance Importance importanta = Importance.Low; if (obiectiv.Importanta == "Medium") { importanta = Importance.Medium; } else if (obiectiv.Importanta == "High") { importanta = Importance.High; } //Transformare din string in Enum Stare Stare stare = Stare.Open; if (obiectiv.Starea == "InProgress") { stare = Stare.InProgress; } else if (obiectiv.Starea == "Closed") { stare = Stare.Closed; } return(new Obiectiv { Title = obiectiv.Title, Description = obiectiv.Description, Added = obiectiv.Added, Deadline = obiectiv.Deadline, closedAt = obiectiv.closedAt, Importanta = importanta, Starea = stare, Comments = obiectiv.Comments }); }
public void Add(Stare stare) { StareRepository.GetStareRepository.Add(stare); }
public void Update(Stare stare) { StareRepository.GetStareRepository.Update(stare); }
public List <Act> GetByStare(Stare stare) { return(ActRepository.GetActRepository.GetByStare(stare)); }
public void Remove(Stare stare) { StareRepository.GetStareRepository.Remove(stare); }