Example #1
0
        private void btnMasuk_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtNamaUser.Text))
            {
                iMessage.eBoxOk("Silakan isi user Anda.");
            }
            else if (string.IsNullOrEmpty(txtPassUser.Text))
            {
                iMessage.eBoxOk("Silakan isi password Anda.");
            }
            else
            {
                userClass user = new userClass("", txtNamaUser.Text, encryptClass.Encrypt(txtPassUser.Text, "S@lv4tion", "1", "SHA1", 2, "abcdefghijklmnop", 256));

                switch (user.validateUser())
                {
                case -1:
                    iMessage.iBoxOk("Terjadi kesalahan sistem." + Environment.NewLine + "Harap hubungi Adminstrator Anda.");
                    break;

                case 0:
                    iMessage.iBoxOk("Nama user atau password Anda salah.");
                    break;

                case 1:
                    this.Dispose();
                    break;

                default:
                    break;
                }
            }
        }
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //////////                                          Event                                            //////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void frmPassword_Load(object sender, EventArgs e)
        {
            user = new userClass(AbsensiJemaatDesk.Properties.Settings.Default.userId,
                                 AbsensiJemaatDesk.Properties.Settings.Default.userName,
                                 null);

            this.KeyDown += new KeyEventHandler(this.frmPassword_KeyDown);
            this.txtNewPass.TextChanged += new EventHandler(txtNewPass_TextChanged);

            LblMenu.BackColor = ColorTranslator.FromHtml("#58D3F7");
        }
        private void frmUser_Load(object sender, EventArgs e)
        {
            user = new userClass(AbsensiJemaatDesk.Properties.Settings.Default.userId,
                                 AbsensiJemaatDesk.Properties.Settings.Default.userName,
                                 null);


            LblMenu.BackColor = ColorTranslator.FromHtml("#58D3F7");
            //refresh();

            dgvUsers.Rows.Add();
            dgvUsers[0, 0].Value = "ADMINISTRATOR";
        }
Example #4
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //////////                                          Event                                            //////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void frmUser_Load(object sender, EventArgs e)
        {
            user = new userClass(AbsensiJemaatDesk.Properties.Settings.Default.userId,
                                 AbsensiJemaatDesk.Properties.Settings.Default.userName,
                                 null);

            this.VisibleChanged            += new EventHandler(this.frmUser_VisibleChanged);
            this.KeyDown                   += new KeyEventHandler(this.frmUser_KeyDown);
            this.dgvUsers.SelectionChanged += new EventHandler(dgvUsers_SelectionChanged);
            this.txtCari.TextChanged       += new EventHandler(txtCari_TextChanged);

            LblMenu.BackColor = ColorTranslator.FromHtml("#58D3F7");
            getData();
        }