private void materialFlatButton2_Click(object sender, EventArgs e) { Mainframe a = new Mainframe(); a.Show(); this.Hide(); }
private void materialFlatButton1_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(textBox9.Text) || (string.IsNullOrWhiteSpace(textBox11.Text) && textBox11.Enabled == true) || string.IsNullOrWhiteSpace(textBox3.Text) || string.IsNullOrWhiteSpace(textBox1.Text) || string.IsNullOrWhiteSpace(textBox2.Text) || string.IsNullOrWhiteSpace(textBox5.Text) || string.IsNullOrWhiteSpace(comboBox1.Text) || string.IsNullOrWhiteSpace(textBox6.Text)) { MessageBox.Show("Please don't leave any blank field(s)."); } else if (textBox10.Text != textBox11.Text && textBox10.Enabled == true) { MessageBox.Show("Password does not match the confirm password."); } else { update(); Mainframe a = new Mainframe(); a.Show(); this.Hide(); } }
private void Button_Click(object sender, RoutedEventArgs e) { //MessageBox.Show("yo"); downloadButton.FontWeight = FontWeights.Bold; optionsButton.FontWeight = FontWeights.Normal; Mainframe.Navigate(new Uri("DownloadPage.xaml", UriKind.Relative)); }
public MainWindow() { InitializeComponent(); string helpurl1 = ((Directory.GetCurrentDirectory() + "\\Images\\free-encryption.jpg")); //System.Diagnostics.Process.Start(helpurl1); ImageSource imageSource = new BitmapImage(new Uri(helpurl1)); backgroundImage.ImageSource = imageSource; Mainframe.Navigate(new Login()); }
public MainPage() { this.InitializeComponent(); this.DataContext = this; DJISDKManager.Instance.SDKRegistrationStateChanged += Instance_SDKRegistrationStateChanged; if (DJISDKManager.Instance.appActivationState != AppActivationState.ACTIVATED) { // Active the APP with ApiKey DJISDKManager.Instance.RegisterApp(APIKEY); TB_active.Text = "Activiting..."; } Mainframe.Navigate(typeof(Views.Home)); }
public void addcategory() { try { MySqlConnection conn = new MySqlConnection(ConnectionString.myConnection); if (tbcatname.Text == "" || cbBrandP.Text == "") { MessageBox.Show("Please Complete the Form"); } else { conn.Open(); MySqlCommand command = conn.CreateCommand(); command.CommandText = "select * from tbl_category c " + "inner join tbl_brandpartner b on c.col_useraccountsid = b.col_useraccountsid " + " where b.col_brandname = '" + cbBrandP.Text + "' and col_categoryname = '" + tbcatname.Text + "' "; MySqlDataReader read = command.ExecuteReader(); int count = 0; while (read.Read()) { count++; } conn.Close(); if (count >= 1) { MessageBox.Show("Category already exist."); } else { conn.Open(); MySqlCommand command2 = conn.CreateCommand(); command2.CommandText = "insert into tbl_category (col_useraccountsid, col_categoryname) " + "values((Select col_useraccountsid from tbl_brandpartner where col_brandname= '" + cbBrandP.Text + "' limit 1),'" + tbcatname.Text + "')"; command2.ExecuteNonQuery(); conn.Close(); MessageBox.Show("Successfully Added!"); Mainframe a = new Mainframe(); a.Show(); this.Close(); } } } catch (Exception e) { MessageBox.Show("No connection to host"); } }
public void updateBrandPartnert() { try { MySqlConnection conn = new MySqlConnection(ConnectionString.myConnection); conn.Open(); MySqlCommand command = conn.CreateCommand(); string query = "UPDATE tbl_useraccounts SET " + "col_user = '******', " + "col_password = '******', " + "col_lastname = '" + textBox3.Text + "', " + "col_firstname = '" + textBox1.Text + "', " + "col_middlename = '" + textBox2.Text + "', " + "col_address = '" + textBox5.Text + "', " + //"col_dateofbirth = '" + dateTimePicker1.Value + "', " + "col_gender = '" + comboBox1.SelectedItem.ToString() + "', " + "col_contactnum = '" + textBox6.Text + "' " + //"col_brandemail ='" + textBox11.Text+"' "+ "WHERE col_useraccountsid='" + labelBrandpartnerId.Text + "'"; command.CommandText = query; command.ExecuteScalar(); conn.Close(); conn.Open(); command = conn.CreateCommand(); query = "UPDATE tbl_brandpartner SET " + "col_brandname = '" + textBox4.Text + "', " + "col_brandaddress = '" + textBox7.Text + "', " + "col_brandcontactnum = '" + textBox8.Text + "', " + "col_brandemail ='" + textBox11.Text + "' " + "WHERE col_useraccountsid='" + labelBrandpartnerId.Text + "'"; command.CommandText = query; command.ExecuteScalar(); conn.Close(); } catch (Exception) { MessageBox.Show("No Connection to Host."); } MessageBox.Show("Successfully Updated!"); Mainframe a = new Mainframe(); a.Show(); this.Hide(); }
public void additem() { try { MySqlConnection conn = new MySqlConnection(ConnectionString.myConnection); conn.Open(); MySqlCommand command = conn.CreateCommand(); command.CommandText = "select * from tbl_product where col_productcode = '" + textBox1.Text + "' "; MySqlDataReader read = command.ExecuteReader(); int count = 0; while (read.Read()) { count++; } conn.Close(); if (count >= 1) { MessageBox.Show("The product code is already taken, please try another one"); } else { conn.Open(); MySqlCommand command2 = conn.CreateCommand(); command2.CommandText = "insert into tbl_product (col_useraccountsid, col_categoryid, col_productcode, col_productname, col_productprice, col_status) " + "values ((SELECT col_useraccountsid from tbl_brandpartner where col_brandname='" + comboBox1.Text + "' limit 1)," + "(SELECT col_categoryid from tbl_category c inner join tbl_brandpartner b on c.col_useraccountsid = b.col_useraccountsid where b.col_brandname='" + comboBox1.Text + "' and col_categoryname= '" + comboBox2.Text + "' limit 1),'" + textBox1.Text + "','" + textBox3.Text + "', round(" + textBox2.Text + ",2),'unarchived')"; command2.ExecuteNonQuery(); conn.Close(); MessageBox.Show("Successfully Added!"); Mainframe a = new Mainframe(); a.Show(); this.Close(); } } catch (Exception e) { MessageBox.Show("No connection to host"); } }
private void MainList_ItemClick(object sender, ItemClickEventArgs e) { if (ham.DisplayMode == SplitViewDisplayMode.Overlay) { ham.IsPaneOpen = false; } if (e.ClickedItem is PaneItem) { var item = e.ClickedItem as PaneItem; switch (item.Index) { case 0: Mainframe.Navigate(typeof(Views.Home)); break; case 1: Mainframe.Navigate(typeof(Views.Camera)); break; } } }
public void adddetails() { MySqlConnection conn = new MySqlConnection(ConnectionString.myConnection); if (label1.Text == "") { MessageBox.Show("Complete the Form"); } else { conn.Open(); MySqlCommand command = conn.CreateCommand(); command.CommandText = "select * from tbl_brandpartner where col_brandname = '" + textBox4.Text + "' "; MySqlDataReader read = command.ExecuteReader(); int count = 0; while (read.Read()) { count++; } conn.Close(); if (count >= 1) { //MessageBox.Show("The brandname is already taken, please try another one"); } else { conn.Open(); MySqlCommand command2 = conn.CreateCommand(); command2.CommandText = "insert into tbl_brandpartner(col_useraccountsid, col_brandname, col_brandaddress, col_brandcontactnum,col_brandemail) " + "values ('" + labelTransactionCode.Text + "','" + textBox4.Text + "','" + textBox7.Text + "','" + textBox8.Text + "','" + textBox12.Text + "')"; command2.ExecuteScalar(); conn.Close(); MessageBox.Show("Successfully added"); Mainframe a = new Mainframe(); a.Show(); this.Hide(); } } }
private void Window_Loaded(object sender, RoutedEventArgs e) { YTDLUpdater updater = new YTDLUpdater(); updater.UpdatingDownloader += Updater_UpdatingDownloader; updater.UpdateYTDL(); if (ProgramConfigReader.GetCurrentConfigData().IsAutoCheckUpdate) { VersionInfo info = ProgramConfigReader.GetLatestVersion(); if ((info.NewVersion != "NOT AVAILABLE") && (info.NewVersion != ProgramConfigReader.GetCurrentConfigData().CurrentVersion)) { MessageBoxResult result = MessageBox.Show("New version available, " + info.NewVersion + " from " + info.VersionDate + Environment.NewLine + "Would you like to update?", "Update Available", MessageBoxButton.YesNo, MessageBoxImage.Information); if (result == MessageBoxResult.Yes) { Mainframe.Navigate(new Uri("OptionsPage.xaml", UriKind.Relative)); return; } } } Mainframe.Navigate(new Uri("DownloadPage.xaml", UriKind.Relative)); }
//private async void UpTimeAsync() //{ // try // { // var pac = package.Id.Version.Major + "." + package.Id.Version.Minor + "." + package.Id.Version.Revision + "." + package.Id.Version.Build; // if (localsettings.Values["_package"].ToString () != pac ) // { // //通过判断版本号改变来配置新的功能 // } // } // catch (Exception ex) // { // await new MessageDialog("包更新验证异常" + ex).ShowAsync(); // } //} #endregion protected override void OnNavigatedTo(NavigationEventArgs e) { //this.InitialBackButton(); try { if (e.NavigationMode == NavigationMode.New) { if (localsettings.Values["_password"] != null) { Mainframe.Navigate(typeof(LockedPage)); } else { Mainframe.Navigate(typeof(MainPage)); } } } catch { } base.OnNavigatedTo(e); }
public MainWindow() { InitializeComponent(); HermesDB = new HermesEntities(); Mainframe.Navigate(new LoginPage()); }
private void MenuButton5_Click(object sender, RoutedEventArgs e) { Mainframe.Navigate(typeof(FoodList)); }
private void MenuButton4_Click(object sender, RoutedEventArgs e) { Mainframe.Navigate(typeof(Rundvisning)); }
public void log() { try { MySqlConnection connection = new MySqlConnection(ConnectionString.myConnection); connection.Open(); if (textBox1.Text == "" || textBox2.Text == "") { MessageBox.Show("You need to login your credentials."); } else if (materialRadioButton1.Checked == true) { MySqlCommand Command = connection.CreateCommand(); Command.Connection = connection; Command.CommandText = "select * from tbl_useraccounts where col_user = '******' and col_password= '******' and col_usertypeid = 1 "; MySqlDataReader read = Command.ExecuteReader(); int count1 = 0; while (read.Read()) { count1++; } connection.Close(); if (count1 == 1) { MySqlCommand copro3 = new MySqlCommand(); connection.Open(); copro3.Connection = connection; copro3.CommandText = "select * from tbl_useraccounts where col_user = '******' and col_password= '******' and col_usertypeid = 1 "; MySqlDataReader copro = copro3.ExecuteReader(); while (copro.Read()) { string user = (copro["col_user"].ToString()); string pass = (copro["col_password"].ToString()); if (user == textBox1.Text && pass == textBox2.Text) { Mainframe a = new Mainframe(); a.Show(); this.Hide(); } else { MessageBox.Show("Invalid username & password. "); textBox1.Clear(); textBox2.Clear(); } } } else { MessageBox.Show("Invalid username & password. "); } } else if (materialRadioButton2.Checked == true && materialRadioButton1.Checked == false) { MySqlCommand Command2 = connection.CreateCommand(); Command2.Connection = connection; Command2.CommandText = "select * from tbl_useraccounts where col_user = '******' and col_password= '******' and col_status='unarchived' and col_usertypeid = 2"; MySqlDataReader read2 = Command2.ExecuteReader(); int count2 = 0; while (read2.Read()) { count2++; } connection.Close(); if (count2 >= 1) { MySqlCommand copro5 = new MySqlCommand(); connection.Open(); copro5.Connection = connection; copro5.CommandText = "select * from tbl_useraccounts where col_user = '******' and col_password= '******' and col_status='unarchived' and col_usertypeid = 2 "; MySqlDataReader copro2 = copro5.ExecuteReader(); while (copro2.Read()) { string userid = (copro2["col_useraccountsid"].ToString()); string user = (copro2["col_user"].ToString()); string pass = (copro2["col_password"].ToString()); if (user == textBox1.Text && pass == textBox2.Text) { TransactionModule a = new TransactionModule(userid); a.Show(); this.Hide(); break; } else { MessageBox.Show("Invalid username & password. "); textBox1.Clear(); textBox2.Clear(); } } } else { MessageBox.Show("Invalid username & password. "); } } }catch (Exception e) { MessageBox.Show("No connection to the host"); } }
private void AdminAnsatteButton_Click(object sender, RoutedEventArgs e) { Mainframe.Navigate(typeof(AdminAnsatte)); }
private void AdminSeTimerButton_Click(object sender, RoutedEventArgs e) { Mainframe.Navigate(typeof(Admin)); }
public MainPage() { this.InitializeComponent(); Mainframe.Navigate(typeof(Greenkeeper)); }
private void OptionsButton_Click(object sender, RoutedEventArgs e) { downloadButton.FontWeight = FontWeights.Normal; optionsButton.FontWeight = FontWeights.Bold; Mainframe.Navigate(new Uri("OptionsPage.xaml", UriKind.Relative)); }
public void Main() { Mainframe.Navigate(new LoginPage()); }
private void Client_Ready(ReadyEventArgs e) { Mainframe.Navigate(new MainPage()); }
private void GreenKeeperButton_Click(object sender, RoutedEventArgs e) { Mainframe.Navigate(typeof(Greenkeeper)); }
public void addnewCashierAccount() { try { MySqlConnection conn = new MySqlConnection(ConnectionString.myConnection); if (label1.Text == "") { MessageBox.Show("Complete the Form"); } else { conn.Open(); MySqlCommand command = conn.CreateCommand(); command.CommandText = "select * from tbl_useraccounts where col_user = '******' "; MySqlDataReader read = command.ExecuteReader(); int count = 0; while (read.Read()) { count++; } conn.Close(); if (count >= 1) { MessageBox.Show("The Username is already taken, please try another one"); } else { conn.Open(); MySqlCommand command2 = conn.CreateCommand(); command2.CommandText = "insert into tbl_useraccounts (col_usertypeid, " + "col_user, " + "col_password, " + "col_lastname, " + "col_firstname, " + "col_middlename, " + "col_address, " + //"col_dateofbirth, " + "col_gender, " + "col_contactnum, " + "col_status) " + "values ((SELECT col_usertypeid from tbl_usertype where col_userrole='Cashier'),'" + textBox9.Text + "','" + textBox11.Text + "','" + textBox3.Text + "','" + textBox1.Text + "','" + textBox2.Text + "','" + textBox5.Text + "','" + //dateTimePicker1.Text + "','" + comboBox1.SelectedItem.ToString() + "','" + textBox6.Text + "','unarchived')"; command2.ExecuteScalar(); conn.Close(); MessageBox.Show("Saved Successfully"); Mainframe a = new Mainframe(); a.Show(); this.Hide(); } } } catch (Exception e) { MessageBox.Show("No Connection to host"); } }
private void AdminDoneTasksButton_Click(object sender, RoutedEventArgs e) { Mainframe.Navigate(typeof(Admindonetasks)); }
private void MenuButton1_Click(object sender, RoutedEventArgs e) { Mainframe.Navigate(typeof(PianoPage)); }
private void AdminlogudButton_Click(object sender, RoutedEventArgs e) { Mainframe.Navigate(typeof(Greenkeeper)); AdminPanel.Visibility = Visibility.Collapsed; LogudPanel.Visibility = Visibility.Visible; }
private void MenuButton3_Click(object sender, RoutedEventArgs e) { Mainframe.Navigate(typeof(Store)); }
private void MenuButton1_OnClick(object sender, RoutedEventArgs e) { Mainframe.Navigate(typeof(BesøgendeStatestik)); }
private void MenuButton2_Click(object sender, RoutedEventArgs e) { Mainframe.Navigate(typeof(Tickets)); }