예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            string id = textBox1.Text;
            string nama = textBox2.Text;
            string alamat = richTextBox1.Text;
            string jeniskelamin = comboBox1.Text;
            string phone = textBox3.Text;
            string hand = textBox4.Text;
            string mail = textBox5.Text;
            string username = textBox6.Text;
            string password = MD5Password.EncodePassword(textBox7.Text);
            string date = dateTimePicker1.Text;
            string jabatan = comboBox2.Text;
            string level = comboBox3.Text;
            string login = comboBox4.Text;

            Program.conn.Open();

            string fileGambar = of.FileName;
            byte[] blob = Program.getBlobImage(fileGambar);
            Program.conn.ExecuteBlobQuery("INSERT INTO pegawai (FOTO_PEGAWAI) VALUES(:PARAM1)", "PARAM1", blob);

            string input = "INSERT INTO pegawai (ID_NIP_PEGAWAI,NAMA_PEGAWAI,ALAMAT_PEGAWAI,JK,NO_TELP_PEGAWAI,NO_HP_PEGAWAI,EMAIL_PEGAWAI,USERNAME,PASSWORD,DITERIMA_KERJA,JABATAN,FLAG_LEVEL,ISLOGIN) VALUES ('"+id+"','"+nama+"','"+alamat+"','"+jeniskelamin+"','"+phone+"','"+hand+"','"+mail+"','"+username+"','"+password+"',to_date('"+date+"','mm/DD/yyyy'),'"+jabatan+"',"+level+","+login+")";
            Program.conn.ExecuteNonQuery(input);

            Program.conn.Close();
            MessageBox.Show("Data berhasil diinputkan");

            this.Close();
            formMasterAdmin amin = new formMasterAdmin();
            amin.Show();
        }
예제 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            string plat = textBox1.Text;
            string merk = PassBox.Text;
            string tipe = textBox2.Text;
            string tahun = dateTimePicker1.Text;
            string silinder = textBox3.Text;
            string rangka = textBox4.Text;
            string mesin = textBox5.Text;
            string warna = textBox6.Text;
            string bahan = comboBox1.Text;
            string jenis = comboBox2.Text;
            string harga = textBox8.Text;
            string status = comboBox3.Text;

            Program.conn.Open();

               // string fileGambar = of.FileName;
               // byte[] blob = Program.getBlobImage(fileGambar);
            //  Program.conn.ExecuteBlobQuery("INSERT INTO mobil (FOTO_MOBIL) VALUES(:PARAM1)", "PARAM1", blob);

            string input = "INSERT INTO mobil (ID_MOBIL,MERK_MOBIL,JENIS_MOBIL,TAHUN_PEMBUATAN,ISI_SILINDER,NO_RANGKA_MOBIL,NO_MESIN_MOBIL,WARNA,BAHAN_BAKAR,GOLONGAN_MOBIL,HARGA_SEWA,STATUS_SEWA) VALUES ('" +plat+ "','" +merk+ "','" +tipe+ "',to_date('" +tahun+ "','mm/DD/yyyy')," +silinder+ ",'" +rangka+ "','" + mesin + "','" + warna + "','" + bahan + "','"+ jenis + "'," + harga + "," + status + ")";
            Program.conn.ExecuteNonQuery(input);

            Program.conn.Close();
            MessageBox.Show("Data berhasil diinputkan");

            this.Close();
            formMasterAdmin amin = new formMasterAdmin();
            amin.Show();
        }
예제 #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            string id = textBox1.Text;
            string nama = PassBox.Text;
            string tempatlahir = textBox2.Text;
            string tanggal = dateTimePicker1.Text;
            string warga = comboBox1.Text;
            string ident = comboBox2.Text;
            string noid = textBox5.Text;
            string jenkel = comboBox3.Text;
            string alamat = richTextBox1.Text;
            string hp = textBox8.Text;
            string telp = textBox7.Text;
            string gabung = dateTimePicker2.Text;

            Program.conn.Open();

            //string fileGambar = of.FileName;
               // byte[] blob = Program.getBlobImage(fileGambar);
            //Program.conn.ExecuteBlobQuery("INSERT INTO pelanggan (,FOTO_PELANGGAN) VALUES(:PARAM1)", "PARAM1", blob);

            string input = "INSERT INTO pelanggan (ID_LANGGAN,NAMA_LENGKAP,TEMPAT_LAHIR,TANGGAL_LAHIR,WARGA_NEGARA,JENIS_IDENTITAS,NO_IDENTITAS,J_KEL,ALAMAT,NO_HP,NO_TELP,TANGGAL_BERGABUNG) VALUES ('" + id + "','" + nama + "','" + tempatlahir + "',to_date('" + tanggal + "','mm/DD/yyyy'),'" + warga + "','" + ident + "','" + noid + "','" + jenkel + "','" + alamat + "','"+hp+"','"+telp+"',to_date('" + gabung + "','mm/DD/yyyy'))";
            Program.conn.ExecuteNonQuery(input);

            Program.conn.Close();
            MessageBox.Show("Data berhasil diinputkan");

            this.Close();
            formMasterAdmin amin = new formMasterAdmin();
            amin.Show();
        }
예제 #4
0
        private void _Login_Click(object sender, EventArgs e)
        {
            string username = textBox1.Text;
            string mentah = PassBox.Text;
            string password = MD5Password.EncodePassword(mentah);
            string sandi;
            string kondisi = ("SELECT password FROM pegawai WHERE username = '******'");
            int kondisi_level;

            Program.conn.Open();
            tabel = Program.conn.ExecuteDataTable(kondisi);
            int baris = tabel.Rows.Count;
            if (baris > 0)
            {
                if (tabel.Rows[0].ItemArray[0].ToString() !=null)
                {
                    sandi = tabel.Rows[0].ItemArray[0].ToString();
                    Program.conn.Close();
                    if (sandi == password){
                        kondisi = "UPDATE pegawai SET islogin = 1 WHERE username = '******' AND password = '******'";
                        Program.conn.Open();
                        Program.conn.ExecuteNonQuery(kondisi);
                        Program.conn.Close();

                        kondisi = "SELECT flag_level FROM pegawai WHERE username = '******' AND password ='******'";
                        Program.conn.Open();
                        tabel = Program.conn.ExecuteDataTable(kondisi);
                        kondisi_level = int.Parse(tabel.Rows[0].ItemArray[0].ToString());

                        if (kondisi_level == 1)
                        {
                            this.Hide();
                            formMasterAdmin mimin = new formMasterAdmin();
                            mimin.Show();
                        }
                        else {
                            this.Hide();
                            formKasir kasir = new formKasir();
                            kasir.Show();
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Wrong username or Password");
            }
        }
예제 #5
0
 private void _BacktoMenu_Click(object sender, EventArgs e)
 {
     this.Close();
     formMasterAdmin min = new formMasterAdmin();
     min.Show();
 }