private void btnBatal_Click(object sender, EventArgs e)
        {
            cleartxt();
            errorProvider1.Clear();
            this.Hide();
            FormPresensiInstruktur myParent = (FormPresensiInstruktur)this.Parent;

            myParent.enable();
        }
 private void btnTambah_Click(object sender, EventArgs e)
 {
     if (flagperintah == 1)
     {
         if (cektxt() == true)
         {
             errorProvider1.Clear();
             PresensiInstrukturEntity input = new
                                              PresensiInstrukturEntity(int.Parse(cmbIDPegawai.SelectedValue.ToString()), int.Parse(cmbJadwal.Text.ToString()), DateTime.Now, txtKeterangan.Text);
             con.EntryPresensiPegawai(input);
             //con.UpdatePointPegawai(con.GetPointPresensiById(con.GetLastIdPresensi()), int.Parse(cmbIDPegawai.SelectedValue.ToString()));
             cleartxt();
             this.Hide();
             FormPresensiInstruktur myParent = (FormPresensiInstruktur)this.Parent;
             myParent.enable();
         }
     }
 }
Example #3
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            user = edUser.Text;
            pass = edPass.Text;

            if (lc.cekLogin(user, pass) == true)
            {
                role         = lc.getRoleUser(user, pass);
                last_id_lama = JC.LastIdBeforeUpdate();

                if (DateTime.Now.DayOfWeek.ToString() == 1.ToString())
                {
                    JC.GenerateOneWeekJadwal();
                    last_id_baru = JC.LastIdBeforeUpdate();
                }

                if (role == 1)
                {
                    this.Hide();
                    FormPegawai utama = new FormPegawai();
                    // utama.setToolStripUser("Pengguna : Admin - " + user);
                    utama.ShowDialog();
                    this.Close();
                }

                else if (role == 2)
                {
                    this.Hide();
                    FormPresensiInstruktur utama = new FormPresensiInstruktur();
                    //utama.setToolStripUser("Pengguna : Manajer Operasional - " + user);
                    utama.ShowDialog();
                    this.Close();
                }

                else if (role == 3)
                {
                    this.Hide();
                    Transaksi utama = new Transaksi();
                    //utama.setToolStripUser("Pengguna : Kasir - " + user);
                    utama.Pegawai      = lc.getIdPegawaiByIdLogin(lc.getIdByUsername(user));
                    utama.Nama_pegawai = lc.getNamaPegawai(lc.getIdByUsername(edUser.Text));
                    utama.ShowDialog();
                    this.Close();
                }

                else
                {
                    MessageBox.Show("Maaf user ini tidak memiliki hak untuk masuk ke sistem");
                }
            }

            else if (edUser.Text == "" || edPass.Text == "")
            {
                MessageBox.Show("Maaf, silahkan lengkapi data username dan password");
                if (edUser.Text == "")
                {
                    edUser.Text = "";
                    edUser.Focus();
                }
                else if (edPass.Text == "")
                {
                    edPass.Text = "";
                    edPass.Focus();
                }
            }

            else
            {
                MessageBox.Show("Maaf, username atau password salah");
                edUser.Text = "";
                edUser.Focus();
            }
        }