示例#1
0
        private void LihatOrderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Approved_Draft ad = new Approved_Draft();
            //ad.Show();
            listorder l = new listorder();

            l.Show();
        }
示例#2
0
        private void Button2_Click_1(object sender, EventArgs e)
        {
            conn.Close();
            conn.Open();
            //Detail d = new Detail();
            //d.Show();
            string        idpeg     = Form1.id_pegawai;
            OracleCommand id        = new OracleCommand("select AUTOGEN_ID from dual", conn);
            string        idheader  = id.ExecuteScalar().ToString();
            string        idpayterm = comboBox2.SelectedValue.ToString();
            string        idpaytype = comboBox1.SelectedValue.ToString();
            OracleCommand cmd       = new OracleCommand("insert into order_header values('" + idheader + "','" + comboBox4.SelectedValue.ToString() + "',to_date('" + dateTimePicker1.Value.ToString("dd/MM/yyyy") + "','DD/MM/YYYY'),to_date('" + DateTime.Now.ToString("dd/MM/yyyy") + "','DD/MM/YYYY'),0,'0','" + idpeg + "','" + idpayterm + "','" + idpaytype + "','" + Form1.idb + "')", conn);

            cmd.ExecuteNonQuery();
            listorder l = new listorder();

            this.Hide();
            l.ShowDialog();
            this.Close();
            conn.Close();
        }
示例#3
0
        private void Button2_Click(object sender, EventArgs e)
        {
            if (button2.Text == "Approve")
            {
                conn.Close();
                conn.Open();


                query = "select count(id_pegawai) from hak_akses where id_pegawai = '" + id_pegawai + "' and id_hak_akses = 'HA003'";
                cmd   = new OracleCommand(query, conn);
                int bolehapprove = int.Parse(cmd.ExecuteScalar().ToString());

                query         = "select count(id_pegawai) from hak_akses where id_pegawai = '" + id_pegawai + "' and id_hak_akses = 'HA006'";
                cmd           = new OracleCommand(query, conn);
                bolehapprove += int.Parse(cmd.ExecuteScalar().ToString());
                if (bolehapprove > 0)
                {
                    query = "Update order_header set status_order = 1  where id_order = '" + id_order + "' ";
                    cmd   = new OracleCommand(query, conn);
                    cmd.ExecuteNonQuery();
                    listorder lo = new listorder();
                    Hide();
                    lo.ShowDialog();
                    Close();
                }
                else
                {
                    MessageBox.Show("Tidak Memiliki Akses");
                }

                conn.Close();
            }
            else if (button2.Text == "Make Order")
            {
                conn.Close();
                conn.Open();


                query = "Update order_header set status_order = 6  where id_order = '" + id_order + "' ";
                cmd   = new OracleCommand(query, conn);
                cmd.ExecuteNonQuery();
                listorder lo = new listorder();
                Hide();
                lo.ShowDialog();
                Close();

                conn.Close();
            }
            else if (button2.Text == "Receive")
            {
                conn.Close();
                conn.Open();


                query = "Update order_header set status_order = 4  where id_order = '" + id_order + "' ";
                cmd   = new OracleCommand(query, conn);
                cmd.ExecuteNonQuery();
                listorder lo = new listorder();
                Hide();
                lo.ShowDialog();
                Close();
                conn.Close();
            }
        }
示例#4
0
        private void Approved_Draft_FormClosed(object sender, FormClosedEventArgs e)
        {
            listorder l = new listorder();

            l.Show();
        }