Exemplo n.º 1
0
        private void FormTambahSuratJalan_Load(object sender, EventArgs e)
        {
            comboBoxJenis.Items.AddRange(new string[] { "Masuk", "Keluar" });
            this.Location = new Point(500, 26);
            FormatDataGrid();
            pPeriode = Periode.GetPeriodeTerbaru();
            textBoxKode.MaxLength  = 5;
            textBoxNoSurat.Enabled = false;

            comboBoxSuratPermintaan.DropDownStyle = ComboBoxStyle.DropDownList;
            comboBoxJenis.DropDownStyle           = ComboBoxStyle.DropDownList;

            string noSuratBaru;
            string hasilGenerate = SuratJalan.GenerateNoSuratJalan(out noSuratBaru);

            textBoxNoSurat.Clear();
            if (hasilGenerate == "1")
            {
                textBoxNoSurat.Text = noSuratBaru;
            }
            else
            {
                MessageBox.Show("Gagal melakukan generate code. Pesan kesalahan: " + hasilGenerate);
            }

            dateTimePickerTgl.Value   = DateTime.Now;
            dateTimePickerTgl.Enabled = false;

            string hasilBaca = SuratPermintaan.BacaData("JO.status", "P", listHasilSuratPer);

            if (hasilBaca == "1")
            {
                comboBoxSuratPermintaan.Items.Clear();
                for (int i = 0; i < listHasilSuratPer.Count; i++)
                {
                    comboBoxSuratPermintaan.Items.Add(listHasilSuratPer[i].NoSuratPermintaan);
                }
            }
            else
            {
                comboBoxSuratPermintaan.Items.Clear();
            }
            if (comboBoxSuratPermintaan.Items.Count != 0)
            {
                comboBoxSuratPermintaan.SelectedIndex = 0;
            }
            comboBoxJenis.SelectedIndex = 1;

            FormUtama form = (FormUtama)this.Owner.MdiParent;

            labelKodePgw.Text = form.labelKodePgw.Text;
            labelNamaPgw.Text = form.labelNamaPgw.Text;
        }
Exemplo n.º 2
0
        public void FormDaftarSuratPermintaan_Load(object sender, EventArgs e)
        {
            this.Location = new Point(0, 0);
            comboBoxCari.DropDownStyle = ComboBoxStyle.DropDownList;

            FormatDataGrid();

            string hasilBaca = SuratPermintaan.BacaData("", "", listHasilPermintaan);

            if (hasilBaca == "1")
            {
                dataGridViewSurat.Rows.Clear();

                for (int i = 0; i < listHasilPermintaan.Count; i++)
                {
                    dataGridViewSurat.Rows.Add(listHasilPermintaan[i].NoSuratPermintaan, listHasilPermintaan[i].Tanggal.ToString("dddd, dd MMMM yyyy"),
                                               listHasilPermintaan[i].Keterangan, listHasilPermintaan[i].JobOrder.KodeJobOrder, listHasilPermintaan[i].JobOrder.Status
                                               );
                }
            }
        }
Exemplo n.º 3
0
        private void comboBoxSuratPermintaan_SelectedIndexChanged(object sender, EventArgs e)
        {
            string hasilBaca2 = SuratPermintaan.BacaData("nosuratpermintaan", comboBoxSuratPermintaan.Text, listHasilSuratPer);

            if (hasilBaca2 == "1")
            {
                if (listHasilSuratPer.Count > 0)
                {
                    kodeJob        = listHasilSuratPer[0].JobOrder.KodeJobOrder;
                    quantity       = listHasilSuratPer[0].JobOrder.Quantity;
                    directMaterial = listHasilSuratPer[0].JobOrder.DirectMaterial;
                    totalJobCost   = listHasilSuratPer[0].JobOrder.DirectLabor + listHasilSuratPer[0].JobOrder.DirectMaterial +
                                     listHasilSuratPer[0].JobOrder.OverheadProduksi;
                }
            }
            else
            {
                MessageBox.Show("Perintah SQL gagal dijalankan. Pesan kesalahan: " + hasilBaca2);
            }
            comboBoxJenis_TextChanged(sender, e);
        }