public void OnGet() { StatLine fLine = new StatLine(); ViewData["statLine1"] = fLine.ToString(); //ViewData["statLine2"] = new StatLine(); }
private static void ModifyStat(string tableName, int statLineId, string statName, object newValue) { StatTable selectedTable = Tables.SingleOrDefault(table => table.Name.Equals(tableName)); if (selectedTable == null) { return; } StatLine selectedLine = selectedTable.StatisticLines.OrderBy(line => line.Creation).ToList()[statLineId]; if (selectedLine == null) { return; } Stat selectedStat = selectedLine.Statistics.SingleOrDefault(stat => stat.Name.Equals(statName)); if (selectedStat == null) { return; } if (selectedStat.Value.Equals(newValue)) { return; } selectedStat.Value = newValue; selectedLine.Updated = DateTime.Now; Console.WriteLine($"Value of {selectedTable.Name}:{selectedLine.Creation}:{selectedStat.Name} changed to {newValue}"); }
//Fournisseurs private void pictureBox10_Click(object sender, EventArgs e) { UserLine.Hide(); UnitesLine.Hide(); VentesLine.Hide(); StatLine.Hide(); DisLine.Show(); AchatsLine.Hide(); ProduitLine.Hide(); Fournisseurs.BringToFront(); }
private void pictureBox1_Click(object sender, EventArgs e) { WelcomePage.BringToFront(); About.SendToBack(); Contact.SendToBack(); Header.BringToFront(); UserLine.Hide(); UnitesLine.Hide(); VentesLine.Hide(); StatLine.Hide(); DisLine.Hide(); AchatsLine.Hide(); ProduitLine.Hide(); AboutLine.Hide(); ContactLine.Hide(); }
private void logout_Click_1(object sender, EventArgs e) { Login.Show(); About.SendToBack(); Contact.SendToBack(); Header.Show(); UserLine.Hide(); UnitesLine.Hide(); VentesLine.Hide(); StatLine.Hide(); DisLine.Hide(); AchatsLine.Hide(); ProduitLine.Hide(); AboutLine.Hide(); ContactLine.Hide(); }
private void HandleHit(Collider col) { StatLine HitStatHolder = col.GetComponent <StatLine>(); //Make sure we did not hit something NoneHitable if (HitStatHolder != null) { if (HitStatHolder.transform.CompareTag("Player")) { PlayerStats.instance.TakeDamage(Stats.RandomDamage(), true); } else { HitStatHolder.TakeDamage(Stats.RandomDamage(), false); } } }
private void OnTriggerEnter(Collider other) { if (explodeOnImpact) { ExplodeProjectile(); } if (Contains(CanHit, other.gameObject.layer)) { //Do damage StatLine enemy = other.GetComponent <StatLine>(); if (enemy != null) { enemy.TakeDamage(Mathf.RoundToInt(damage), false); } //Destroy projectile DestroySelf(); } }
void CreateScorer() { StatLine startingStatLine = new StatLine(); startingStatLine.stName = transform.GetChild(3).GetComponent <UnityEngine.UI.Text>(); startingStatLine.stKills = transform.GetChild(4).GetComponent <UnityEngine.UI.Text>(); startingStatLine.stDeaths = transform.GetChild(5).GetComponent <UnityEngine.UI.Text>(); int playersAmount = PlayerPrefs.GetInt("Players"); statLines = new StatLine[playersAmount]; for (int i = 0; i < playersAmount; i++) { statLines[i].stName = Instantiate(startingStatLine.stName) as UnityEngine.UI.Text; statLines[i].stKills = Instantiate(startingStatLine.stKills) as UnityEngine.UI.Text; statLines[i].stDeaths = Instantiate(startingStatLine.stDeaths) as UnityEngine.UI.Text; statLines[i].stName.transform.parent = transform; statLines[i].stDeaths.transform.parent = transform; statLines[i].stKills.transform.parent = transform; statLines[i].stName.rectTransform.position = startingStatLine.stName.rectTransform.position - new Vector3(0f, 50f * (i + 1), 0f); statLines[i].stKills.rectTransform.position = startingStatLine.stKills.rectTransform.position - new Vector3(0f, 50f * (i + 1), 0f); statLines[i].stDeaths.rectTransform.position = startingStatLine.stDeaths.rectTransform.position - new Vector3(0f, 50f * (i + 1), 0f); } }
//Statistiques private void pictureBox11_Click(object sender, EventArgs e) { int i = 0; DateTime today = DateTime.Today; TODAYDATE.Text = today.ToString("yyyy-MM-dd"); // TODAYDATE.Text = DateTime.Now.ToLongDateString(); UserLine.Hide(); UnitesLine.Hide(); VentesLine.Hide(); StatLine.Show(); DisLine.Hide(); AchatsLine.Hide(); ProduitLine.Hide(); Statistiques.BringToFront(); //==> TOP 5 PRODUCTS SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "select top(5) product, SUM(Total) from Commande GROUP BY product order by SUM(Total) desc"; cmd.ExecuteNonQuery(); DataTable dt9 = new DataTable(); SqlDataAdapter da9 = new SqlDataAdapter(cmd); da9.Fill(dt9); dataGridView5.DataSource = dt9; //==> NUMBER OF ORDERS DONE TODAY SqlCommand cmd1 = con.CreateCommand(); cmd1.CommandType = CommandType.Text; cmd1.CommandText = "SELECT COUNT( DISTINCT id), COUNT(DISTINCT product), COUNT( DISTINCT order_id), SUM(Total) FROM Commande WHERE ComDate ='" + TODAYDATE.Text + "'"; cmd1.ExecuteNonQuery(); DataTable dt11 = new DataTable(); SqlDataAdapter da11 = new SqlDataAdapter(cmd1); da11.Fill(dt11); // dataGridView6.DataSource = dt11; NumCommande.Text = dt11.Rows[0][0].ToString(); NumProducts.Text = dt11.Rows[0][1].ToString(); ClientsToday.Text = dt11.Rows[0][2].ToString(); TotalAmountToday.Text = dt11.Rows[0][3].ToString(); //==> NUMBER OF CLIENTS AND PRODUCTS MONTH SqlCommand cmd2 = con.CreateCommand(); cmd2.CommandType = CommandType.Text; cmd2.CommandText = "SELECT COUNT(DISTINCT product), COUNT( DISTINCT order_id) FROM Commande WHERE month(ComDate) ='" + DateTime.Now.Month + "'"; cmd2.ExecuteNonQuery(); DataTable dt3 = new DataTable(); SqlDataAdapter da3 = new SqlDataAdapter(cmd2); da3.Fill(dt3); NumProdMonth.Text = dt3.Rows[0][0].ToString(); NumClientMonth.Text = dt3.Rows[0][1].ToString(); //==> Linear Chart datatable /* SqlCommand cmd3 = con.CreateCommand(); * cmd3.CommandType = CommandType.Text; * cmd3.CommandText = "select Distinct ComDate, SUM(Total) from Commande group by ComDate"; * cmd3.ExecuteNonQuery(); * DataTable dt4 = new DataTable(); * SqlDataAdapter da4 = new SqlDataAdapter(cmd3); * da4.Fill(dt4);*/ /*chart2.DataSource = v_SalesTableAdapter; * * * * chart2.Series["Series1"].XValueMember= "ComDate"; * chart2.Series["Series1"].YValueMembers =" Total"; * * * chart2.DataBind();*/ //==> /* SqlCommand cmd2 = con.CreateCommand(); * cmd2.CommandType = CommandType.Text; * cmd2.CommandText = "SELECT COUNT(product) FROM Commande WHERE ComDate ='" + TODAYDATE.Text + "'"; * cmd2.ExecuteNonQuery(); * DataTable dt10 = new DataTable(); * SqlDataAdapter da10 = new SqlDataAdapter(cmd2); * da11.Fill(dt10); * // dataGridView6.DataSource = dt10;*/ // NumCommande.Text = dataGridView6.Rows[0].Cells[0].Value.ToString(); MonthNow1.Text = DateTime.Now.ToString("MMMM"); MonthNow2.Text = DateTime.Now.ToString("MMMM"); //==> CHART /* SqlCommand cmd4 = con.CreateCommand(); * cmd4.CommandType = CommandType.Text; * cmd4.CommandText = "SELECT Total FROM Commande "; * cmd4.ExecuteNonQuery(); * DataTable dt4 = new DataTable(); * SqlDataAdapter da4 = new SqlDataAdapter(cmd4); * da4.Fill(dt4);*/ }