Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            try
            {
                User user = DataRead.GetUser(1);
            }
            catch (Exception e)
            {
                string msg = e.Message;
                return;
            }
        }
Ejemplo n.º 2
0
        private void Button_Click(object sender, EventArgs e)
        {
            //   MySqlConnection conn = null;
            ///  MySqlDataReader rdr = null;

            try
            {
                //  conn = new MySqlConnection("Server=kira-web.mysql.database.azure.com; Port=3306; Database=kira-db; Uid=incentrio@kira-web; Pwd=Incentri0; SslMode=Preferred;");
                //  conn.Open();

                //   string stm =  "SELECT * FROM kira_user WHERE username = '******' and pass ='******'";

                //   MySqlCommand cmd = new MySqlCommand(stm, conn);
//             rdr = cmd.ExecuteReader();

                //     int count = 0;
                //     while (rdr.Read())
                //    {

                //       count ++;

                // }
                User user = DataRead.GetUser(this.txt_user_name.Text, this.txt_password.Text);



                /*    if(count == 1){
                 *      MessageBox.Show("Username and password is correct");
                 *
                 *  }
                 *  if(count >1){
                 *      MessageBox.Show(" Duplicate Username and password, please try again!");
                 *
                 *  }
                 *  if(count <1){
                 *      MessageBox.Show(" Username and password is incorrect");
                 *
                 *  } */
            } catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 3
0
        public MainWindow()
        {
            InitializeComponent();


            try
            {
                User user = DataRead.GetUser(1);
            }
            catch (Exception e)
            {
                string msg = e.Message;
                return;
            }

            //  var loginView = new LoginViews();
            //  var window = new MainWindow();
            //  window.Content = loginView;
        }