private void Button_Click_1(object sender, RoutedEventArgs e)//new game { Window1 window1 = new Window1(); window1.Show(); Main_Menu.Hide(); }
private void btnCancel_Click(object sender, EventArgs e) { if (MessageBox.Show("Are sure you want to cancel ? ", "Cancel", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes) { Main_Menu frm = new Main_Menu(); frm.Show(); this.Close(); } }
public async Task <IActionResult> DeletePost(int?id) { Main_Menu mainmenu = await _context.Main_Menus.FindAsync(id); _context.Main_Menus.Remove(mainmenu); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); }
private void okButton_Click(object sender, EventArgs e) { Main_Menu mainfrm = new Main_Menu(); ((Form)mainfrm).Controls["User_txt"].Text = User_txt.Text; ((Form)mainfrm).Controls["Username_lbl"].Text = Username_lbl.Text.Trim(); ((Form)mainfrm).Controls["Password_lbl"].Text = Password_lbl.Text.Trim(); mainfrm.Show(); this.Close(); }
public async Task <IActionResult> Update(int?id, Main_Menu mainmenu) { if (!ModelState.IsValid) { return(View(mainmenu)); } _context.Entry(mainmenu).State = Microsoft.EntityFrameworkCore.EntityState.Modified; await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); }
// Use this for initialization void Awake() { //make sure only one Main Menu exists if (menu == null) { DontDestroyOnLoad(gameObject); menu = this; } else if (menu != this) { Destroy(gameObject); } }
private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e) { foreach (Form childForm in MdiChildren) { childForm.Close(); Main_Menu mainfrm = new Main_Menu(); ((Form)mainfrm).Controls["User_txt"].Text = User_txt.Text; ((Form)mainfrm).Controls["Username_lbl"].Text = Username_lbl.Text.Trim(); ((Form)mainfrm).Controls["Password_lbl"].Text = Password_lbl.Text.Trim(); mainfrm.Show(); this.Close(); } }
public async Task <IActionResult> Create(Main_Menu mainmenu) { if (!ModelState.IsValid) { return(View()); } await _context.Main_Menus.AddAsync(mainmenu); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); }
public async Task <IActionResult> Update(int?id) { if (id == null) { return(NotFound()); } Main_Menu mainmenu = await _context.Main_Menus.FindAsync(id); if (mainmenu == null) { return(NotFound()); } return(View(mainmenu)); }
void OnTriggerEnter(Collider other) { if (other.tag == "Pickup_Grapple") { Debug.Log("Picked up Grapple Hook"); inv_has_grapple_hook = true; Cycle_Item(); Destroy(other.gameObject); } else if (other.tag == "Pickup_Staff") { Debug.Log("Picked up Staff of Blasting"); inv_has_blast_staff = true; Cycle_Item(); Destroy(other.gameObject); } else if (other.tag == "Pickup_Finish") { run_timer = false; // Report time string message = "Finished the dungeon!\n"; message += "Dungeon Seed: " + dungeon.Get_Seed() + "\n"; message += "Dungeon Tmie: " + Format_Time(level_timer, clock_precision) + "\n"; Debug.Log(message); end_time.text = Format_Time(level_timer, clock_precision); if (Main_Menu.Consider_Best_Time(level_timer, dungeon.Get_Seed())) { Debug.Log("NEW BEST TIME"); end_notice.text += " New Best Time!"; } end_screen.SetActive(true); Destroy(other.gameObject); } else if (other.tag == "Pickup_Speed") { Debug.Log("Picked up a speed boost"); speed_boost_timer = speed_boost_time; Destroy(other.gameObject); } else if (other.tag == "Pickup_Jump") { Debug.Log("Picked up a jump boost"); jump_boost_timer = jump_boost_time; Destroy(other.gameObject); } }
private void btnLogin_Click(object sender, EventArgs e) { Main_Menu obj = new Main_Menu(); this.Hide(); //while (close == false) { obj.ShowDialog(); //close = obj.close; //continue; } this.Show(); this.txtPassword.Text = ""; this.txtUsername.Text = ""; }
private void Log_local() { cont.conectar("DM"); SqlCommand cm4 = new SqlCommand("SELECT [USUARIO],[PASS_LOCAL],[PUESTO] FROM [DM].[CORRECT].[USUARIOS] where usuario ='" + textBox1.Text + "'", cont.condm); SqlDataReader dr = cm4.ExecuteReader(); while (dr.Read()) { usuario = Convert.ToString(dr["USUARIO"]); contraseña = Encripter.Desencriptar(Convert.ToString(dr["PASS_LOCAL"])); // puesto = Convert.ToString(dr["PUESTO"]); } dr.Close(); cont.Desconectar("DM"); if (textBox1.Text.ToUpper() == usuario.ToUpper()) { if (contraseña == "" || contraseña == string.Empty) { MessageBox.Show("Este usuario no cuenta con contraseña Solicitar la Creacion a Soporte Tecnico"); } else if (textBox2.Text == contraseña) { if (Convert.ToInt32(actual) > Convert.ToInt32(nueva)) { UpdateVercion(); } Main_Menu fm6 = new Main_Menu(); this.Visible = false; fm6.ShowDialog(); fm6.Close(); fm6 = null; this.Close(); } else { MessageBox.Show("Error en Contraseña"); } } else { MessageBox.Show("Usuario no Existe"); } }
private void btnLogin_Click(object sender, EventArgs e) { string password = txtPassword.Text; string username = txtUsername.Text; if (password == "password" && username == "username") { Main_Menu frm = new Main_Menu(); frm.Show(); this.Hide(); } else { if (MessageBox.Show("Wrong Password or Username", "", MessageBoxButtons.OK) == System.Windows.Forms.DialogResult.OK) { txtUsername.Clear(); txtPassword.Clear(); } } }
private void btnConfirm_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(connStr); con.Open(); if (MessageBox.Show("Do you want confirm the reservation?", "Reservation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { if (MessageBox.Show("Reservation has been confirmed!", "Reservation", MessageBoxButtons.OK, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.OK) { Main_Menu form = new Main_Menu(); form.Show(); this.Close(); } } if (con.State == System.Data.ConnectionState.Open) { String q = "insert into RESERVATION(RESERVATIONID, NIC, PLATENO, STARTDATE, ENDDATE, PAYMENT)values('" + txtReservationID.Text + "','" + txtNIC.Text.ToString() + "','" + txtPlateNo.Text.ToString() + "','" + this.dateTimePicker1 + "','" + this.dateTimePicker2 + "','" + txtPayment.Text.ToString() + "')"; SqlCommand cmd = new SqlCommand(q, con); } }
void Awake() { if(Instance != null && Instance != this){ Destroy(gameObject); } Instance = this; DontDestroyOnLoad(gameObject); }
void obtainData() { //"C:/Users/Agus/Documents/GitHub/Proyecto1_Analisis_de_Algoritmos/[Proyecto1]-Analisis-de-Algoritmos/Assets/nonogram.txt" Main_Menu obj = new Main_Menu(); if (obj.getNonoGramPath() == "") { UnityEngine.Debug.Log("Debe elegir un Nonogram"); } else { StreamReader sr = new StreamReader(obj.getNonoGramPath()); //obj.getNonoGramPath() string line = ""; string[] aux; short con = 0; while ((line = sr.ReadLine()) != null) { //Lee todas las lineas dentro del .txt if (con == 0) { //Obtener el num de columnas y filas aux = line.Split(','); for (int i = 0; i < 2; i++) { if (i == 0) { rows = int.Parse(aux[i]); } if (i == 1) { columns = int.Parse(aux[i]); } } con++; } if (line.Equals("FILAS") == true) { //Sección del txt donde dan las pistas de las filas con++; } if (line.Equals("COLUMNAS") == true)//Sección del txt donde dan las pistas de las columnas { con++; } if (con == 2) { //Obtener las pistas que hay en cada fila if (line.Equals("FILAS") != true) { List <string> aux2 = new List <string>(); aux = line.Split(','); foreach (string i in aux) { aux2.Add(i); //Debug.Log("Estoy agregando para filas:" + i); } pistasFilas.Add(aux2); } } if (con == 3) { //Obtener las pistas que hay en cada columna if (line.Equals("COLUMNAS") != true) { List <string> aux2 = new List <string>(); aux = line.Split(','); foreach (string i in aux) { aux2.Add(i); //Debug.Log("Estoy agregando para columnas:" + i); } pistasColumnas.Add(aux2); } } } //TESTING /*for (int e = 0; e < pistasFilas.Count; e++) * { * for (int i = 0; i < pistasFilas[e].Count; i++) * { * * Debug.Log("Pistas de filas:" + pistasFilas[e][i]); * } * } * for (int e = 0; e < pistasColumnas.Count; e++) * { * for (int i = 0; i < pistasColumnas[e].Count; i++) * { * * Debug.Log("Pistas de columnas:" + pistasColumnas[e][i]); * } * }*/ } }
static void Main(string[] args) { Main_Menu main_Menu = new Main_Menu(); main_Menu.Menu(); }
static void Main(string[] args) { Main_Menu.mai(); }
private void ingreso() { if (empresa != "") { usuario = textBox1.Text; contraseña = textBox2.Text; if (PermisoEmpresa(usuario, empresa)) { if (tipo_Usuario(usuario)) { Log_local(); } else { //conxion para validar string cad = "data source=192.168.1.25;initial catalog=EXACTUS ;user Id ='" + usuario + "' ; password = '******'"; SqlConnection con = new SqlConnection(cad); // valida usuarios y contraseña try { con.Open(); // MessageBox.Show("Bienvenido"+" "+usuario); con.Close(); // ID_EMPRESA(); if (Convert.ToInt32(actual) > Convert.ToInt32(nueva)) { UpdateVercion(); } XMLRW.writeLogin(usuario, vercion, empresa, tipo_user); Main_Menu fm6 = new Main_Menu(); this.Visible = false; fm6.ShowDialog(); fm6.Close(); fm6 = null; this.Close(); } catch (Exception erg) { string text = erg.ToString(); if (text.Contains("inicio de sesión")) { MessageBox.Show("Error en Usuario o Contraseña", "Error Inicio de Sesión "); this.textBox2.Text = null; } else { MessageBox.Show(text, "!!!! Error !!!! "); this.textBox2.Text = null; } } } } else { MessageBox.Show("Actualmente no cuenta con Permisos para la Empresa " + empresa + ""); } } }
private void Accept_btn_Click(object sender, EventArgs e) { try { if (UserName_txt.Text == "") { MessageBox.Show("Please enter your Username", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); UserName_txt.Focus(); } else if (Password_txt.Text == "") { MessageBox.Show("Please enter your Password", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Password_txt.Focus(); } else if (UserName_txt.Text == "admin" && Password_txt.Text == "admin3092") { role = "System Administrator"; MessageBox.Show("Welcome " + role, "Congrats", MessageBoxButtons.OK, MessageBoxIcon.Information); Main_Menu mainfrm = new Main_Menu(); this.Hide(); mainfrm.Show(); ((Form)mainfrm).Controls["User_txt"].Text = role; ((Form)mainfrm).Controls["Username_lbl"].Text = role; ((Form)mainfrm).Controls["Password_lbl"].Text = Convert.ToString(DateTime.Now); connection.Open(); OleDbCommand command = connection.CreateCommand(); command = connection.CreateCommand(); command.CommandType = CommandType.Text; command.CommandText = "insert into [System_Log_tbl] (Username,Login_DateTime) values ('" + role + "','" + DateTime.Now + "')"; command.ExecuteNonQuery(); connection.Close(); } else { string query = "Select [Role] FROM [System_Users_tbl] WHERE Username = '******' and Password = '******'"; OleDbDataAdapter sda = new OleDbDataAdapter(query, connection); DataTable dtbl = new DataTable(); sda.Fill(dtbl); role = dtbl.Rows[0][0].ToString(); if (role != "") { MessageBox.Show("Welcome " + role, "Congrats", MessageBoxButtons.OK, MessageBoxIcon.Information); Main_Menu mainfrm = new Main_Menu(); this.Hide(); mainfrm.Show(); ((Form)mainfrm).Controls["User_txt"].Text = role; ((Form)mainfrm).Controls["Username_lbl"].Text = UserName_txt.Text.Trim(); ((Form)mainfrm).Controls["Password_lbl"].Text = Convert.ToString(DateTime.Now); connection.Open(); OleDbCommand command = connection.CreateCommand(); command.CommandType = CommandType.Text; command.CommandText = "insert into [System_Log_tbl] (Username,Login_DateTime) values ('" + UserName_txt.Text.Trim() + "','" + DateTime.Now + "')"; command.ExecuteNonQuery(); connection.Close(); } else { MessageBox.Show("Username and/or Password is incorrect", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); UserName_txt.Text = ""; Password_txt.Text = ""; UserName_txt.Focus(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Database not Found", MessageBoxButtons.OK, MessageBoxIcon.Error); UserName_txt.Text = ""; Password_txt.Text = ""; UserName_txt.Focus(); } }
static void Main(string[] args) { Console.Title = "Airport information panel. Sukhov I. 2016-02-05"; /*Заголовок консольной формы*/ String[,] Arrivals_Array = new string[100, 7]; /*Создаем масив с данными по прилетам*/ ///////////////////////////////////////////////////////////////////////////////////////////////////////// //тестовый масив прилетов /*рейс 1*/ Arrivals_Array[0, 0] = "U571"; Arrivals_Array[0, 1] = "Berlin Fly"; Arrivals_Array[0, 2] = "16:45"; Arrivals_Array[0, 3] = "Munich"; Arrivals_Array[0, 4] = "D"; Arrivals_Array[0, 5] = "Delayed"; Arrivals_Array[0, 6] = "12"; /*рейс 2*/ Arrivals_Array[1, 0] = "A015"; Arrivals_Array[1, 1] = "Turkish Air"; Arrivals_Array[1, 2] = "17:45"; Arrivals_Array[1, 3] = "Istambul"; Arrivals_Array[1, 4] = "A"; Arrivals_Array[1, 5] = "Flight"; Arrivals_Array[1, 6] = "3"; /*рейс 3*/ Arrivals_Array[2, 0] = "M117"; Arrivals_Array[2, 1] = "MAU"; Arrivals_Array[2, 2] = "10:30"; Arrivals_Array[2, 3] = "Kyiv/Borispil"; Arrivals_Array[2, 4] = "B"; Arrivals_Array[2, 5] = "Arrived"; Arrivals_Array[2, 6] = "9"; /*рейс 4*/ Arrivals_Array[3, 0] = "N737"; Arrivals_Array[3, 1] = "NY Air"; Arrivals_Array[3, 2] = "19:20"; Arrivals_Array[3, 3] = "New York"; Arrivals_Array[3, 4] = "C"; Arrivals_Array[3, 5] = "Arrived"; Arrivals_Array[3, 6] = "6"; /*рейс 5*/ Arrivals_Array[4, 0] = "G737"; Arrivals_Array[4, 1] = "Georgia Fly"; Arrivals_Array[4, 2] = "11:20"; Arrivals_Array[4, 3] = "Tbilisi"; Arrivals_Array[4, 4] = "A"; Arrivals_Array[4, 5] = "Flight"; Arrivals_Array[4, 6] = "4"; /*рейс 6*/ Arrivals_Array[5, 0] = "K190"; Arrivals_Array[5, 1] = "Air Astana"; Arrivals_Array[5, 2] = "23:55"; Arrivals_Array[5, 3] = "Astana"; Arrivals_Array[5, 4] = "D"; Arrivals_Array[5, 5] = "Flight"; Arrivals_Array[5, 6] = "7"; ///////////////////////////////////////////////////////////////////////////////////////////////////////// Main_Menu Main_Menu_List = new Main_Menu(); /*Создаем экземпляр обьекта типа "главное меню"*/ Arrivals Arrivals_table = new Arrivals(); /*создаем экземпляр обьекта типа "таблица прибытий"*/ Evacuation Evacuation = new Evacuation(); ConsoleKeyInfo Console_keyInfo; /*Создаем переменную содержит "нажатую клавишу"*/ Return_To_Main_Menu: /*Метка возврта к главному меню*/ Main_Menu_List.Show_Main_Menu(); /*Вызываем метод по отображению главного меню*/ /*закрытый цикл по пунктам главного меню*/ while (1==1) { Console_keyInfo = Console.ReadKey(); /*Считываем нажатую клавишу в переменную*/ /*При нажатии стрелки вверх - переходим на один пункт меню вверх*/ if(Console_keyInfo.Key == ConsoleKey.UpArrow) Main_Menu_List.Menu_Position_Number = --Main_Menu_List.Menu_Position_Number; /*При нажатии стрелки вниз - переходим на один пункт меню вниз*/ if (Console_keyInfo.Key == ConsoleKey.DownArrow) Main_Menu_List.Menu_Position_Number = ++Main_Menu_List.Menu_Position_Number; /*При нажатии клавиши E - возврат к пункту меню EXIT*/ if (Console_keyInfo.Key == ConsoleKey.E) Main_Menu_List.Menu_Position_Number = 7; /*При нажатии Enter - выход из цикла*/ if (Console_keyInfo.Key == ConsoleKey.Enter) break; Main_Menu_List.Show_Main_Menu(); /*Вызываем метод по отображению главного меню*/ }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////// /*Блок работы с таблицами прилетов Arrivals*/ //////////////////////////////////////////// /*При выборе пункта меню "SHOW ARRIVALS" запускаем панель отображения прилетов*/ /*Если пункт меню==1 тогда выводим таблицу прибытий "Arrivals"*/ if (Main_Menu_List.Menu_Position_Number==1) { Arrivals_table.Show_Arrival_Table_Head(); /*прорисовываем заголовок таблицы*/ Arrivals_table.Show_Arrival_Table_Data(Arrivals_Array, 1, "No Sort"); /*прорисовываем часть таблицы с данными о прилетах*/ Arrivals_table.Show_Arrival_Table_End(); /*прорисовываем концовку таблицы*/ while (1==1) /*Закрытый цикл с переходами по столбцам таблицы*/ { Console_keyInfo = Console.ReadKey(); /*Считываем нажатую клавишу в переменную*/ /*при нажатии стрелки влево- переходим к следующему столбцу*/ if (Console_keyInfo.Key == ConsoleKey.RightArrow) Arrivals_table.Arrival_Table_Collumn_Num = ++Arrivals_table.Arrival_Table_Collumn_Num; /*при нажатии стрелки вправо- переходим к предыдущему столбцу*/ if (Console_keyInfo.Key == ConsoleKey.LeftArrow) Arrivals_table.Arrival_Table_Collumn_Num = --Arrivals_table.Arrival_Table_Collumn_Num; Arrivals_table.Show_Arrival_Table_Head(); /*отслеживаем нажатия клавиш ввре/вниз для сортировки выводимых данных*/ switch (Console_keyInfo.Key) { case ConsoleKey.UpArrow: Arrivals_table.Show_Arrival_Table_Data(Arrivals_Array, Arrivals_table.Arrival_Table_Collumn_Num,"ASC"); break; case ConsoleKey.DownArrow: Arrivals_table.Show_Arrival_Table_Data(Arrivals_Array, Arrivals_table.Arrival_Table_Collumn_Num, "DESC"); break; default: Arrivals_table.Show_Arrival_Table_Data(Arrivals_Array, Arrivals_table.Arrival_Table_Collumn_Num, "No sort"); break; } Arrivals_table.Show_Arrival_Table_End(); /*при нажатии клавиши E- выходим в начало программы, в главное меню*/ if (Console_keyInfo.Key == ConsoleKey.E) goto Return_To_Main_Menu; /*метка переходав в начало программы и запуска главного меню*/ }; }; //////////////////////////////////////////// /*При выборе пункта меню "Add new flygth to Arrival" зупаскаем панель отображения прилетов*/ string[] New_ArrivaL = new string[7]; if (Main_Menu_List.Menu_Position_Number == 3) { New_ArrivaL = Arrivals_table.Arrivals_Add_New_Arrival(); /*добавляем новую запись в наш масив прилетов*/ if (New_ArrivaL[0] != null & New_ArrivaL[0] != "") for (Int32 i = 1; i <= Arrivals_Array.GetLength(0); i++) { if (Arrivals_Array[i - 1, 0] == null) { for (Int32 j = 1; j <= 7; j++) { Arrivals_Array[i - 1, j - 1] = New_ArrivaL[j - 1]; } break; } } goto Return_To_Main_Menu; } /////////////////////////////////////////// /*запускаем окно эвакуации*/ if (Main_Menu_List.Menu_Position_Number == 8) { Evacuation.Evacuation_Screen(); /*выхываем меню создания нового рейса прибытия*/ Console.ReadLine(); } }
public void MultiPlayerStart() { SaveGame.LoadGame(); //SceneManager.LoadScene(1); Main_Menu.LoadSceneFromSave(); }
public void SinglePlayerStart() { SaveGame.LoadGame(); //SceneManager.LoadScene(2); Main_Menu.LoadSceneFromSave(); }