private void Login_button_Click(object sender, EventArgs e) { string login = loginText.Text; string password = passwordText.Text; string stanowisko = comboBox.Text; Nawigacja.logForm = this; ProdukcjaEntities2 db = new ProdukcjaEntities2(); var x = db.Pracownicy.Where(y => y.Login.Equals(login)).FirstOrDefault(); if (x != null) { if (x.Haslo.Equals(password) && x.Stanowisko.Equals(stanowisko)) { PracownikClass ob = new PracownikClass(x.id, x.Imię, x.Nazwisko, x.Zmiany, x.Stanowisko); imie = x.Imię.ToString(); Main_GUI m = new Main_GUI(ob); m.Show(); this.Hide(); } else { MessageBox.Show("Niepoprawna Nazwa użytkownika Lub hasło"); } } else { MessageBox.Show("Niepoprawna Nazwa użytkownika Lub hasło"); } }
private List <Button> _PointPos = new List <Button>(); // AI可能會下的位置 void Start() { _Main_GUI = this; GameObject[] _Grid = GameObject.FindGameObjectsWithTag("Grid"); // 將棋盤格讀入 _Grid[] 陣列裡 for (int i = 0; i < _Grid.Length; i++) { _Point_Origin.Add(_Grid[i].GetComponent <Button>()); _Point.Add(_Grid[i].GetComponent <Button>()); } _Win.text = (PlayerPrefs.GetInt("Win")).ToString(); _Tie.text = (PlayerPrefs.GetInt("Tie")).ToString(); _Lose.text = (PlayerPrefs.GetInt("Lose")).ToString(); }
public Game_Field(Main_GUI main, PlayerController player) { this.main = main; this.player = player; InitializeComponent(); TopLevel = false; Dock = DockStyle.Fill; AutoScroll = true; SuspendLayout(); // MapPanel /* * int columns = 50; * int rows = 50; * int squareSize = 100; * * tiles = new TileController(rows, columns); * * TableLayoutPanel layout = new TableLayoutPanel(); * layout.RowCount = rows; * layout.ColumnCount = columns; * * layout.Width = squareSize * columns; * layout.Height = squareSize * rows; * * for (int i = 0; i < rows; i++) * layout.RowStyles.Add(new RowStyle(SizeType.Absolute, squareSize)); * * for (int i = 0; i < columns; i++) * layout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, squareSize)); * * for (int i = 0; i < rows; ++i) //y * { * for (int j = 0; j < columns; ++j) //x * { * layout.Controls.Add(tiles.tiles[i][j].getTile()); * } * } * * Image im = Image.FromFile(@"C:\Users\Outsider\Desktop\TableTop\Images\Sprites\Rydia.png"); * * tiles.tiles[0][1].imageToPaint(im); * * Point t = tiles.tiles[0][1].getTile().Location; * FlowLayoutPanel tempP = new FlowLayoutPanel(); * * tempP.FlowDirection = FlowDirection.TopDown; * tempP.MinimumSize = new Size(200, 100); * tempP.MaximumSize = new Size(200, 600); * tempP.AutoSize = true; * tempP.Location = new Point(t.X + squareSize, t.Y + squareSize); * tempP.Width = 200; * tempP.BackColor = Color.Red; * * Label lbl = new Label(); * lbl.Text = "Hurp"; * tempP.Controls.Add(lbl); * * lbl = new Label(); * lbl.Text = "Derp"; * tempP.Controls.Add(lbl); * * lbl = new Label(); * lbl.Text = "Xert"; * tempP.Controls.Add(lbl); * * lbl = new Label(); * lbl.Text = "Meh"; * tempP.Controls.Add(lbl); * * tempP.Show(); * Controls.Add(tempP); * lbl = new Label(); * lbl.Text = "Derp"; * tempP.Controls.Add(lbl); * * lbl = new Label(); * lbl.Text = "Xert"; * tempP.Controls.Add(lbl); * * lbl = new Label(); * lbl.Text = "Meh"; * tempP.Controls.Add(lbl); * * tempP.Show(); * Controls.Add(tempP); * lbl = new Label(); * lbl.Text = "Derp"; * tempP.Controls.Add(lbl); * * lbl = new Label(); * lbl.Text = "Xert"; * tempP.Controls.Add(lbl); * * lbl = new Label(); * lbl.Text = "Meh"; * tempP.Controls.Add(lbl); * * tempP.Hide(); * Controls.Add(tempP); * * Controls.Add(layout); * layout.Show(); * */ ResumeLayout(); }
/// <summary> /// Used to contruct the main control containing all the UI elements /// </summary> private void Construct_Main_GUI() { gui = new Main_GUI(); controller = new Main_GUI_Controller(); }