Beispiel #1
0
        //public Employee karyawan = new Employee();

        private async void btn_login_Click(object sender, RoutedEventArgs e)
        {
            SqlConnection con = new SqlConnection(Helper.conval("thedb"));
            SqlCommand    cmd = new SqlCommand($"SELECT Sandi, ID , Nama , JobID , Username FROM Employee WHERE Username = '******'", con);

            try
            {
                con.Open();
                SqlDataReader sdr = cmd.ExecuteReader();
                while (sdr.Read())
                {
                    Employee.Nama     = sdr["Nama"].ToString();
                    Employee.Sandi    = sdr["Sandi"].ToString();
                    Employee.JobName  = sdr["JobID"].ToString();
                    Employee.Username = sdr["Username"].ToString();
                    Employee.ids      = sdr["ID"].ToString();
                }

                if (Employee.Sandi == MySHA256ENC.SHA256Enc.Get_Enc(pb_box.Password) && Employee.Username == tb_username.Text)
                {
                    this.Dispatcher.Invoke(() => LoginWindow.BeginAnimation(HeightProperty, new DoubleAnimation(450, 0, TimeSpan.FromSeconds(0.5))));

                    status = true;
                    await Task.Delay(485);

                    Beranda beranda = new Beranda(this);
                    this.Hide();
                }
                else
                {
                    borderluar.BorderBrush = Brushes.Red;
                    await Task.Delay(1000);

                    borderluar.BorderBrush = Brushes.Cyan;
                }
                sdr.Close();
                con.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "ERROR");
                this.Close();
            }

            //MessageBox.Show(startSHA256(pb_box.Password), startSHA256(pb_box.Password).Length.ToString());
            //Parallel.Invoke(() => LoginWindow.BeginAnimation(WidthProperty, new DoubleAnimation(400, 0, TimeSpan.FromSeconds(1))));
        }
Beispiel #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.BerandaWindow = ((HotelApp.Beranda)(target));

            #line 11 "..\..\Beranda.xaml"
                this.BerandaWindow.Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.baratas = ((System.Windows.Controls.Border)(target));
                return;

            case 3:
                this.lbl_username = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.lbl_JobName = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.Sidebar = ((System.Windows.Controls.Grid)(target));
                return;

            case 6:
                this.tg_btn_ham = ((System.Windows.Controls.Primitives.ToggleButton)(target));

            #line 223 "..\..\Beranda.xaml"
                this.tg_btn_ham.Checked += new System.Windows.RoutedEventHandler(this.tg_btn_ham_Checked);

            #line default
            #line hidden

            #line 223 "..\..\Beranda.xaml"
                this.tg_btn_ham.Unchecked += new System.Windows.RoutedEventHandler(this.tg_btn_ham_Unchecked);

            #line default
            #line hidden
                return;

            case 7:
                this.tgHamRotate = ((System.Windows.Media.RotateTransform)(target));
                return;

            case 8:
                this.listview = ((System.Windows.Controls.ListView)(target));
                return;

            case 9:
                this.button1 = ((System.Windows.Controls.Button)(target));

            #line 264 "..\..\Beranda.xaml"
                this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.button2 = ((System.Windows.Controls.Button)(target));
                return;

            case 11:
                this.button3 = ((System.Windows.Controls.Button)(target));
                return;

            case 12:
                this.button4 = ((System.Windows.Controls.Button)(target));
                return;

            case 13:
                this.button5 = ((System.Windows.Controls.Button)(target));
                return;

            case 14:
                this.button6 = ((System.Windows.Controls.Button)(target));
                return;

            case 15:
                this.button7 = ((System.Windows.Controls.Button)(target));
                return;

            case 16:
                this.btn_exit = ((System.Windows.Controls.Button)(target));

            #line 333 "..\..\Beranda.xaml"
                this.btn_exit.Click += new System.Windows.RoutedEventHandler(this.btn_exit_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.MainPanel = ((System.Windows.Controls.Grid)(target));
                return;
            }
            this._contentLoaded = true;
        }